module confinement

This commit is contained in:
Robin Appelman 2024-10-30 20:34:13 +01:00
commit 369dd4d9f3

View file

@ -83,7 +83,7 @@ in
"mqtt_password:${cfg.mqtt.passwordFile}" "mqtt_password:${cfg.mqtt.passwordFile}"
"device_password:${cfg.devicePasswordFile}" "device_password:${cfg.devicePasswordFile}"
]; ];
ReadWritePaths = [ cfg.outputPath ]; BindPaths = [ cfg.outputPath ];
User = "tasmota-backup"; User = "tasmota-backup";
Restart = "on-failure"; Restart = "on-failure";
PrivateTmp = true; PrivateTmp = true;
@ -106,10 +106,23 @@ in
RestrictRealtime = true; RestrictRealtime = true;
ProtectProc = "noaccess"; ProtectProc = "noaccess";
SystemCallFilter = [ "@system-service" "~@resources" "~@privileged" ]; SystemCallFilter = [ "@system-service" "~@resources" "~@privileged" ];
IPAddressDeny = "multicast"; IPAddressDeny = mkDefault "multicast";
PrivateUsers = true; PrivateUsers = true;
ProcSubset = "pid"; ProcSubset = "pid";
RestrictSUIDSGID = true; RestrictSUIDSGID = true;
# needed for dns with confinement
BindReadOnlyPaths = [
"-/etc/resolv.conf"
"-/run/systemd"
"/etc/hosts"
"/etc/ssl/certs/ca-certificates.crt"
];
};
confinement = {
enable = true;
binSh = null;
}; };
}; };