mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/ntpd: Add hardening
This commit is contained in:
parent
53bc9450bc
commit
4e632e9c3f
1 changed files with 26 additions and 0 deletions
|
@ -156,6 +156,32 @@ in
|
|||
ExecStart = "@${ntp}/bin/ntpd ntpd -g ${builtins.toString ntpFlags}";
|
||||
Type = "forking";
|
||||
StateDirectory = "ntp";
|
||||
|
||||
# Hardening options
|
||||
PrivateDevices = true;
|
||||
PrivateIPC = true;
|
||||
PrivateTmp = true;
|
||||
ProtectClock = false;
|
||||
ProtectHome = true;
|
||||
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectSystem = true;
|
||||
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
AmbientCapabilities = [
|
||||
"CAP_SYS_TIME"
|
||||
];
|
||||
|
||||
ProtectControlGroups = true;
|
||||
ProtectProc = "invisible";
|
||||
ProcSubset = "pid";
|
||||
RestrictSUIDSGID = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue