cert-proxy-client: ssl-cert group grants traversal but cannot read private keys ai:claude-opus-5 #48
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
mod-nag
mod-nag
mod-nag
mod-nag/ignore
mod-nag/ignore
mod-nag/ignore
nagonag
nagonag/ignore
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
heiko/cert-proxy#48
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Splitting this out of #45, where it surfaced. This is not a regression — the behaviour is identical in the pre-gogogo packaging, so it is a pre-existing design question rather than a packaging bug.
Observation
The client package sets up
/var/lib/cert-proxy/certsas0750 root:ssl-cert(previously via a hand-writtendpkg-statoverrideinpostinst, since5d5ce00viasystemd/cert-proxy-client.tmpfiles). The apparent intent is that members ofssl-cert— nginx, exim, dovecot, ... — can read the downloaded key material.They cannot. Only the top-level
certs/directory carries the group; everything below it isroot:root:shared.Mkdir()(internal/shared/mkdir.go), which callsos.Mkdir(dir, 0777)— so with the usual umask they end up0755 root:root;privkey.pemis written0600bywriteFile()(cmd/cert-proxy-client/cert/cert.go,private == true), ownerroot.So
ssl-certmembership buys directory traversal intocerts/and nothing else. Any consumer that needs a private key must run as root, which makes the group ownership oncerts/decorative.Question
Which of these is the intended design?
ssl-certgroup serves no purpose and the sysusers/tmpfiles snippets could drop it, simplifying the package.ssl-cert. Then the client needs to chgrp/chmod what it writes — roughly0640 root:ssl-certforprivkey.pemand0750 root:ssl-certfor the domain directories — presumably behind an option such as-certgroup, since cert-proxy-client also runs on hosts with nossl-certgroup at all (and on Windows).Option 2 is the only one under which the current directory mode makes sense, but it is a behaviour change and needs a decision before implementation.
Not affected
#45 itself (the missing
/etc/cert-proxy/hookand/var/lib/cert-proxy/certs) is fixed by5d5ce00and is independent of this.