RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1304723 - Allow {ip|ip6|eb}tables-restore to use read and getattr on files in (/var)/run/firewalld
Summary: Allow {ip|ip6|eb}tables-restore to use read and getattr on files in (/var)/ru...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1342587 1358217 (view as bug list)
Depends On: 1291243
Blocks: 1302802 1332123
TreeView+ depends on / blocked
 
Reported: 2016-02-04 13:13 UTC by Thomas Woerner
Modified: 2016-11-04 02:42 UTC (History)
13 users (show)

Fixed In Version: selinux-policy-3.13.1-89.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1291243
: 1332123 (view as bug list)
Environment:
Last Closed: 2016-11-04 02:42:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2283 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2016-11-03 13:36:25 UTC

Description Thomas Woerner 2016-02-04 13:13:47 UTC
This will be needed for the firewalld rebase to 0.4.0: #1302802

+++ This bug was initially created as a clone of Bug #1291243 +++

Description of problem:
For an enhancement of firewalld it is needed to be able to use the {ip|ip6|eb}tables-restore commands with temporary files that are passed to the restore commands on stdin.
firewalld will create the directory /run/firewalld at startup and will create the temporary files in there.

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-155.fc23

Here are the AVC messages:

ype=AVC msg=audit(1450092486.349:70144): avc:  denied  { read } for  pid=17865 comm="iptables-restor" path="/run/firewalld/temp.gciaj0pn" dev="tmpfs" ino=1078786 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:firewalld_var_run_t:s0 tclass=file permissive=1


type=SYSCALL msg=audit(1450092486.349:70144): arch=x86_64 syscall=execve success=yes exit=0 a0=7f3310f82520 a1=55bb740c6b60 a2=55bb73ccdd00 a3=1 items=0 ppid=17787 pid=17865 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=iptables-restor exe=/usr/sbin/xtables-multi subj=system_u:system_r:iptables_t:s0 key=(null)

Hash: iptables-restor,iptables_t,firewalld_var_run_t,file,read



type=AVC msg=audit(1450092486.350:70145): avc:  denied  { getattr } for  pid=17865 comm="iptables-restor" path="/run/firewalld/temp.gciaj0pn" dev="tmpfs" ino=1078786 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:firewalld_var_run_t:s0 tclass=file permissive=1


type=SYSCALL msg=audit(1450092486.350:70145): arch=x86_64 syscall=fstat success=yes exit=0 a0=0 a1=7fffa63c6300 a2=7fffa63c6300 a3=7fde21bbc700 items=0 ppid=17787 pid=17865 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=iptables-restor exe=/usr/sbin/xtables-multi subj=system_u:system_r:iptables_t:s0 key=(null)

Hash: iptables-restor,iptables_t,firewalld_var_run_t,file,getattr



Please also add these for F-22 and rawhide.

On F-22 I had to allow firewalld to create the directory in (/var)/run:

allow firewalld_t var_run_t:dir create;

--- Additional comment from Lukas Vrabec on 2015-12-14 07:16:32 EST ---

commit 872c7b4c77ca92788eb0f097a82c73c921469ef7
Author: Lukas Vrabec <lvrabec>
Date:   Mon Dec 14 13:06:06 2015 +0100

    Add interface firewalld_read_pid_files()

commit 132fbc10ee97fa1a9d3838842fadf6e5e842f856
Author: Lukas Vrabec <lvrabec>
Date:   Mon Dec 14 13:07:21 2015 +0100

    Allow iptables to read firewalld pid files. BZ(1291243)

--- Additional comment from Lukas Vrabec on 2015-12-14 07:30:21 EST ---

commit 44a47e0c0d2e9e365a5750539e817a061c7c248c
Author: Lukas Vrabec <lvrabec>
Date:   Mon Dec 14 13:27:19 2015 +0100

    Allow firewalld to create firewalld_var_run_t directory. BZ(1291243)

--- Additional comment from Fedora Update System on 2015-12-16 06:06:35 EST ---

selinux-policy-3.13.1-158.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-eb32da49ac

--- Additional comment from Fedora Update System on 2015-12-17 05:29:02 EST ---

selinux-policy-3.13.1-158.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update selinux-policy'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-eb32da49ac

