Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1519928 - SELinux is preventing nm-fortisslvpn- from 'unlink' accesses on the fichier 3955607a-3e81-44e2-b744-a06b3406c818.config.
Summary: SELinux is preventing nm-fortisslvpn- from 'unlink' accesses on the fichier 3...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager-fortisslvpn
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lubomir Rintel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:d83d4ffc67099a085cbddc7900d...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-01 17:39 UTC by William Oprandi
Modified: 2018-01-30 18:03 UTC (History)
20 users (show)

Fixed In Version: NetworkManager-fortisslvpn-1.2.8-1 NetworkManager-fortisslvpn-1.2.8-1.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-30 18:03:00 UTC


Attachments (Terms of Use)

Description William Oprandi 2017-12-01 17:39:23 UTC
Description of problem:
Cannot connect to VPN without disable SELinux
SELinux is preventing nm-fortisslvpn- from 'unlink' accesses on the fichier 3955607a-3e81-44e2-b744-a06b3406c818.config.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If vous souhaitez allow daemons to dump core
Then vous devez en informer SELinux en activant le booléen « daemons_dump_core ».

Do
setsebool -P daemons_dump_core 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If vous pensez que nm-fortisslvpn- devrait être autorisé à accéder unlink sur 3955607a-3e81-44e2-b744-a06b3406c818.config file par défaut.
Then vous devriez rapporter ceci en tant qu'anomalie.
Vous pouvez générer un module de stratégie local pour autoriser cet accès.
Do
allow this access for now by executing:
# ausearch -c 'nm-fortisslvpn-' --raw | audit2allow -M my-nmfortisslvpn
# semodule -X 300 -i my-nmfortisslvpn.pp

Additional Information:
Source Context                system_u:system_r:openfortivpn_t:s0
Target Context                system_u:object_r:root_t:s0
Target Objects                3955607a-3e81-44e2-b744-a06b3406c818.config [ file
                              ]
Source                        nm-fortisslvpn-
Source Path                   nm-fortisslvpn-
Port                          <Inconnu>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.17.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.13.15-300.fc27.x86_64 #1 SMP Tue
                              Nov 21 21:10:22 UTC 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-11-15 08:44:48 CET
Last Seen                     2017-12-01 18:36:09 CET
Local ID                      9fb664a8-8951-4dea-a25b-b66e63c48f24

Raw Audit Messages
type=AVC msg=audit(1512149769.921:306): avc:  denied  { unlink } for  pid=3062 comm="nm-fortisslvpn-" name="3955607a-3e81-44e2-b744-a06b3406c818.config" dev="dm-0" ino=3244 scontext=system_u:system_r:openfortivpn_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=file permissive=1


Hash: nm-fortisslvpn-,openfortivpn_t,root_t,file,unlink

Version-Release number of selected component:
selinux-policy-3.13.1-283.17.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.13.15-300.fc27.x86_64
type:           libreport

Comment 1 Angelo Lisco 2017-12-04 18:59:58 UTC
Same here on F27:

