From ebe67d69d021e8970c717ac05195c07bae33b270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 16 Dec 2016 22:28:58 +0100 Subject: [PATCH] collectd service: change /var/lib/collectd perms: 700 -> 755 The collectd service runs as an unprivileged user by default, so it does not leak more information to its data directory than any user can obtain elsewhere by other means. If people are running it as root and are worried about information leak, we can add collectd group and set perms to 750. CC @offlinehacker. Fixes #21198. --- nixos/modules/services/monitoring/collectd.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/collectd.nix b/nixos/modules/services/monitoring/collectd.nix index 01c6fb81766..641da60e9ad 100644 --- a/nixos/modules/services/monitoring/collectd.nix +++ b/nixos/modules/services/monitoring/collectd.nix @@ -108,7 +108,8 @@ in { }; preStart = '' - mkdir -m 0700 -p ${cfg.dataDir} + mkdir -p ${cfg.dataDir} + chmod 755 ${cfg.dataDir} install -D /dev/null ${cfg.pidFile} if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user} ${cfg.dataDir};