about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorRenaud <c0bw3b@users.noreply.github.com>2019-05-09 20:09:40 +0200
committerGitHub <noreply@github.com>2019-05-09 20:09:40 +0200
commitc17ec06f663c9f26a033edc6c5fe54b071b39c9a (patch)
tree0e051b31b1b4090748a26bc601e1a9ae5299b718 /nixos/modules
parent0954c36972bbb634c0bc111e591ce264605c4f75 (diff)
parent329df959581629113d4643465d1a2fcddef7fef2 (diff)
downloadnixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar.gz
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar.bz2
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar.lz
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar.xz
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.tar.zst
nixlib-c17ec06f663c9f26a033edc6c5fe54b071b39c9a.zip
Merge pull request #60569 from dtzWill/update/vnstat-2.2
vnstat: 2.1 -> 2.2
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/monitoring/vnstat.nix19
1 files changed, 17 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/vnstat.nix b/nixos/modules/services/monitoring/vnstat.nix
index cb2f8c07edb9..e9bedb704a43 100644
--- a/nixos/modules/services/monitoring/vnstat.nix
+++ b/nixos/modules/services/monitoring/vnstat.nix
@@ -28,14 +28,29 @@ in {
       path = [ pkgs.coreutils ];
       after = [ "network.target" ];
       wantedBy = [ "multi-user.target" ];
-      unitConfig.documentation = "man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5)";
+      documentation = [
+        "man:vnstatd(1)"
+        "man:vnstat(1)"
+        "man:vnstat.conf(5)"
+      ];
       preStart = "chmod 755 /var/lib/vnstat";
       serviceConfig = {
         ExecStart = "${pkgs.vnstat}/bin/vnstatd -n";
         ExecReload = "${pkgs.procps}/bin/kill -HUP $MAINPID";
-        ProtectHome = true;
+
+        # Hardening (from upstream example service)
+        ProtectSystem = "strict";
+        StateDirectory = "vnstat";
         PrivateDevices = true;
+        ProtectKernelTunables = true;
+        ProtectControlGroups = true;
+        ProtectHome = true;
+        ProtectKernelModules = true;
         PrivateTmp = true;
+        MemoryDenyWriteExecute = true;
+        RestrictRealtime = true;
+        RestrictNamespaces = true;
+
         User = "vnstatd";
       };
     };