apparmor profile usr.sbin.clamd does not allow ScanOnAccess via fanotify
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apparmor (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I tried to enable the ScanOnAccess option in /etc/clamav.conf to get on-access scanning.
Doing so, /var/log/
ERROR: ScanOnAccess: fanotify_init failed: Operation not permitted
ScanOnAccess: clamd must be started by root
Setting User to root in /etc/clamav/
makes the clamav-daemon to fail with
service clamav-daemon start
* Starting ClamAV daemon clamd
ERROR: initgroups() failed.
I had to disable the apparmor.profile with a
cd /etc/apparmor.
ln -s ./../usr.sbin.clamd
Then, the "ERROR: initgroups() failed." disappears.
The apparmor itself came via apt-get packages. I did not edit it.
Description: Ubuntu 14.04.1 LTS
Release: 14.04
apt-cache policy apparmor-profiles
apparmor-profiles:
Installiert: (keine)
Installations
Versionstabelle:
2.
500 http://
500 http://
2.
500 http://
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: apparmor-profiles (not installed)
ProcVersionSign
Uname: Linux 3.13.0-43-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
Date: Mon Dec 22 01:23:04 2014
InstallationDate: Installed on 2014-11-29 (22 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
ProcEnviron:
LANGUAGE=de_DE
TERM=xterm
PATH=(custom, no user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
ProcKernelCmdline: BOOT_IMAGE=
SourcePackage: apparmor
Syslog:
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in apparmor (Ubuntu): | |
importance: | Undecided → Low |
Please add
capability setgid,
to the clamd profile and re-enable it ("aa-enforce clamd").
If it still doesn't work, set it to complain mode ("aa-complain clamd") so that it permits everything and logs what would be denied. Then use clamd for a while and provide the clamd-related entries from /var/log/ audit/audit. log.
You can also update the profile yourself using aa-logprof, and set the profile back to enforce mode with "aa-enforce clamd".