Bug 1473119 - SELinux is preventing firewalld from 'relabelfrom' accesses on the file /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak.
SELinux is preventing firewalld from 'relabelfrom' accesses on the file /etc/...
Status: NEW
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-07-20 00:49 EDT by Mikhail
Modified: 2017-08-15 04:47 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mikhail 2017-07-20 00:49:55 EDT
Description of problem:
SELinux is preventing firewalld from 'relabelfrom' accesses on the file /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak.

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

If you believe that firewalld should be allowed relabelfrom access on the ifcfg-enp2s0.bak file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# ausearch -c 'firewalld' --raw | audit2allow -M my-firewalld
# semodule -X 300 -i my-firewalld.pp

Additional Information:
Source Context                system_u:system_r:firewalld_t:s0
Target Context                unconfined_u:object_r:net_conf_t:s0
Target Objects                /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak [
                              file ]
Source                        firewalld
Source Path                   firewalld
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-264.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.13.0-0.rc1.git0.1.fc27.x86_64 #1
                              SMP Mon Jul 17 16:03:16 UTC 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-07-19 14:08:56 +05
Last Seen                     2017-07-19 14:13:00 +05
Local ID                      7215517a-deb4-4be9-a923-60e14c4ed455

Raw Audit Messages
type=AVC msg=audit(1500455580.528:316): avc:  denied  { relabelfrom } for  pid=752 comm="firewalld" name="ifcfg-enp2s0.bak" dev="sda1" ino=2885753 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:net_conf_t:s0 tclass=file permissive=0

Hash: firewalld,firewalld_t,net_conf_t,file,relabelfrom

Version-Release number of selected component:

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.13.0-0.rc1.git1.1.fc27.x86_64
type:           libreport

Potential duplicate: bug 1365178
Comment 1 Rabin 2017-07-31 08:04:02 EDT
This is long time bug - just Google for "SELinux is preventing firewalld from relabelfrom access on the file" , and it's look like no one from RH/Fedora team will try and fix this.

even when trying to switch to premissive mode to log the event and create a new policy I get this, 

---- ✄ -----------------------

# ausearch -c 'firewalld' --raw | audit2allow

#============= firewalld_t ==============

#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.
#Constraint rule:
#       constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-)  or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED

#       Possible cause is the source user (system_u) and target user (unconfined_u) are different.
allow firewalld_t firewalld_etc_rw_t:file { relabelfrom relabelto };

---- ✄ -----------------------
Comment 2 Jan Kurik 2017-08-15 04:47:09 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

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