Skip to content

Commit 5584f8a

Browse files
authored
Suggest optional security hardening in systemd service
Signed-off-by: Łukasz Domeradzki <JustArchi@JustArchi.net>
1 parent c956129 commit 5584f8a

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

‎admin_manual/configuration_server/background_jobs_configuration.rst‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,38 @@ This approach requires two files: **nextcloudcron.service** and **nextcloudcron.
139139
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php
140140
KillMode=process
141141

142+
# Optional security hardening
143+
CapabilityBoundingSet=
144+
DevicePolicy=closed
145+
LockPersonality=yes
146+
NoNewPrivileges=yes
147+
PrivateDevices=yes
148+
PrivateIPC=yes
149+
PrivateMounts=yes
150+
PrivateTmp=yes
151+
PrivateUsers=yes
152+
ProcSubset=pid
153+
ProtectClock=yes
154+
ProtectControlGroups=yes
155+
ProtectHome=read-only
156+
ProtectHostname=yes
157+
ProtectKernelLogs=yes
158+
ProtectKernelModules=yes
159+
ProtectKernelTunables=yes
160+
ProtectProc=invisible
161+
ProtectSystem=strict
162+
RemoveIPC=yes
163+
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
164+
RestrictNamespaces=yes
165+
RestrictRealtime=yes
166+
RestrictSUIDSGID=yes
167+
SecureBits=noroot-locked
168+
SystemCallArchitectures=native
169+
SystemCallFilter=@system-service
170+
SystemCallFilter=~@privileged
171+
SystemCallFilter=~@resources
172+
UMask=0077
173+
142174
Replace the user ``www-data`` with the user of your http server and ``/var/www/nextcloud/cron.php`` with the location of **cron.php** in your nextcloud directory.
143175

144176
The `ExecCondition` checks that the nextcloud instance is operating normally before running the background job, and skips it if otherwise.

0 commit comments

Comments
 (0)