dic 04 19:38:20 mypc2-nb NetworkManager[825]: <info>  [1512412700.0981] audit: op="connection-activate" uuid="a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c" name="MyCompany VPN Italy" pid=1954 uid=1000 result="success"
dic 04 19:38:20 mypc2-nb NetworkManager[825]: <info>  [1512412700.1103] vpn-connection[0x557b933924a0,a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy",0]: Started the VPN service, PID 10817
dic 04 19:38:20 mypc2-nb NetworkManager[825]: <info>  [1512412700.1198] vpn-connection[0x557b933924a0,a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy",0]: Saw the service appear; activating connection
dic 04 19:38:23 mypc2-nb NetworkManager[825]: <info>  [1512412703.7062] keyfile: update /etc/NetworkManager/system-connections/MyCompany VPN Italy (a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy")
dic 04 19:38:23 mypc2-nb NetworkManager[825]: <info>  [1512412703.7078] keyfile: update /etc/NetworkManager/system-connections/MyCompany VPN Italy (a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy") after persisting connection
dic 04 19:38:23 mypc2-nb NetworkManager[825]: <info>  [1512412703.7284] vpn-connection[0x557b933924a0,a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy",0]: VPN connection: (ConnectInteractive) reply received
dic 04 19:38:23 mypc2-nb audit[10817]: AVC avc:  denied  { write } for  pid=10817 comm="nm-fortisslvpn-" name="/" dev="sda5" ino=2 scontext=system_u:system_r:openfortivpn_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir permissive=0
dic 04 19:38:23 mypc2-nb NetworkManager[825]: <warn>  [1512412703.7298] vpn-connection[0x557b933924a0,a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy",0]: VPN connection: failed to connect: 'Failed to create file “/a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c.config.J2C3AZ”: Permission denied'
dic 04 19:38:23 mypc2-nb NetworkManager[825]: <info>  [1512412703.7318] vpn-connection[0x557b933924a0,a0531eb1-dd0d-4621-ba2a-bb53e2bc3d2c,"MyCompany VPN Italy",0]: VPN service disappeared
dic 04 19:38:26 mypc2-nb setroubleshoot[6065]: SELinux is preventing nm-fortisslvpn- from write access on the directory /. For complete SELinux messages run: sealert -l 57f757ab-e612-4a35-a21d-a8850d592cbe
dic 04 19:38:26 mypc2-nb python3[6065]: SELinux is preventing nm-fortisslvpn- from write access on the directory /.
                                         
                                         *****  Plugin catchall_boolean (89.3 confidence) suggests   ******************
                                         
                                         If you want to allow daemons to dump core
                                         Then you must tell SELinux about this by enabling the 'daemons_dump_core' boolean.
                                         
                                         Do
                                         setsebool -P daemons_dump_core 1
                                         
                                         *****  Plugin catchall (11.6 confidence) suggests   **************************
                                         
                                         If you believe that nm-fortisslvpn- should be allowed write access on the  directory 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 'nm-fortisslvpn-' --raw | audit2allow -M my-nmfortisslvpn
                                         # semodule -X 300 -i my-nmfortisslvpn.pp
                                         

After I enabled the boolean "daemons_dump_core", the vpn plugin worked as expected without disabling selinux.

Comment 2 Lukas Vrabec 2017-12-11 17:03:17 UTC
Hi, 

Where is this file "3955607a-3e81-44e2-b744-a06b3406c818.config" stored? It looks like you move this file from /root to /etc/. 

Could you please run:
# restorecon -Rv / 

And then try to reproduce the issue? 

Thanks,
Lukas.

Comment 3 Ferdinand Holzer 2017-12-17 13:47:56 UTC
Seems like this is an issue with the network manager plugin, it starts the openfortivpn with "-c /<GUID>.config" directly in the root. Either the process should be chroot'ed or it should provide a path in a different location.

After `setenforce 0`:
$ ps -ef|grep forti
root     22015     1  0 14:30 ?        00:00:00 /usr/libexec/nm-fortisslvpn-service --bus-name org.freedesktop.NetworkManager.fortisslvpn.Connection_10
root     22030 22015  0 14:30 ?        00:00:00 /bin/openfortivpn -c /4a07281b-5428-41fd-94d3-a0f8a2af6698.config --no-routes --no-dns HIDDEN 443 --trusted-cert SECRET --pppd-plugin /usr/lib64/pppd/2.4.7/nm-fortisslvpn-pppd-plugin.so
root     22032 22030  0 14:30 pts/3    00:00:00 /usr/sbin/pppd 38400 noipdefault noaccomp noauth default-asyncmap nopcomp receive-all nodefaultroute :1.1.1.1 nodetach lcp-max-configure 40 mru 1354 usepeerdns plugin /usr/lib64/pppd/2.4.7/nm-fortisslvpn-pppd-plugin.so
user    24561  6095  0 14:43 pts/2    00:00:00 grep --color=auto forti

Comment 4 Lukas Vrabec 2017-12-18 09:51:50 UTC
Looks like Ferdinand is right.

Guys, could you store it somewhere else?

Comment 6 Fedora Update System 2018-01-17 11:45:35 UTC
NetworkManager-fortisslvpn-1.2.8-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a9a4ff8218

Comment 7 Fedora Update System 2018-01-18 02:10:56 UTC
NetworkManager-fortisslvpn-1.2.8-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a9a4ff8218

Comment 8 Fedora Update System 2018-01-30 18:03:00 UTC
NetworkManager-fortisslvpn-1.2.8-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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