Bug 887352

Summary: denial trying to disable firewall via system-config-firewall
Product: [Fedora] Fedora Reporter: Rex Dieter <rdieter>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-18 06:54:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rex Dieter 2012-12-14 18:44:59 UTC
Long story short, I wanted to test something with firewall disabled, had to first jump through hoops to uninstall firewalld, then tried using system-config-firewall, and recevied the following denial:


SELinux is preventing /usr/bin/python2.7 from unlink access on the file iptables.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow python2.7 to have unlink access on the iptables file
Then you need to change the label on iptables
Do
# semanage fcontext -a -t FILE_TYPE 'iptables'
where FILE_TYPE is one of the following: system_conf_t, systemd_passwd_var_run_t, firewallgui_tmp_t. 
Then execute: 
restorecon -v 'iptables'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that python2.7 should be allowed unlink access on the iptables 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 system-config-f /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:firewallgui_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:etc_t:s0
Target Objects                iptables [ file ]
Source                        system-config-f
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           python-2.7.3-13.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-62.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 3.6.10-4.fc18.x86_64
                              #1 SMP Tue Dec 11 18:01:27 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2012-12-14 12:32:55 CST
Last Seen                     2012-12-14 12:32:55 CST
Local ID                      e85d599f-2931-4816-a7cf-8e185bdbfaac

Raw Audit Messages
type=AVC msg=audit(1355509975.720:1817): avc:  denied  { unlink } for  pid=24101 comm="system-config-f" name="iptables" dev="sda3" ino=393389 scontext=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1355509975.720:1817): arch=x86_64 syscall=unlink success=yes exit=0 a0=1eb7980 a1=1 a2=3bcabb3a08 a3=7379732f6374652f items=0 ppid=1 pid=24101 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=system-config-f exe=/usr/bin/python2.7 subj=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 key=(null)

Hash: system-config-f,firewallgui_t,etc_t,file,unlink

audit2allow

#============= firewallgui_t ==============
allow firewallgui_t etc_t:file unlink;

audit2allow -R

#============= firewallgui_t ==============
allow firewallgui_t etc_t:file unlink;

Comment 1 Miroslav Grepl 2012-12-16 22:53:18 UTC
Please execute

# restorecon -Rv /etc/sysconfig

will fix it for now. I added fixes.

commit 87a2dacb2e000c5eab06156cb40cbf39e321f031
Author: Miroslav Grepl <mgrepl>
Date:   Sun Dec 16 23:51:58 2012 +0100

    Update files_filetrans_system_conf_named_files() interface

Comment 2 Fedora Update System 2012-12-17 17:39:29 UTC
selinux-policy-3.11.1-66.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-66.fc18

Comment 3 Fedora Update System 2012-12-18 06:54:09 UTC
selinux-policy-3.11.1-66.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.