Bug 639233

Summary: SELinux is preventing /usr/bin/ck-history "read" access on history
Product: Red Hat Enterprise Linux 6 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-56.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:56:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2010-10-01 07:53:46 UTC
Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

SELinux denied access requested by ck-history. It is not expected that this
access is required by ck-history and this access may signal an intrusion
attempt. It is also possible that the specific version or configuration of the
application is causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                xguest_u:xguest_r:xguest_t:s0
Target Context                system_u:object_r:consolekit_log_t:s0
Target Objects                history [ file ]
Source                        ck-history
Source Path                   /usr/bin/ck-history
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           ConsoleKit-0.4.1-3.el6
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-55.el6
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Plugin Name                   catchall
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.32-71.el6.i686 #1
                              SMP Wed Sep 1 01:26:34 EDT 2010 i686 i686
Alert Count                   4
First Seen                    Fri Oct  1 09:21:27 2010
Last Seen                     Fri Oct  1 09:23:19 2010
Local ID                      18c5b9eb-7a22-4108-9a7c-5d2213814a70
Line Numbers                  

Raw Audit Messages            

node=localhost.localdomain type=AVC msg=audit(1285917799.435:155): avc:  denied  { read } for  pid=3763 comm="ck-history" name="history" dev=dm-0 ino=39219 scontext=xguest_u:xguest_r:xguest_t:s0 tcontext=system_u:object_r:consolekit_log_t:s0 tclass=file

node=localhost.localdomain type=AVC msg=audit(1285917799.435:155): avc:  denied  { open } for  pid=3763 comm="ck-history" name="history" dev=dm-0 ino=39219 scontext=xguest_u:xguest_r:xguest_t:s0 tcontext=system_u:object_r:consolekit_log_t:s0 tclass=file

node=localhost.localdomain type=SYSCALL msg=audit(1285917799.435:155): arch=40000003 syscall=5 success=yes exit=3 a0=8f57178 a1=0 a2=1b6 a3=804ba81 items=0 ppid=1 pid=3763 auid=505 uid=505 gid=505 euid=505 suid=505 fsuid=505 egid=505 sgid=505 fsgid=505 tty=(none) ses=10 comm="ck-history" exe="/usr/bin/ck-history" subj=xguest_u:xguest_r:xguest_t:s0 key=(null)

Comment 2 Daniel Walsh 2010-10-01 14:19:37 UTC
Did this happen at login?

Comment 3 Milos Malik 2010-10-01 14:59:38 UTC
Yes, it appears when the user tries to log in via text console. The user succeeds and gets the shell. But it's not kiosk user which comes with xguest package. This user was created this way:
# useradd -Z xguest_u theone.
# echo "s0me.p4sSwOrD" | passwd --stdin theone

Comment 4 Daniel Walsh 2010-10-01 15:09:53 UTC
Miroslav add

			consolekit_dontaudit_read_log($1_usertype)

userdom_restricted_xwindows_user_template

########################################
## <summary>
##	Dontaudit attempts to read consolekit log files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain to not audit.
##	</summary>
## </param>
#
interface(`consolekit_dontaudit_read_log',`
	gen_require(`
		type consolekit_log_t;
	')

	dontaudit $1 consolekit_log_t:file read_file_perms;
')

Comment 5 Miroslav Grepl 2010-10-06 08:39:42 UTC
Fixed in selinux-policy-3.7.19-56.el6

Comment 9 errata-xmlrpc 2011-05-19 11:56:45 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0526.html