Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1173995 - SElinux prevent log rotate of audit.log
Summary: SElinux prevent log rotate of audit.log
Keywords:
Status: CLOSED DUPLICATE of bug 1163438
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-14 17:41 UTC by Bill Davidsen
Modified: 2014-12-15 06:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-15 06:58:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bill Davidsen 2014-12-14 17:41:44 UTC
Description of problem:
logrotate was prevented from rotating audit.log by a type or permissions problem.

Version-Release number of selected component (if applicable):
fc21-Live-MATE fully updates 0300EST 2014-12-13

How reproducible:
Until next Sunday, can't tell

Steps to Reproduce:
1. This is the first run of logrotate on a totally stock install
2.
3.

Actual results:
Log did not rotate

Expected results:
Log rotation

Additional info:
This is a reference install with zero custom or 3rd party software.
I use it to determine if local changes have in any way caused a problem.
I will preserve a copy of the raw audit log for one week

Problem report started:
  SELinux is preventing logrotate from read access on the directory /var/cache/dnf.

  *****  Plugin restorecon (94.8 confidence) suggests   ************************

  If you want to fix the label. 
  /var/cache/dnf default label should be rpm_var_cache_t.
  Then you can run restorecon.
  Do
  # /sbin/restorecon -v /var/cache/dnf

However, later it gave this advice:
If you believe that logrotate should be allowed read access on the dnf directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep logrotate /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:logrotate_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:var_t:s0
Target Objects                /var/cache/dnf [ dir ]
Source                        logrotate
Source Path                   logrotate
Port                          <Unknown>
Host                          FC21-MATE-x86_64.tmr.com
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-99.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     FC21-MATE-x86_64.tmr.com
Platform                      Linux FC21-MATE-x86_64.tmr.com
                              3.17.6-300.fc21.x86_64 #1 SMP Mon Dec 8 22:29:32
                              UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-12-14 03:38:02 EST
Last Seen                     2014-12-14 03:38:02 EST
Local ID                      16d34d85-b757-4a7b-85c2-2b8923c6ea3e

Raw Audit Messages
type=AVC msg=audit(1418546282.263:562): avc:  denied  { read } for  pid=5038 comm="logrotate" name="dnf" dev="dm-0" ino=287063 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_t:s0 tclass=dir permissive=0


Hash: logrotate,logrotate_t,var_t,dir,read

Comment 1 Jan Kaluža 2014-12-15 06:58:14 UTC

*** This bug has been marked as a duplicate of bug 1163438 ***


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