Bug 788574 - qpidd AVC denial messages in audit.log
Summary: qpidd AVC denial messages in audit.log
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: RHUA
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: wes hayutin
QA Contact: mkovacik
URL:
Whiteboard:
: 806827 (view as bug list)
Depends On: 790759 798580
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-08 14:02 UTC by Sachin Ghai
Modified: 2012-08-24 13:25 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A qpidd AVC denial was present in the SELinux audit log. This update uses a new version of qpidd with updated SELinux policy that fixes the denial.
Clone Of:
Environment:
Last Closed: 2012-08-24 11:53:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
all requested logs are attached, I couln't help much in this case.. as I'm not sure the exact situation when this message appears in audit.log (479.27 KB, application/x-bzip)
2012-02-09 10:28 UTC, Sachin Ghai
no flags Details
logs from grinder.log pulp.log var_log_messages audit.log (460.23 KB, application/zip)
2012-02-22 10:39 UTC, Kedar Bidarkar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:1205 0 normal SHIPPED_LIVE RHUI 2.1 Enhancement Update 2012-08-24 15:52:31 UTC

Description Sachin Ghai 2012-02-08 14:02:13 UTC
Description of problem:
After syncing a rhel6 repo on RHUA, I found following avc denial message in audit.log.

--
[root@ip-10-87-2-126 ~]# cat /var/log/audit/audit.log  | grep avc
type=AVC msg=audit(1328690610.193:14558): avc:  denied  { read } for  pid=3105 comm="qpidd" name="tmp" dev=xvde1 ino=740 scontext=unconfined_u:system_r:qpidd_t:s0 tcontext=system_u:object_r:usr_t:s0 tclass=lnk_file
[root@ip-10-87-2-126 ~]# 
--

Version-Release number of selected component (if applicable):
rh-rhui-tools-2.0.52-1.el6.noarch

[root@ip-10-87-2-126 ~]# rpm -qa | grep pulp
m2crypto-0.21.1.pulp-7.el6.x86_64
python-oauth2-1.5.170-2.pulp.el6.noarch
pulp-client-lib-0.0.263-5.el6.noarch
pulp-0.0.263-5.el6.noarch
python-isodate-0.4.4-4.pulp.el6.noarch
pulp-selinux-server-0.0.263-5.el6.noarch
mod_wsgi-3.3-2.pulp.el6.x86_64
pulp-admin-0.0.263-5.el6.noarch
pulp-common-0.0.263-5.el6.noarch
pulp-consumer-0.0.263-5.el6.noarch
[root@ip-10-87-2-126 ~]# rpm -qa | grep gofer
python-gofer-0.64-1.el6.noarch
gofer-package-0.64-1.el6.noarch
gofer-0.64-1.el6.noarch
[root@ip-10-87-2-126 ~]# rpm -qa | grep grinder
grinder-0.0.136-1.el6.noarch
[root@ip-10-87-2-126 ~]# 


How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:
avc denial message in audit.log

Expected results:
There should be no avc denial messages in audit.log when selinux is enabled.

Additional info:

Comment 1 James Slagle 2012-02-08 14:18:46 UTC
Can you attach the full audit.log, pulp.log, grinder.log, and /var/log/messages please?  Hopefully one of those will have some more information that will help us debug this issue.

Comment 2 Sachin Ghai 2012-02-09 10:28:52 UTC
Created attachment 560498 [details]
all requested logs are attached, I couln't help much in this case.. as I'm not sure the exact situation when this message appears in audit.log

Comment 3 John Matthews 2012-02-20 15:16:19 UTC
I think this message happens when qpidd tries to read /usr/tmp which is a symbolic link.

$ ls -larthZ /usr/tmp
lrwxrwxrwx. root root system_u:object_r:usr_t:s0       /usr/tmp -> ../var/tmp

Comment 4 John Matthews 2012-02-20 16:29:09 UTC
Looking at the qpidd policy that ships with el6 I think this should be allowed.

I see a files_read_usr_files(qpidd_t) which in turn grants access to read_lnk_files_pattern.



From: selinux-policy-3.7.19-126.el6.src.rpm

$ cat policy/modules/services/qpidd.te 
policy_module(qpidd,1.0.0)

