Bug 691677

Summary: SELinux is preventing /usr/bin/certwatch from 'getattr' accesses on the file /etc/localtime.
Product: [Fedora] Fedora Reporter: Jaroslav Reznik <jreznik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:9f180fddf4aa3c79494897d48f6f535c1dd75ec6155ef0af6c6e0b62d5a72f95
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-29 11:36:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jaroslav Reznik 2011-03-29 08:53:55 UTC
SELinux is preventing /usr/bin/certwatch from 'getattr' accesses on the file /etc/localtime.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/etc/localtime default label should be locale_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/localtime

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that certwatch should be allowed getattr access on the localtime file 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 certwatch /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:certwatch_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_runtime_t:s0
Target Objects                /etc/localtime [ file ]
Source                        certwatch
Source Path                   /usr/bin/certwatch
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           crypto-utils-2.4.1-27
Target RPM Packages           glibc-2.13-1
Policy RPM                    selinux-policy-3.9.7-31.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.35.11-83.fc14.x86_64 #1 SMP Mon Feb 7 07:06:44
                              UTC 2011 x86_64 x86_64
Alert Count                   10
First Seen                    Wed 16 Mar 2011 10:34:02 AM CET
Last Seen                     Tue 29 Mar 2011 10:48:07 AM CEST
Local ID                      f2a673f7-2000-43aa-a93f-2f10d8ba8ed7

Raw Audit Messages
type=AVC msg=audit(1301388487.328:35863): avc:  denied  { getattr } for  pid=4932 comm="certwatch" path="/etc/localtime" dev=dm-0 ino=393674 scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file


type=SYSCALL msg=audit(1301388487.328:35863): arch=x86_64 syscall=fstat success=yes exit=0 a0=3 a1=7fff3fd07920 a2=7fff3fd07920 a3=2 items=0 ppid=4927 pid=4932 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2 comm=certwatch exe=/usr/bin/certwatch subj=system_u:system_r:certwatch_t:s0-s0:c0.c1023 key=(null)

Hash: certwatch,certwatch_t,etc_runtime_t,file,getattr

audit2allow

#============= certwatch_t ==============
allow certwatch_t etc_runtime_t:file getattr;

audit2allow -R

#============= certwatch_t ==============
allow certwatch_t etc_runtime_t:file getattr;

Comment 1 Miroslav Grepl 2011-03-29 11:36:04 UTC
Jardo,
the question "Do you use KDE?" is probably silly in your case. 

Run restorecon 

# restorecon -v /etc/localtime

and please update to the latest policy. This policy has support for kcmdatetimehelper which causes this.