Skip to content

Commit 814f1e2

Browse files
committed
Harden service file for clamav-clamonacc.service\
Harden ClamAV OnAccess service systemd unit file. - Removed default move options to be consistent with the behaviour of the rest of the service files - Added hardening parameters for service - Added Reload and Stop signals for graceful reload and stop
1 parent 9bdf02f commit 814f1e2

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

clamonacc/clamav-clamonacc.service.in

+20-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,26 @@ After=clamav-daemon.service syslog.target network.target
1111
Type=simple
1212
User=root
1313
ExecStartPre=/bin/bash -c "while [ ! -S /run/clamav/clamd.ctl ]; do sleep 1; done"
14-
ExecStart=@prefix@/sbin/clamonacc -F --log=/var/log/clamav/clamonacc.log --move=/root/quarantine
14+
ExecStart=@prefix@/sbin/clamonacc --foreground --log=/var/log/clamav/clamonacc.log
15+
ExecReload=/bin/kill -SIGHUP $MAINPID
16+
ExecStop=/bin/kill -SIGTERM $MAINPID
17+
18+
##
19+
## Security Hardening Options
20+
##
21+
ProtectClock=yes
22+
ProtectKernelTunables=yes
23+
ProtectKernelModules=yes
24+
ProtectKernelLogs=yes
25+
ProtectControlGroups=yes
26+
NoExecPaths=/
27+
ExecPaths=@prefix@/sbin/clamonacc /bin/kill
28+
29+
# Remove `ProtectSystem`, `ProtectHome`, and `ReadWritePaths` if you
30+
# want ClamAV to be able to quarantine or remove infected files.
31+
ProtectSystem=strict
32+
ProtectHome=read-only
33+
ReadWritePaths=/var/log
1534

1635
[Install]
1736
WantedBy=multi-user.target

0 commit comments

Comments
 (0)