########################################
#
# Declarations
#

type qpidd_t;
type qpidd_exec_t;
init_daemon_domain(qpidd_t, qpidd_exec_t)

type qpidd_initrc_exec_t;
init_script_file(qpidd_initrc_exec_t)

type qpidd_var_run_t;
files_pid_file(qpidd_var_run_t)

type qpidd_var_lib_t;
files_type(qpidd_var_lib_t)

########################################
#
# qpidd local policy
#

allow qpidd_t self:process { getsched setsched signull };
allow qpidd_t self:fifo_file rw_fifo_file_perms;
allow qpidd_t self:sem create_sem_perms;
allow qpidd_t self:shm create_shm_perms;
allow qpidd_t self:tcp_socket create_stream_socket_perms;
allow qpidd_t self:unix_stream_socket create_stream_socket_perms;

manage_dirs_pattern(qpidd_t, qpidd_var_lib_t,  qpidd_var_lib_t)
manage_files_pattern(qpidd_t, qpidd_var_lib_t,  qpidd_var_lib_t)
files_var_lib_filetrans(qpidd_t, qpidd_var_lib_t, { file dir } )

manage_dirs_pattern(qpidd_t, qpidd_var_run_t,  qpidd_var_run_t)
manage_files_pattern(qpidd_t, qpidd_var_run_t,  qpidd_var_run_t)
files_pid_filetrans(qpidd_t, qpidd_var_run_t, { file dir })

kernel_read_system_state(qpidd_t)

corenet_all_recvfrom_unlabeled(qpidd_t)
corenet_all_recvfrom_netlabel(qpidd_t)
corenet_tcp_bind_generic_node(qpidd_t)
corenet_tcp_sendrecv_generic_if(qpidd_t)
corenet_tcp_sendrecv_generic_node(qpidd_t)
corenet_tcp_sendrecv_all_ports(qpidd_t)
corenet_tcp_bind_amqp_port(qpidd_t)

dev_read_urand(qpidd_t)

files_read_etc_files(qpidd_t)
files_read_usr_files(qpidd_t)

logging_send_syslog_msg(qpidd_t)

miscfiles_read_localization(qpidd_t)

sysnet_dns_name_resolve(qpidd_t)

