Bug 984613 - aide generates AVC denials writing to /var/log/aide/aide.log when executed from a cron job
Summary: aide generates AVC denials writing to /var/log/aide/aide.log when executed fr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-15 14:38 UTC by John F Sullivan
Modified: 2020-03-27 16:47 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.12.1-66.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-26 23:05:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John F Sullivan 2013-07-15 14:38:31 UTC
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 11:00:44 UTC
Switching to selinux-policy for now. Changes might be needed in both aide and selinux-policy.

Comment 2 Daniel Walsh 2013-07-18 15:19:13 UTC
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 14:10:00 UTC
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-25 00:34:19 UTC
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 23:05:10 UTC
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.