2019-04-28 01:27:25 +03:00
|
|
|
let
|
2019-04-27 22:21:45 +03:00
|
|
|
defaultHardening = {
|
|
|
|
PrivateTmp = "true";
|
|
|
|
ProtectSystem = "full";
|
2019-04-28 01:27:25 +03:00
|
|
|
ProtectHome = "true";
|
2019-04-27 22:21:45 +03:00
|
|
|
NoNewPrivileges = "true";
|
|
|
|
PrivateDevices = "true";
|
|
|
|
MemoryDenyWriteExecute = "true";
|
2019-04-28 01:27:25 +03:00
|
|
|
ProtectKernelTunables = "true";
|
|
|
|
ProtectKernelModules = "true";
|
|
|
|
ProtectControlGroups = "true";
|
|
|
|
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6";
|
|
|
|
LockPersonality = "true";
|
2019-04-27 22:21:45 +03:00
|
|
|
};
|
2019-04-28 01:27:25 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit defaultHardening;
|
|
|
|
# node applications apparently rely on memory write execute
|
|
|
|
nodeHardening = defaultHardening // { MemoryDenyWriteExecute = "false"; };
|
2019-04-27 22:21:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|