Bug 697573

Summary: SELinux is preventing /usr/bin/python from 'search' accesses on the directory /root/.local.
Product: [Fedora] Fedora Reporter: Kyle Martin <martikj2>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 18CC: blitzter, davenmo, dcharlespyle, dwalsh, edosurina, fx105548d, gholms, hatemaker, jpopelka, kevin, kmaraas, mgrepl, ms, thughes, twoerner, xck, ymqiuyu
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:04262a5f14749f33a525b53c0ba6a38148eb36d383eb9d7f63fca57a214c318c
Fixed In Version: firewalld-0.2.9-1.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-15 12:11:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
THis patch causes all privledged firewall apps to not read /root/.local content. none

Description Kyle Martin 2011-04-18 16:01:57 UTC
SELinux is preventing /usr/bin/python from 'search' accesses on the directory /root/.local.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that python should be allowed search access on the .local 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 firewalld /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:firewalld_t:s0
Target Context                system_u:object_r:gconf_home_t:s0
Target Objects                /root/.local [ dir ]
Source                        firewalld
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.1-6.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-15.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-9.fc15.i686.PAE #1 SMP
                              Wed Mar 30 16:47:28 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Mon 18 Apr 2011 10:57:15 AM CDT
Last Seen                     Mon 18 Apr 2011 10:57:15 AM CDT
Local ID                      26ca58f0-78db-4f2c-b7a1-57f01a76abcd

Raw Audit Messages
type=AVC msg=audit(1303142235.32:190): avc:  denied  { search } for  pid=7533 comm="firewalld" name=".local" dev=dm-1 ino=272060 scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:object_r:gconf_home_t:s0 tclass=dir


type=SYSCALL msg=audit(1303142235.32:190): arch=i386 syscall=stat64 success=no exit=ENOENT a0=90c0de0 a1=bfd0927c a2=438daff4 a3=90c0de0 items=0 ppid=7532 pid=7533 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=firewalld exe=/usr/bin/python subj=system_u:system_r:firewalld_t:s0 key=(null)

Hash: firewalld,firewalld_t,gconf_home_t,dir,search

audit2allow

#============= firewalld_t ==============
allow firewalld_t gconf_home_t:dir search;

audit2allow -R

#============= firewalld_t ==============
allow firewalld_t gconf_home_t:dir search;

Comment 1 Kyle Martin 2011-04-18 16:07:05 UTC
This alert came up when I restarted firewalld because the desktop applet could not connect to the daemon process by running:
<code> 
# /etc/init.d/firewalld restart
</code>

Even with the SELinux alert the desktop applet was still able to successfully connect to the daemon after it restarted

running on gnome desktop with fallback graphics mode enabled

Comment 2 Daniel Walsh 2011-04-18 19:38:02 UTC
Can you add a -s to firewalld

! /usr/bin/python -Es

Would be a good idea. you really do not want random crap in ~/.local affecting system apps.

man python

      -E     Ignore environment variables like PYTHONPATH and PYTHONHOME that
              modify the behavior of the interpreter.

       -s     Don't add user site directory to sys.path.

Comment 3 Fedora End Of Life 2012-08-07 19:09:35 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 D. Charles Pyle 2012-10-02 04:17:57 UTC
This same error now is occurring in Fedora 18-Alpha.

Comment 5 Daniel Walsh 2012-10-09 18:06:35 UTC
Created attachment 624216 [details]
THis patch causes all privledged firewall apps to not read /root/.local content.

Pleas apply this patch to firewalld to prevent this AVC and also to block unexpected bugs in the field.

Comment 6 Thomas Woerner 2012-10-10 16:04:37 UTC
Reassigning to firewalld.

Comment 7 Thomas Woerner 2012-10-10 16:05:53 UTC
Fixed in GIT: http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=761d56f5e729feca6a039e34fc98e5af71d7b457

The shabang will be fixed at installation time. In the GIT environment PYTHONPATH is used for tests.

Comment 8 Kjartan Maraas 2013-01-29 16:29:17 UTC
Happens during login.

Package: (null)
Architecture: x86_64
OS Release: Fedora release 18 (Spherical Cow)