Harden the systemd service
This commit is contained in:
parent
4d687b0d40
commit
43f9ae1311
1 changed files with 11 additions and 0 deletions
11
module.nix
11
module.nix
|
|
@ -90,6 +90,17 @@ in
|
||||||
ExecStartPre = "${strojnadzor}/bin/strojnadzor-admin migrate";
|
ExecStartPre = "${strojnadzor}/bin/strojnadzor-admin migrate";
|
||||||
ExecStart = "${strojnadzor}/bin/strojnadzor-admin runserver-gunicorn";
|
ExecStart = "${strojnadzor}/bin/strojnadzor-admin runserver-gunicorn";
|
||||||
StateDirectory = "strojnadzor";
|
StateDirectory = "strojnadzor";
|
||||||
|
LockPersonality = true;
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
RestrictSUIDSGID = true;
|
||||||
};
|
};
|
||||||
environment.STROJNADZOR_DATA_DIR = "${cfg.stateDir}";
|
environment.STROJNADZOR_DATA_DIR = "${cfg.stateDir}";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue