Bug 984613 - aide generates AVC denials writing to /var/log/aide/aide.log when executed from a cron job
aide generates AVC denials writing to /var/log/aide/aide.log when executed fr...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
19
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-15 10:38 EDT by John F Sullivan
Modified: 2013-07-26 19:05 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-66.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-26 19:05:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John F Sullivan 2013-07-15 10:38:31 EDT
Description of problem:
When run as part of a cron job, AIDE generates AVC denials when attempting to write to /var/log/aide/aide.log.


Version-Release number of selected component (if applicable):
aide-0.15.1-5.fc19.x86_64
selinux-policy-3.12.1-63.fc19.noarch
selinux-policy-targeted-3.12.1-63.fc19.noarch


How reproducible:
Every time "aide" is updated as a cron job in /etc/cron.(hourly|daily|weekly|monthly).


Steps to Reproduce:
1. Create a file in /etc/cron.daily that executes "/usr/sbin/aide --update 2>&1"
2. Check /var/log/audit/audit.log for instances of AVC denials from aide
3. Check email from cron with AIDE report indicating that /var/log/aide/aide.txt cannot be written.


Actual results:
audit2why provides the following explanations:

type=AVC msg=audit(1373873583.328:998): avc:  denied  { write } for  pid=27218 comm="aide" name="aide.log" dev="dm-1" ino=55076 scontext=system_u:system_r:aide_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:aide_log_t:s0 tclass=file

        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.

type=AVC msg=audit(1373874830.911:999): avc:  denied  { sys_admin } for  pid=27218 comm="aide" capability=21  scontext=system_u:system_r:aide_t:s0-s0:c0.c1023 tcontext=system_u:system_r:aide_t:s0-s0:c0.c1023 tclass=capability

        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.


Expected results:
o No AVC denials
o AIDE is able to write to /var/log/aide/aide.log


Additional info:
Issue is resolved by implementing the following policy change:

module local 1.0;

require {
        type aide_t;
        type aide_log_t;
        class capability sys_admin;
        class file write;
}

#============= aide_t ==============
allow aide_t aide_log_t:file write;
allow aide_t self:capability sys_admin;
Comment 1 Daniel Kopeček 2013-07-18 07:00:44 EDT
Switching to selinux-policy for now. Changes might be needed in both aide and selinux-policy.
Comment 2 Daniel Walsh 2013-07-18 11:19:13 EDT
I have no problem allowing the write although I would like to know why it needs sys_admin, 

6e47d17e32e671c1ef051dcb5fdfabb53a3526ca allows this in git.
Comment 3 Fedora Update System 2013-07-24 10:10:00 EDT
selinux-policy-3.12.1-66.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-66.fc19
Comment 4 Fedora Update System 2013-07-24 20:34:19 EDT
Package selinux-policy-3.12.1-66.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-66.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-13543/selinux-policy-3.12.1-66.fc19
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2013-07-26 19:05:10 EDT
selinux-policy-3.12.1-66.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.