Add more hardening options

This commit is contained in:
phil 2023-02-25 20:32:51 +01:00
parent 367b5eede0
commit 4f0d2f55e1

View file

@ -26,18 +26,29 @@ RestartSec=30s
# Hardening
# https://github.com/php/php-src/blob/master/sapi/fpm/php-fpm.service.in
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
ProtectClock=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full
ProtectSystem=strict
RestrictRealtime=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictNamespaces=true
SystemCallFilter=@system-service
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
ReadWritePaths=-/var/log/
ReadWritePaths=-{{ php_fpm_log_dir }}
ReadWritePaths=-/var/run/
ReadWritePaths=-/run/
InaccessiblePaths=-/root/
RuntimeDirectory=php
RuntimeDirectoryPreserve=yes
[Install]
WantedBy=multi-user.target