3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #141187 from erdnaxe/grafana_fix

nixos/grafana: fix systemd unit
This commit is contained in:
Maximilian Bosch 2021-10-23 14:56:00 +02:00 committed by GitHub
commit 4a2cb3738d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -677,15 +677,13 @@ in {
RuntimeDirectory = "grafana";
RuntimeDirectoryMode = "0755";
# Hardening
CapabilityBoundingSet = [ "" ];
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
CapabilityBoundingSet = if (cfg.port < 1024) then [ "CAP_NET_BIND_SERVICE" ] else [ "" ];
DeviceAllow = [ "" ];
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateTmp = true;
PrivateUsers = true;
ProcSubset = "pid";
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
@ -701,6 +699,8 @@ in {
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
# Upstream grafana is not setting SystemCallFilter for compatibility
# reasons, see https://github.com/grafana/grafana/pull/40176
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
UMask = "0027";
};