I'd like to have the ability to use a unix socket as the admin endpoint for Caddy 2
It appears from the documentation that the admin interface requires a TCP listener socket, and doesn't provide authentication as far as I can tell. The issue with that is anybody who gets RCE on a box running Caddy, even as nobody, will be able to completely reconfigure Caddy. This isn't an issue with normal applications which simply read from a root-owned file on startup and reload (such as Caddy <=1).
Alternatives that could be implemented by developers:
Alternatives for users: Not using Caddy 2.
None I could find in a couple searches
Good point. The admin endpoint was one of the first things written, before Caddy had a method to parse listener addresses for any network type. Now that we have that, it was easy to add. You can specify a unix socket like so:
"admin": {
"listen": "unix//path/to/socket"
}
I have some plans for authentication and authorization of the admin endpoint in the future, but for now binding to local interface will have to do. Thanks!
Kudos on the literal fastest response, let alone fix, ever to an issue I've reported! Thanks!
Most helpful comment
Good point. The admin endpoint was one of the first things written, before Caddy had a method to parse listener addresses for any network type. Now that we have that, it was easy to add. You can specify a unix socket like so:
I have some plans for authentication and authorization of the admin endpoint in the future, but for now binding to local interface will have to do. Thanks!