lldap: add hardening configuration
This commit is contained in:
parent
e69c253bdd
commit
53cd2a7e0e
1 changed files with 35 additions and 0 deletions
|
|
@ -418,6 +418,41 @@ in
|
||||||
) cfg.ensureUsers;
|
) cfg.ensureUsers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Harden lldap following https://github.com/NixOS/nixpkgs/pull/487933
|
||||||
|
systemd.services.lldap.serviceConfig = {
|
||||||
|
RemoveIPC = true;
|
||||||
|
RestrictNamespaces = true;
|
||||||
|
RestrictRealtime = true;
|
||||||
|
RestrictSUIDSGID = true;
|
||||||
|
RestrictAddressFamilies = [
|
||||||
|
"AF_UNIX"
|
||||||
|
"AF_INET"
|
||||||
|
"AF_INET6"
|
||||||
|
];
|
||||||
|
SystemCallFilter = [
|
||||||
|
"@system-service"
|
||||||
|
"~@privileged"
|
||||||
|
"~@resources"
|
||||||
|
];
|
||||||
|
SystemCallArchitectures = "native";
|
||||||
|
CapabilityBoundingSet = "";
|
||||||
|
LockPersonality = true;
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
PrivateTmp = true;
|
||||||
|
PrivateDevices = true;
|
||||||
|
ProtectClock = true;
|
||||||
|
ProtectControlGroups = true;
|
||||||
|
ProtectHome = true;
|
||||||
|
ProtectHostname = true;
|
||||||
|
ProtectKernelLogs = true;
|
||||||
|
ProtectKernelModules = true;
|
||||||
|
ProtectKernelTunables = true;
|
||||||
|
ProtectSystem = "strict";
|
||||||
|
ProtectProc = "invisible";
|
||||||
|
ProcSubset = "pid";
|
||||||
|
MemoryDenyWriteExecute = true;
|
||||||
|
};
|
||||||
|
|
||||||
shb.mitmdump.instances."lldap-web" = lib.mkIf cfg.debug {
|
shb.mitmdump.instances."lldap-web" = lib.mkIf cfg.debug {
|
||||||
listenPort = config.shb.lldap.webUIListenPort;
|
listenPort = config.shb.lldap.webUIListenPort;
|
||||||
upstreamPort = config.shb.lldap.webUIListenPort + 1;
|
upstreamPort = config.shb.lldap.webUIListenPort + 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue