nixos/paperless: Restrict CAP_NET_BIND_SERVICE
Handing CAP_NET_BIND_SERVICE to the `paperless-web.service` only makes sense when it actually wants to bind to a port < 1024. Don't hand it out if that is not the case.
This commit is contained in:
parent
73e10d9d5a
commit
f98011803e
1 changed files with 3 additions and 2 deletions
|
@ -286,12 +286,13 @@ in
|
|||
'';
|
||||
Restart = "on-failure";
|
||||
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CapabilityBoundingSet = "CAP_NET_BIND_SERVICE";
|
||||
# gunicorn needs setuid, liblapack needs mbind
|
||||
SystemCallFilter = defaultServiceConfig.SystemCallFilter ++ [ "@setuid mbind" ];
|
||||
# Needs to serve web page
|
||||
PrivateNetwork = false;
|
||||
} // lib.optionalAttrs (cfg.port < 1024) {
|
||||
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
|
||||
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
|
||||
};
|
||||
environment = env // {
|
||||
PATH = mkForce cfg.package.path;
|
||||
|
|
Loading…
Reference in a new issue