-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CAP_NET_ADMIN to caddy binary for 2.7 #299
Conversation
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Not sure if this works or has the desired effect. Regular container ports are proxied by docker. So caddy would only be able to manipulate the one within the container? (unless host networking is used) |
@bt90 this was an experiment that probably won't work as-is (see the failing build)
Right, but ultimately they still require CAP_NET_ADMIN to make certain changes. I'm not super clear on the reason behind this... it has something to do with improved UDP performance with the QUIC implementation, though it can work without it. From a discussion @francislavoie and I were having yesterday we'll probably just have to document that users should use |
That in combination with |
Probably should be cautious?
Support for
IIRC this depends on network mode (not just host), and daemon configuration.
From within it's network namespace I think? The first link I provided above notes that from kernel 5.0 a feature available via the capability was relaxed to be usable outside of the
Since the image switched to non-root, this wouldn't be sufficient? You can only add caps for the You can set them via file attributes as a "capability-dumb" binary (
I'm not a security expert, and I know it's used for other software like Fail2Ban to do it's thing, just making note of it here since the image adopted non-root user, but granting capabilities that add risk may be worth noting (especially when not absolutely needed), rather than just configuring for such implicitly 😅 (granted this requires an explicit If you're going to document the |
As a (happy!) user of Caddy in Docker, I would prefer to manually update the UDP receive and send buffer settings rather than have Caddy handle this with the CAP_NET_ADMIN capability on my behalf. I appreciate the focus on usability and performance, but I share @polarathene's remarks that this capability could pose security risks. Perhaps it's possible instead to include some copy-pastable lines in the documentation that make this manual effort less of a burden? |
@childersd the NET_ADMIN capability is already documented in the DockerHub docs (scroll to Given it's been almost a year, this has stalled, and given the potential security impact, I'm going to just close this. |
👆
EDIT: I mixed up the capability
It's clear, although an inline comment above the capability in the The equivalent |
Related to caddyserver/dist#97