Bug 1270210

Summary: SELinux is preventing openfortivpn from read, write access on the chr_file ptmx.
Product: [Fedora] Fedora Reporter: Berend De Schouwer <berend.de.schouwer>
Component: NetworkManagerAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 23CC: berend.de.schouwer, dcbw, dominick.grift, dwalsh, lkundrak, lvrabec, mgrepl, plautrba, psimerda, redhat, tom.ghyselinck
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:f64baff97bc81738c722d12f8a1c5d03dcb99a1b11233f9bdf052f73b579e63c;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 14:55:58 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:
Attachments:
Description Flags
ausearch recent none

Description Berend De Schouwer 2015-10-09 09:47:40 UTC
Description of problem:
Start a Fortisslvpn connections
SELinux is preventing openfortivpn from read, write access on the chr_file ptmx.

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

If you believe that openfortivpn should be allowed read write access on the ptmx chr_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:
# grep openfortivpn /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:NetworkManager_t:s0
Target Context                system_u:object_r:ptmx_t:s0
Target Objects                ptmx [ chr_file ]
Source                        openfortivpn
Source Path                   openfortivpn
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-147.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.3-300.fc23.x86_64 #1 SMP Mon
                              Oct 5 15:42:54 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-10-09 11:46:28 SAST
Last Seen                     2015-10-09 11:46:28 SAST
Local ID                      df69892a-3b2a-4002-9b14-d78dd05a954f

Raw Audit Messages
type=AVC msg=audit(1444383988.991:795): avc:  denied  { read write } for  pid=6270 comm="openfortivpn" name="ptmx" dev="devtmpfs" ino=1122 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file permissive=0


Hash: openfortivpn,NetworkManager_t,ptmx_t,chr_file,read,write

Version-Release number of selected component:
selinux-policy-3.13.1-147.fc23.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.2.3-300.fc23.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2015-10-13 10:54:21 UTC
Does it work correctly with

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

Comment 2 Berend De Schouwer 2015-10-13 11:06:21 UTC
No.

There used to be selinux policy problems, but those were fixed.

$ sudo grep openfortivpn /var/log/audit/audit.log | audit2allow -M mypol
Nothing to do


I now get (in journald)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: ERROR:  forkpty: Permission denied


The VPN actually connects, and authenticated.  Then it dies because it can't open a pty.

There might be a policykit problem?  The gnome-session/gjs logs are there because it asks for a /vpn/ password, not a sudo password.

Full log:

Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  Starting VPN service 'fortisslvpn'...
Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN service 'fortisslvpn' started (org.freedesktop.NetworkManager.fortisslvpn), PID 17725
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: (gnome-shell:1647): Gjs-WARNING **: JS ERROR: TypeError: a._connection is null
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMVPNSection<.setActiveConnections/<@resource:///org/gnome/shell/ui/status/network.js:1534
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMVPNSection<.setActiveConnections@resource:///org/gnome/shell/ui/status/network.js:1533
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMApplet<._syncVPNConnections@resource:///org/gnome/shell/ui/status/network.js:1822
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN service 'fortisslvpn' appeared; activating connections
Oct 13 13:00:37 sieve-deschouwer-co-za audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN connection 'Argility' (ConnectInteractive) reply received.
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state changed: starting (3)
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: ** Message: openfortivpn started with pid 17737
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN connection 'Argility' (Connect) reply received.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Connected to gateway.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Authenticated.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Remote gateway has allocated a VPN.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: ERROR:  forkpty: Permission denied
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Closed connection to gateway.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Logged out.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state changed: stopped (6)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state change reason: unknown (0)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <warn>  error disconnecting VPN: Could not process the request because no VPN connection was active.

Comment 3 Berend De Schouwer 2015-10-13 11:09:07 UTC
There used to be AVC warnings interspersed with the NetworkManager lines.  The only remaining audit log is me running 'sudo' for 'sudo journalctl -f'

Comment 4 Berend De Schouwer 2016-02-10 09:01:03 UTC
Description of problem:
Start a Forti SSL VPN connection in NetworkManager

Version-Release number of selected component:
selinux-policy-3.13.1-158.4.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.0-0.rc6.git1.2.fc24.x86_64
type:           libreport

Comment 5 Berend De Schouwer 2016-02-10 09:10:54 UTC
I'm getting these AVC warnings again, using F23.

Running semodule doesn't fix the problem.  selinux keeps moaning.
audit2allow says:

#!!!! This avc is allowed in the current policy
allow NetworkManager_t ptmx_t:chr_file { write read open };

Comment 6 Berend De Schouwer 2016-02-10 09:27:53 UTC
setenforce 0 does work
audit2allow does not work

So I need a different selinux rule to get this client working.

Comment 7 Lukas Vrabec 2016-02-10 09:34:07 UTC
Hi Berend, 
Could you reproduce the issue and after that you run:
# ausearch -m AVC -ts recent 

And attach output. 

Thank you.

Comment 8 Berend De Schouwer 2016-02-10 10:37:22 UTC
Created attachment 1122730 [details]
ausearch recent

Output of 'ausearch -m AVC -ts recent'

Comment 9 Berend De Schouwer 2016-02-10 10:39:11 UTC
I am aware it's complaining about { ioctl } and not { write read open }

Comment 10 Tom Ghyselinck 2016-03-09 07:49:17 UTC
Description of problem:
1. Using GNOME NetworkManager, define the Fortinet VPN access.
2. Make a VPN connection using the fortinet VPN
3. Error


Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.3-300.fc23.x86_64
type:           libreport

Comment 11 redhat 2016-08-04 13:57:00 UTC
same problem as the others. my solution was to disable selinux. a fix would be fantastic :)

Comment 12 Fedora End Of Life 2016-11-24 12:44:16 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2016-12-20 14:55:58 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.