1
0
mirror of https://github.com/tommytran732/Linux-Setup-Scripts synced 2024-11-23 17:51:33 -05:00
Linux-Setup-Scripts/etc/systemd/system/unbound.service.d/override.conf
Tommy c2ef5743a2
Improve unbound systemd hardening
Signed-off-by: Tommy <contact@tommytran.io>
2024-06-26 12:12:54 -07:00

26 lines
868 B
Plaintext

[Service]
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_SYS_RESOURCE CAP_NET_RAW CAP_DAC_OVERRIDE
MemoryDenyWriteExecute=true
#NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
ProtectHome=true
ProtectClock=true
ProtectControlGroups=true
ProtectKernelLogs=true
ProtectKernelModules=true
# This breaks using socket options like 'so-rcvbuf'.
ProtectKernelTunables=true
ProtectProc=invisible
# ProtectSystem with strict does not work - need further testing.
ProtectSystem=full
#RuntimeDirectory=unbound
#ConfigurationDirectory=unbound
#StateDirectory=unbound
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictRealtime=true
SystemCallArchitectures=native
SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module mount @obsolete @resources
RestrictNamespaces=yes
LockPersonality=yes
RestrictSUIDSGID=yes