Bug 1903022

Summary: selinux prevents ipsec service to start
Product: [Fedora] Fedora Reporter: Marek Greško <marek.gresko>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 33CC: dwalsh, grepl.miroslav, lvrabec, mmalik, omosnace, plautrba, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-03 10:51:47 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 Marek Greško 2020-12-01 07:11:58 UTC
Description of problem:
The ipsec service is unable to start when selinux in enforcing mode. It is complaining about unability to access /var/lib/ipsec/nss/ directory structure.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.14.6-30.fc33.noarch


How reproducible:
By starting ipsec service in enforcing mode.

Steps to Reproduce:
1.
2.
3.

Actual results:
The ipsec service fails to start because of unablility to access /var/lib/ipsec/nss/ directory structure.

Expected results:
The ipsec service starts.

Additional info:

Comment 1 Milos Malik 2020-12-03 09:06:00 UTC
Please collect SELinux denials which appear on your machine and attach them here:

# ausearch -m avc -m user_avc -m selinux_err -i -ts today

Thank you.

Comment 2 Zdenek Pytela 2020-12-03 10:51:47 UTC
The fix will be a part of the next build.

*** This bug has been marked as a duplicate of bug 1903154 ***

Comment 3 Marek Greško 2020-12-07 13:24:27 UTC
----
type=AVC msg=audit(07.12.2020 14:16:42.403:1769) : avc:  denied  { read } for  pid=47178 comm=pluto name=pkcs11.txt dev="dm-2" ino=1788 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=1 
----
type=AVC msg=audit(07.12.2020 14:16:42.403:1770) : avc:  denied  { open } for  pid=47178 comm=pluto path=/var/lib/ipsec/nss/pkcs11.txt dev="dm-2" ino=1788 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=1 
----
type=AVC msg=audit(07.12.2020 14:16:42.403:1771) : avc:  denied  { getattr } for  pid=47178 comm=pluto path=/var/lib/ipsec/nss/pkcs11.txt dev="dm-2" ino=1788 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=1 
----
type=AVC msg=audit(07.12.2020 14:16:42.404:1772) : avc:  denied  { lock } for  pid=47178 comm=pluto path=/var/lib/ipsec/nss/cert9.db dev="dm-2" ino=1786 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file permissive=1 

and some unrelated if could be also fixed please:

----
type=AVC msg=audit(07.12.2020 00:00:07.684:1616) : avc:  denied  { read open } for  pid=39384 comm=sh path=/usr/bin/zmpkg.pl dev="dm-1" ino=3146930 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:zoneminder_exec_t:s0 tclass=file permissive=1 
----
type=AVC msg=audit(07.12.2020 00:00:07.688:1617) : avc:  denied  { ioctl } for  pid=39384 comm=zmpkg.pl path=/usr/bin/zmpkg.pl dev="dm-1" ino=3146930 ioctlcmd=TCGETS scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:zoneminder_exec_t:s0 tclass=file permissive=1 
----
type=AVC msg=audit(07.12.2020 00:00:09.295:1637) : avc:  denied  { write } for  pid=39410 comm=zmdc.pl name=zmdc.sock dev="sdc1" ino=2624939 scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:object_r:zoneminder_var_lib_t:s0 tclass=sock_file permissive=1 
--------
type=AVC msg=audit(07.12.2020 00:00:09.296:1638) : avc:  denied  { connectto } for  pid=39410 comm=zmdc.pl path=/mnt/zm/sock/zmdc.sock scontext=system_u:system_r:logrotate_t:s0 tcontext=system_u:system_r:zoneminder_t:s0 tclass=unix_stream_socket permissive=1 
----