Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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.
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/
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
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.
(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...
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/ ?
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.
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