optional_policy(`
	corosync_stream_connect(qpidd_t)
')

optional_policy(`
	matahari_manage_lib_files(qpidd_t)
	matahari_manage_pid_files(qpidd_t)
')
 


From: policy/modules/kernel/files.if 


4578 interface(`files_read_usr_files',`
4579 |___gen_require(`
4580 |___|___type usr_t;
4581 |___')
4582
4583 |___allow $1 usr_t:dir list_dir_perms;
4584 |___read_files_pattern($1, usr_t, usr_t)
4585 |___read_lnk_files_pattern($1, usr_t, usr_t)
4586 ')

Comment 5 Kedar Bidarkar 2012-02-22 10:27:25 UTC
Didn't observe these earlier with the 20120215 build, 

But found with RHEL-6.2-RHUI-2.0.2-20120221.0-Server-x86_64-DVD1.iso


[root@ip-10-36-119-102 audit]# grep AVC *
type=AVC msg=audit(1329899723.444:13185): avc:  denied  { search } for  pid=2840 comm="genpkgmetadata." name="rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1329899723.445:13186): avc:  denied  { getattr } for  pid=2840 comm="genpkgmetadata." path="/var/lib/rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1329903332.243:13229): avc:  denied  { search } for  pid=3333 comm="genpkgmetadata." name="rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1329903332.244:13230): avc:  denied  { getattr } for  pid=3333 comm="genpkgmetadata." path="/var/lib/rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1329904708.486:13243): avc:  denied  { search } for  pid=30837 comm="genpkgmetadata." name="rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1329904708.486:13244): avc:  denied  { getattr } for  pid=30837 comm="genpkgmetadata." path="/var/lib/rpm" dev=xvde1 ino=18 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:rpm_var_lib_t:s0 tclass=dir

Comment 6 Kedar Bidarkar 2012-02-22 10:39:00 UTC
Created attachment 564910 [details]
logs from grinder.log pulp.log var_log_messages audit.log

Comment 7 Jeff Ortel 2012-02-22 18:39:35 UTC
The QPID team does not believe that qpidd itself is accessing /usr/tmp but suspects it's something in the NSS lib used for SSL.

Comment 8 Sachin Ghai 2012-02-24 15:06:57 UTC
Installed qpid version: 

-------
qpid-cpp-client-0.12-6.el6.x86_64
python-qpid-0.12-1.el6.noarch
qpid-cpp-server-0.12-6.el6.x86_64
qpid-cpp-server-ssl-0.12-6.el6.x86_64
qpid-cpp-client-ssl-0.12-6.el6.x86_64
-------

Comment 9 Jeff Ortel 2012-02-24 16:09:46 UTC
Looks like QPID already has a bug on this: https://bugzilla.redhat.com/show_bug.cgi?id=790759

Comment 11 James Slagle 2012-02-27 20:18:34 UTC
Added this issue to the 2.0.2 release notes.  Punting the issue to the 2.1 release.  Going to leave it open just so that we don't forget to bump to a new build of qpid (if available).

Comment 12 James Slagle 2012-03-26 13:02:15 UTC
*** Bug 806827 has been marked as a duplicate of this bug. ***

Comment 13 James Slagle 2012-05-08 19:47:57 UTC
need to verify the fixed qpidd bug also fixes this issue.  If this is fixed, we need to remove it from the release notes.

Comment 14 wes hayutin 2012-05-23 17:13:55 UTC
Looks like the version of qpid that fixes this will be available in RHEL 6.3

current qpid versions in rhui 2.0.3

[root@domU-12-31-39-0F-29-EE ~]# rpm -qa | grep qpid
qpid-cpp-*-0.14-14

qpid version where the various bugs says its fixed.

 qpid-cpp-*0.14-15

Checking this out w/ a RHUI install on
ami-48bc1b21	aki-ecfa0185 (private part x86_64)	X86_64	RHEL	RHEL-Starter	6.3-beta	EBS backed image	us-east-1	VISIBLE

Comment 15 wes hayutin 2012-05-23 17:51:28 UTC
[root@ip-10-4-114-127 ~]# rpm -qa | grep qpid-cpp
qpid-cpp-client-0.14-15.el6.x86_64
qpid-cpp-client-ssl-0.14-15.el6.x86_64
qpid-cpp-server-0.14-15.el6.x86_64
qpid-cpp-server-ssl-0.14-15.el6.x86_64
[root@ip-10-4-114-127 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.3 Beta (Santiago)

Comment 16 wes hayutin 2012-05-23 18:22:27 UTC
Retesting this now:
RHUI 2.0.3 deployed on RHEL6.3 w/ the above qpid-cpp rpms.
* Syncing RHUI2.0 and sync to cds did not cause a denial
* Currently syncing RHEL6

Comment 17 wes hayutin 2012-05-23 21:31:05 UTC
not able to recreate in RHEL 6.3 beta w/ RHUI2.0.3.
I guess this can be flipped once RHEL 6.3 is GA

Comment 18 mkovacik 2012-07-19 13:15:26 UTC
The log can't be seen anymore with build: RHEL-6.3-RHUI-2.1-20120705.0/2.1.3/
Switching to verified 

### Verifying screen log
[root@ip-10-2-198-125 ~]# grep -i avc /var/log/audit/audit*.log
[root@ip-10-2-198-125 ~]# echo $?
1
[root@ip-10-2-198-125 ~]# ls /var/log/audit/audit*.log 
/var/log/audit/audit.1.log  /var/log/audit/audit.log
[root@ip-10-2-198-125 ~]# rpm -qa | grep qpid-cpp
qpid-cpp-server-ssl-0.14-16.el6.x86_64
qpid-cpp-client-0.14-16.el6.x86_64
qpid-cpp-client-ssl-0.14-16.el6.x86_64
qpid-cpp-server-0.14-16.el6.x86_64
[root@ip-10-2-198-125 ~]#

Comment 19 Athene Chan 2012-08-14 04:07:49 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A qpidd AVC denial was present in the SELinux audit log.  This update uses a new version of qpidd with updated SELinux policy that fixes the denial.

Comment 21 errata-xmlrpc 2012-08-24 11:53:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-1205.html


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