If you have anything exposed, scripts and bots are testing your server all day, every day. So long as you've got proper security in place, ignore the failed attempts.
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I can't believe it. The incident has actually been reported!
I don't use Caddy, but it seems like it tried to generate and write a TLS certificate into /usr/local
, but didn't have the necessary permissions. Basically it tried to use sudo tee ...
to write a file. Is Caddy running in a container? If it is, you might need to create a volume at /usr/local/share/ca-certificates
. If not in a container, you'll need to grant the caddy
user write permissions in that directory.
But to answer your question directly, it's not a cause for concern. You're not getting hacked, it's just a configuration error.
Caddy should never run sudo IMO, I think it's also a software bug.
You're likely looking for this docs section for Caddy. The failure is the automated request to populate Caddy's root CA cert to the host system, but obviously failed as it doesn't have root permissions. As the docs state, if you intend to use the local HTTPS functionality of Caddy, you can manually run caddy trust
privileged in order to populate the Caddy root CA cert manually. If you intend to disable the local HTTPS functionality (such as if you're running Caddy behind a http reverse proxy), you can ignore the mail message.
Thanks for clearing my anxieties :) Sometimes I feel an irrational fear that perhaps someone has broken into my server because of my lack of security knowledge, so having that mail come in was very anxiety inducing.
Yeah I think it's just a false alarm.
I would suggest looking into how sudoers works. I might just be that you asked caddy to do something that required root and forgot to sudo the command ?
Still double check the timestamp and verify that it was when you tinkered. Use "history" to look for previous commands and maybe the timestamp ?
The way I see it something (probably caddy) wanted to check a TLS certificate and had to concatenate all the certificate authorities to check if an adequate CA was there. And it failed to access what looks like a local CA that is autosigned ? Still worth checking your CA has adequate / similar permission as the others.