nixos/acme: Use more secure chmods
Previous settings would make files executable in the certs directories.
This commit is contained in:
parent
d2b8b92865
commit
89d134b3fd
@ -63,7 +63,7 @@ let
|
|||||||
script = with builtins; concatStringsSep "\n" (mapAttrsToList (cert: data: ''
|
script = with builtins; concatStringsSep "\n" (mapAttrsToList (cert: data: ''
|
||||||
for fixpath in /var/lib/acme/${escapeShellArg cert} /var/lib/acme/.lego/${escapeShellArg cert}; do
|
for fixpath in /var/lib/acme/${escapeShellArg cert} /var/lib/acme/.lego/${escapeShellArg cert}; do
|
||||||
if [ -d "$fixpath" ]; then
|
if [ -d "$fixpath" ]; then
|
||||||
chmod -R 750 "$fixpath"
|
chmod -R u=rwX,g=rX,o= "$fixpath"
|
||||||
chown -R acme:${data.group} "$fixpath"
|
chown -R acme:${data.group} "$fixpath"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -271,7 +271,7 @@ let
|
|||||||
|
|
||||||
mv domainhash.txt certificates/
|
mv domainhash.txt certificates/
|
||||||
chmod 640 certificates/*
|
chmod 640 certificates/*
|
||||||
chmod -R 700 accounts/*
|
chmod -R u=rwX,g=,o= accounts/*
|
||||||
|
|
||||||
# Group might change between runs, re-apply it
|
# Group might change between runs, re-apply it
|
||||||
chown 'acme:${data.group}' certificates/*
|
chown 'acme:${data.group}' certificates/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user