Skip to content

Commit 330ebb4

Browse files
committed
[OPS-1161] Harden systemd service
Problem: We want to harden the security of our systemd services. Solution: Use the hardening profile defined in serokell.nix.
1 parent 3119cde commit 330ebb4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

module.nix

+18-1
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,27 @@ in
5050
export SLACK_TZ_BOT_TOKEN="${cfg.slackBotToken}"
5151
${cfg.package}/bin/tzbot-exe --config ${pkgs.writeText "config.yml" (builtins.toJSON cfg.botConfig)}
5252
'';
53-
serviceConfig = {
53+
serviceConfig = withHardeningProfile hardeningProfiles.backend {
5454
User = "tzbot";
5555
Group = "tzbot";
5656
StateDirectory = "tzbot";
57+
58+
SystemCallFilter = [
59+
"~@clock"
60+
"~@debug"
61+
"~@module"
62+
"~@mount"
63+
"~@raw-io"
64+
"~@reboot"
65+
"~@swap"
66+
"~@privileged"
67+
"~@resources"
68+
"~@cpu-emulation"
69+
"~@obsolete"
70+
71+
# override hardening profile
72+
"set_mempolicy"
73+
];
5774
};
5875
};
5976
users.users.tzbot = {

0 commit comments

Comments
 (0)