When I sshed into my server today, it said I had mail. I checked /var/mail/{myuser} and got a mail from caddy. The title was “SECURITY information for {hostname}”. The message was this.
caddy : user NOT in sudoers ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /usr/local/share/ca-certificates/Caddy_Local_Authority_-_2025_ECC_Root_31435960950297150297199787413716908247066220.crt
I’m still learning this self-hosting thing, I know enough to set stuff up but I still know barely anything about security, and the message looks kinda scary, so I would like to know what it means, thanks in advance. Note that I was messing around with Caddy and stuff yesterday, so maybe that has something to do with it, but I’m not sure.
Removed by mod
I’m much less worried about an attacker messing w/ my certs (that’s a pretty sophisticated attack) and more worried about privilege escalation where the attacker gets root access. Caddy is intended to be externally facing, so it’ll be getting the brunt of the attacks (like this one that attacks HTTP 1.1). If someone is able to find an exploit to allow remote code execution, being able to run commands with
sudo
is a pretty big deal.That’s a big part of why I run my services in containers, and also why I’m switching from Docker to Podman. Docker runs everything as root by default, and it’s a pain to run things as non-root. Podman runs everything as an underprivileged user by default, which forces the admin to configure it properly. If an attacker is able to break out of Docker, it’ll have root access to the system, whereas if an attacker breaks out of Podman, they’ll just have whatever that user’s permission is.
If I’m going to expose something to the internet, I want to make sure it’s properly configured to reduce the chances of getting a rootkit or something.