Skip to content

Commit 21ce15b

Browse files
authored
Merge pull request #704 from JustArchi/patch-1
Suggest optional security hardening in systemd service
2 parents 19ee51c + dceed68 commit 21ce15b

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,39 @@ User = www-data
7979
Restart = always
8080
RestartSec = 60
8181

82+
# Optional security hardening
83+
CapabilityBoundingSet=
84+
DevicePolicy=closed
85+
LockPersonality=yes
86+
MemoryDenyWriteExecute=yes
87+
NoNewPrivileges=yes
88+
PrivateDevices=yes
89+
PrivateIPC=yes
90+
PrivateMounts=yes
91+
PrivateTmp=yes
92+
PrivateUsers=yes
93+
ProcSubset=pid
94+
ProtectClock=yes
95+
ProtectControlGroups=yes
96+
ProtectHome=read-only
97+
ProtectHostname=yes
98+
ProtectKernelLogs=yes
99+
ProtectKernelModules=yes
100+
ProtectKernelTunables=yes
101+
ProtectProc=invisible
102+
ProtectSystem=strict
103+
RemoveIPC=yes
104+
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
105+
RestrictNamespaces=yes
106+
RestrictRealtime=yes
107+
RestrictSUIDSGID=yes
108+
SecureBits=noroot-locked
109+
SystemCallArchitectures=native
110+
SystemCallFilter=@system-service
111+
SystemCallFilter=~@privileged
112+
SystemCallFilter=~@resources
113+
UMask=0077
114+
82115
[Install]
83116
WantedBy = multi-user.target
84117
```

0 commit comments

Comments
 (0)