Bug 507422

Summary: SELinux is preventing NetworkManager-openvpn to connect to a VPN
Product: [Fedora] Fedora Reporter: Juan <reidrac>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: dwalsh, fedora, jkubin, mgrepl
Target Milestone: ---Keywords: Desktop, SELinux
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-01 08:36:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan 2009-06-22 17:53:04 UTC
I've configured the OpenVPN client from NM using the keys/certs at $HOME/openvpn. When I try to connect, SELinux blocked the operation with two menssages:

1) SELinux is preventing openvpn (openvpn_t) "read" to user.crt (user_home_t). 
2) SELinux is preventing openvpn (openvpn_t) "read" security_t.

1) Gets fixed easily with (although IMHO this should be enabled by default when NetworkManager-openvpn is installed):

setsebool -P openvpn_enable_homedirs=1

2) I can't get rid of this one.

The suggested solution is:

You can generate a local policy module to allow this access - see FAQ Or you can disable SELinux protection altogether. Disabling SELinux protection is not recommended. Please file a bug report against this package.

Logs from audit.log:

node=vortex.usebox.net type=AVC msg=audit(1245692108.795:25): avc: denied { read } for pid=2351 comm="openvpn" name="mls" dev=selinuxfs ino=12 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file 

node=vortex.usebox.net type=SYSCALL msg=audit(1245692108.795:25): arch=40000003 syscall=5 success=no exit=-13 a0=bf942b58 a1=8000 a2=0 a3=bf942b58 items=0 ppid=2348 pid=2351 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="openvpn" exe="/usr/sbin/openvpn" subj=system_u:system_r:openvpn_t:s0 key=(null) 

Version-Release number of components:

NetworkManager-openvpn.i586         1:0.7.0.99-1.fc11
selinux-policy.noarch                  3.6.12-50.fc11 

Steps to Reproduce:

1. Configure an OpenVPN connection in NM with the cert/keys at the user $HOME
2. Try to connect to the VPN

Comment 1 Daniel Walsh 2009-06-22 22:10:17 UTC
You can add these rules now using

# grep avc /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Fixed in selinux-policy-3.6.12-57.fc11

Comment 2 Juan 2009-06-23 17:39:32 UTC
I added the rules and now the VPN client works, but I'm getting a new SELinux alert:

SELinux is preventing openvpn (openvpn_t) "open" security_t. 

Logs from audit.log:

node=vortex.usebox.net type=AVC msg=audit(1245778352.200:40): avc: denied { open } for pid=3787 comm="openvpn" name="mls" dev=selinuxfs ino=12 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file

node=vortex.usebox.net type=SYSCALL msg=audit(1245778352.200:40): arch=40000003 syscall=5 success=no exit=-13 a0=bf861a78 a1=8000 a2=0 a3=bf861a78 items=0 ppid=3783 pid=3787 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="openvpn" exe="/usr/sbin/openvpn" subj=system_u:system_r:openvpn_t:s0 key=(null)

Comment 3 Daniel Walsh 2009-06-24 21:13:21 UTC
Same problem.

You can run the command above again.

But as soon as selinux-policy-3.6.12-57.fc11  becomes available, these will be fixed.  You can safely ignore these.

Comment 4 Juan 2009-06-24 21:16:16 UTC
Thanks you Daniel.

Comment 5 Andrew 2009-07-09 10:58:38 UTC
Similar issue.

F11 / Thinkpad X40

I place my config/cert files in /etc/openvpn and can't connect.


Summary:

SELinux is preventing openvpn (openvpn_t) "read" security_t.

Detailed Description:

SELinux denied access requested by openvpn. It is not expected that this access
is required by openvpn and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Additional Information:

Source Context                system_u:system_r:openvpn_t:s0
Target Context                system_u:object_r:security_t:s0
Target Objects                mls [ file ]
Source                        openvpn
Source Path                   /usr/sbin/openvpn
Port                          <Unknown>
Host                          blackbox
Source RPM Packages           openvpn-2.1-0.32.rc15.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-53.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     blackbox
Platform                      Linux blackbox 2.6.29.5-191.fc11.i586 #1 SMP Tue
                              Jun 16 23:11:39 EDT 2009 i686 i686
Alert Count                   1
First Seen                    Thu 09 Jul 2009 12:49:30 PM CEST
Last Seen                     Thu 09 Jul 2009 12:49:30 PM CEST
Local ID                      c57290aa-094e-4a06-9ef3-d0422fde2ffa
Line Numbers                  

Raw Audit Messages            

node=blackbox type=AVC msg=audit(1247136570.657:34): avc:  denied  { read } for  pid=5499 comm="openvpn" name="mls" dev=selinuxfs ino=12 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file

node=blackbox type=SYSCALL msg=audit(1247136570.657:34): arch=40000003 syscall=5 success=no exit=-13 a0=bf8d7228 a1=8000 a2=0 a3=bf8d7228 items=0 ppid=5494 pid=5499 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="openvpn" exe="/usr/sbin/openvpn" subj=system_u:system_r:openvpn_t:s0 key=(null)

Comment 6 Daniel Walsh 2009-07-09 12:09:21 UTC
You need to upgrade policy,

yum -y upgrade selinux-policy-targeted

If this does not pull a new one down, execute

yum -y upgrade selinux-policy-targeted --enablerepo=updatestesting

Comment 7 Juan 2009-08-01 08:36:38 UTC
Using selinux-policy-targeted 3.6.12-62.fc11 and it's fixed.