Multiple daemon applications would like to access the same TLS certificates (or chain, or private) keys.
- NGINX wants to access /etc/letsencrypt/live/example.org/privkey.pem
- So does Apache.
- And BIND.
- And my favorite [sftdyn] Github package.
And they all run their daemon with different GID and group name.
My attempts at securing the private key in a safe manner, yet sharing it across different daemons (having their own GID) with the following various approaches (and some later nixed) are:
Set file permission to "blaze of glory"
chmod a+rwx
. This got nixed because it reveals the secret privkey.pem file to the entire filesystem.Create a new group
keys
and addnginx
,apache
,named
(orbind
), andsftdyn
group to thekeys
group in /etc/group (or usingadduser nginx keys
). Use newkeys
group on the PEM files. Then cap PEM files' permission withchmod 0640
.Use
setfacl
.
Which of 2 or 3 is best to address this thorny issue?