caddy/internal
Francis Lavoie 40f740f168
core: Raise CAP_NET_BIND_SERVICE when binding privileged ports (#8102)
* core: Raise CAP_NET_BIND_SERVICE when binding privileged ports

When CAP_NET_BIND_SERVICE is in the permitted set but not the effective
set, raise it on a dedicated locked OS thread just for the bind, then
lower it again and let the thread exit.

This allows the binary to be granted the capability with
`setcap cap_net_bind_service=+p` instead of `=+ep`. With the effective
bit set, the kernel refuses to exec the binary at all when the
capability can't be granted (e.g. `docker run --cap-drop ALL`, or an
empty systemd CapabilityBoundingSet), even if no privileged port is
ever bound.

* core: Move bind capability helpers into internal package

(cherry picked from commit c8341d5b69)
2026-11-03 00:52:58 -05:00
..
filesystems events: Refactor; move Event into core, so core can emit events (#6930) 2025-03-29 08:15:43 -06:00
metrics
…
testmocks caddytls: verifier: caddyfile: re-add Caddyfile support (#6127) 2024-02-26 00:13:48 +03:00
bindcap_linux.go core: Raise CAP_NET_BIND_SERVICE when binding privileged ports (#8102) 2026-11-03 00:52:58 -05:00
bindcap_linux_test.go core: Raise CAP_NET_BIND_SERVICE when binding privileged ports (#8102) 2026-11-03 00:52:58 -05:00
bindcap_other.go core: Raise CAP_NET_BIND_SERVICE when binding privileged ports (#8102) 2026-11-03 00:52:58 -05:00
logbuffer.go logging: Adjustments to BufferedLog to keep logs in the correct order (#7257) 2025-09-15 09:29:50 -06:00
logmarshalers.go admin: Redact sensitive request headers in API logs (#7578) 2026-04-17 14:56:42 -06:00
logs.go internal: fix `MaxSizeSubjectsListForLog` off-by-one when `maxToDisplay` is `0` (#7970) 2026-09-26 18:51:36 +10:00
logs_test.go internal: fix `MaxSizeSubjectsListForLog` off-by-one when `maxToDisplay` is `0` (#7970) 2026-09-26 18:51:36 +10:00
ranges.go caddytls,caddyhttp: Placeholders for some TLS and HTTP matchers (#6480) 2024-08-07 11:02:23 -06:00
sockets.go
…