Bug 887352 - denial trying to disable firewall via system-config-firewall
Summary: denial trying to disable firewall via system-config-firewall
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-14 18:44 UTC by Rex Dieter
Modified: 2012-12-18 06:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-18 06:54:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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