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 1607994 - Cannot Connect To VPN After Update Due To SELinux
Summary: Cannot Connect To VPN After Update Due To SELinux
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-24 17:22 UTC by Brian
Modified: 2018-10-30 10:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:07:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3111 0 None None None 2018-10-30 10:08:09 UTC

Description Brian 2018-07-24 17:22:05 UTC
SELinux is preventing /usr/libexec/ipsec/addconn from read access on the file nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf.

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

If you believe that addconn should be allowed read access on the nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf 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:
# ausearch -c 'addconn' --raw | audit2allow -M my-addconn
# semodule -i my-addconn.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:object_r:l2tpd_var_run_t:s0
Target Objects                nm-l2tp-ipsec-
                              163eb469-8436-4da6-a0a3-3e29f8e3c412.conf [ file ]
Source                        addconn
Source Path                   /usr/libexec/ipsec/addconn
Port                          <Unknown>
Host                          tbs-hp
Source RPM Packages           libreswan-3.23-5.el7_5.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-192.el7_5.4.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     tbs-hp
Platform                      Linux tbs-hp 3.10.0-862.9.1.el7.x86_64 #1 SMP Wed
                              Jun 27 04:30:39 EDT 2018 x86_64 x86_64
Alert Count                   3
First Seen                    2018-07-24 13:11:59 EDT
Last Seen                     2018-07-24 13:14:19 EDT
Local ID                      7bbbf2be-ba7b-403a-8e7a-e37e8b7bcab3

Raw Audit Messages
type=AVC msg=audit(1532452459.665:1716): avc:  denied  { read } for  pid=19239 comm="addconn" name="nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf" dev="tmpfs" ino=139872 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:l2tpd_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1532452459.665:1716): arch=x86_64 syscall=open success=no exit=EACCES a0=55ed97f73050 a1=0 a2=1b6 a3=24 items=0 ppid=19238 pid=19239 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=addconn exe=/usr/libexec/ipsec/addconn subj=system_u:system_r:ipsec_t:s0 key=(null)

Hash: addconn,ipsec_t,l2tpd_var_run_t,file,read

Comment 2 Brian 2018-07-24 17:28:36 UTC
After installing the semodule from the details, this error appears:

SELinux is preventing addconn from open access on the file /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf default label should be var_run_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that addconn should be allowed open access on the nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf 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:
# ausearch -c 'addconn' --raw | audit2allow -M my-addconn
# semodule -i my-addconn.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:object_r:l2tpd_var_run_t:s0
Target Objects                /run/nm-l2tp-ipsec-
                              163eb469-8436-4da6-a0a3-3e29f8e3c412.conf [ file ]
Source                        addconn
Source Path                   addconn
Port                          <Unknown>
Host                          tbs-hp
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-192.el7_5.4.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     tbs-hp
Platform                      Linux tbs-hp 3.10.0-862.9.1.el7.x86_64 #1 SMP Wed
                              Jun 27 04:30:39 EDT 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-07-24 13:26:06 EDT
Last Seen                     2018-07-24 13:26:06 EDT
Local ID                      fa63bb32-54d9-47d5-8b80-c0c3801e8fe6

Raw Audit Messages
type=AVC msg=audit(1532453166.778:2156): avc:  denied  { open } for  pid=20595 comm="addconn" path="/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf" dev="tmpfs" ino=139872 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:l2tpd_var_run_t:s0 tclass=file


Hash: addconn,ipsec_t,l2tpd_var_run_t,file,open

Comment 3 Brian 2018-07-24 17:31:33 UTC
The VPN would connect after installing the semodule again from previous details. There are 2 more SELinux errors that appear after it is established:

SELinux is preventing /usr/libexec/ipsec/addconn from ioctl access on the file /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf default label should be var_run_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that addconn should be allowed ioctl access on the nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf 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:
# ausearch -c 'addconn' --raw | audit2allow -M my-addconn
# semodule -i my-addconn.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:object_r:l2tpd_var_run_t:s0
Target Objects                /run/nm-l2tp-ipsec-
                              163eb469-8436-4da6-a0a3-3e29f8e3c412.conf [ file ]
Source                        addconn
Source Path                   /usr/libexec/ipsec/addconn
Port                          <Unknown>
Host                          tbs-hp
Source RPM Packages           libreswan-3.23-5.el7_5.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-192.el7_5.4.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     tbs-hp
Platform                      Linux tbs-hp 3.10.0-862.9.1.el7.x86_64 #1 SMP Wed
                              Jun 27 04:30:39 EDT 2018 x86_64 x86_64
Alert Count                   2
First Seen                    2018-07-24 13:29:14 EDT
Last Seen                     2018-07-24 13:29:14 EDT
Local ID                      ce84560a-08c9-4acf-a23f-12a3ab5daa57

Raw Audit Messages
type=AVC msg=audit(1532453354.965:2214): avc:  denied  { ioctl } for  pid=21347 comm="addconn" path="/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf" dev="tmpfs" ino=139872 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:l2tpd_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1532453354.965:2214): arch=x86_64 syscall=ioctl success=no exit=EACCES a0=3 a1=5401 a2=7ffd7c74dac0 a3=55587d798640 items=0 ppid=21346 pid=21347 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=addconn exe=/usr/libexec/ipsec/addconn subj=system_u:system_r:ipsec_t:s0 key=(null)

Hash: addconn,ipsec_t,l2tpdSELinux is preventing /usr/libexec/ipsec/addconn from getattr access on the file /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf default label should be var_run_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf




*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that addconn should be allowed getattr access on the nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf 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:
# ausearch -c 'addconn' --raw | audit2allow -M my-addconn
# semodule -i my-addconn.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:object_r:l2tpd_var_run_t:s0
Target Objects                /run/nm-l2tp-ipsec-
                              163eb469-8436-4da6-a0a3-3e29f8e3c412.conf [ file ]
Source                        addconn
Source Path                   /usr/libexec/ipsec/addconn
Port                          <Unknown>
Host                          tbs-hp
Source RPM Packages           libreswan-3.23-5.el7_5.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-192.el7_5.4.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     tbs-hp
Platform                      Linux tbs-hp 3.10.0-862.9.1.el7.x86_64 #1 SMP Wed
                              Jun 27 04:30:39 EDT 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-07-24 13:29:14 EDT
Last Seen                     2018-07-24 13:29:14 EDT
Local ID                      4d4c3355-dbc7-40df-a211-5b71982ab552

Raw Audit Messages
type=AVC msg=audit(1532453354.965:2212): avc:  denied  { getattr } for  pid=21347 comm="addconn" path="/run/nm-l2tp-ipsec-163eb469-8436-4da6-a0a3-3e29f8e3c412.conf" dev="tmpfs" ino=139872 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:l2tpd_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1532453354.965:2212): arch=x86_64 syscall=fstat success=no exit=EACCES a0=3 a1=7ffd7c74da50 a2=7ffd7c74da50 a3=55587d798640 items=0 ppid=21346 pid=21347 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=addconn exe=/usr/libexec/ipsec/addconn subj=system_u:system_r:ipsec_t:s0 key=(null)

Hash: addconn,ipsec_t,l2tpd_var_run_t,file,getattr
_var_run_t,file,ioctl

Comment 7 errata-xmlrpc 2018-10-30 10:07:44 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://access.redhat.com/errata/RHBA-2018:3111


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