--- Additional comment from Fedora Update System on 2015-12-22 17:03:35 EST ---

selinux-policy-3.13.1-158.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 1 Thomas Woerner 2016-04-14 16:57:32 UTC
This will be needed for the firewalld rebase to 0.4.x in RHEL-7.3.

Comment 3 Thomas Woerner 2016-04-21 15:35:55 UTC
I am getting the following AVCs on RHEL-7.2 with firewalld-0.4.1.2:

#============= firewalld_t ==============
allow firewalld_t var_log_t:file open;
allow firewalld_t var_run_t:dir create;

#============= iptables_t ==============
allow iptables_t firewalld_var_run_t:file { read getattr };

Test packages are available here: 
http://people.redhat.com/twoerner/firewalld/0.4.1.2-1.el7/

Comment 5 Thomas Woerner 2016-05-30 15:55:07 UTC
For the fix for #1066037, there is an additional change required:

allow firewalld_t net_conf_t:dir write;

Firewalld is trying to change the ZONE setting in the ifcfg file that is using the interface, for which the zone binding has been requested. Only if there is an ifcfg file using this interface.

There is a new te file for RHEL-7: http://people.redhat.com/twoerner/firewalld/0.4.2-1.el7/firewalld-0.4.te

Comment 6 Thomas Woerner 2016-06-07 11:18:58 UTC
*** Bug 1342587 has been marked as a duplicate of this bug. ***

Comment 7 Thomas Woerner 2016-06-13 13:19:17 UTC
It seems that there is an additional rule needed for this:

type=AVC msg=audit(1465486509.538:13194): avc:  denied  { add_name } for  pid=6273 comm="firewalld" name="ifcfg-enp0s25.NdcLYC" scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:object_r:net_conf_t:s0 tclass=dir

type=SYSCALL msg=audit(1465486509.538:13194): arch=x86_64 syscall=open success=no exit=EACCES a0=2bb1840 a1=200c2 a2=180 a3=4 items=0 ppid=1 pid=6273 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/python2.7 subj=system_u:system_r:firewalld_t:s0 key=(null)

Hash: firewalld,firewalld_t,net_conf_t,dir,add_name

Comment 8 Thomas Woerner 2016-06-13 13:30:31 UTC
What is the meaning of add_name here?

It seems only to happen while restarting the firewalld service - but not if the code is used while firewalld is running already.

After a relabel of /etc it seems to be gone.

Comment 9 Thomas Woerner 2016-06-13 13:31:47 UTC
(In reply to Thomas Woerner from comment #8)
> What is the meaning of add_name here?
> 
> It seems only to happen while restarting the firewalld service - but not if
> the code is used while firewalld is running already.
> 
> After a relabel of /etc it seems to be gone.
No, still happening...

Comment 10 Daniel Walsh 2016-06-13 16:01:46 UTC
This means that firewalld is adding content to a directory labeled net_conf_t

Comment 11 Thomas Woerner 2016-06-13 16:09:28 UTC
firewalld is creating a temporary file that will be renamed when complete. Is there a better way in the case of modifying ifcfg-X files in /etc/sysconfig/network-scripts/ ?

Comment 12 Daniel Walsh 2016-06-13 17:04:49 UTC
That is fine, and SELinux policy should be adjusted.  Only problem I see would be potentially from a security point of view, in that all other domains that can read net_conf_t could read the file.  But if the file has nothing that needs to be protected from other domains, it seems like a good place to store it.

Comment 13 Thomas Woerner 2016-06-14 11:18:33 UTC
firewalld is not adding secrets to this file. Only the ZONE settings is adjusted to make sure that they match in firewalld and in the ifcfg file.

Comment 18 Thomas Woerner 2016-06-30 12:15:46 UTC
It seems that this is missing:

allow firewalld_t net_conf_t:file { write rename create unlink setattr };

Comment 27 Tomas Dolezal 2016-07-20 13:50:43 UTC
*** Bug 1358217 has been marked as a duplicate of this bug. ***

Comment 29 errata-xmlrpc 2016-11-04 02:42:01 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.

https://rhn.redhat.com/errata/RHBA-2016-2283.html


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