Merge pull request #85133 from snicket2100/mosquitto-service-sandboxing

mosquitto: systemd service sandboxing
This commit is contained in:
Sandro 2020-11-27 18:53:36 +01:00 committed by GitHub
commit a390213f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,6 +232,16 @@ in
Restart = "on-failure";
ExecStart = "${pkgs.mosquitto}/bin/mosquitto -c ${mosquittoConf}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ProtectSystem = "strict";
ProtectHome = true;
PrivateDevices = true;
PrivateTmp = true;
ReadWritePaths = "${cfg.dataDir}";
ProtectControlGroups = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
NoNewPrivileges = true;
};
preStart = ''
rm -f ${cfg.dataDir}/passwd