Bug 1787944 - SELinux is preventing openfortivpn from 'write' accesses on the Datei resolv.conf.
Summary: SELinux is preventing openfortivpn from 'write' accesses on the Datei resolv....
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 30
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Nikola Knazekova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:b604524f9322f3297c2800afcd2...
: 1788829 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-05 18:47 UTC by Frank Büttner
Modified: 2020-04-29 16:16 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.14.3-57.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-05 03:54:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Frank Büttner 2020-01-05 18:47:58 UTC
Description of problem:
Since the last update of fortinet client this will happens.
SELinux is preventing openfortivpn from 'write' accesses on the Datei resolv.conf.

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

Wenn Sie denken, dass es openfortivpn standardmäßig erlaubt sein sollte, write Zugriff auf resolv.conf file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
Do
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# ausearch -c 'openfortivpn' --raw | audit2allow -M my-openfortivpn
# semodule -X 300 -i my-openfortivpn.pp

Additional Information:
Source Context                system_u:system_r:openfortivpn_t:s0
Target Context                system_u:object_r:net_conf_t:s0
Target Objects                resolv.conf [ file ]
Source                        openfortivpn
Source Path                   openfortivpn
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-53.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.3.16-200.fc30.x86_64 #1 SMP Fri
                              Dec 13 17:48:38 UTC 2019 x86_64 x86_64
Alert Count                   1
First Seen                    2020-01-05 19:45:50 CET
Last Seen                     2020-01-05 19:45:50 CET
Local ID                      cb92c9ce-13e6-446f-86af-037d214eddd0

Raw Audit Messages
type=AVC msg=audit(1578249950.299:246): avc:  denied  { write } for  pid=7840 comm="openfortivpn" name="resolv.conf" dev="tmpfs" ino=54438 scontext=system_u:system_r:openfortivpn_t:s0 tcontext=system_u:object_r:net_conf_t:s0 tclass=file permissive=0


Hash: openfortivpn,openfortivpn_t,net_conf_t,file,write

Version-Release number of selected component:
selinux-policy-3.14.3-53.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.11.3
hashmarkername: setroubleshoot
kernel:         5.3.16-200.fc30.x86_64
type:           libreport

Comment 1 hkoba 2020-01-07 00:49:07 UTC
Similar problem has been detected:

When I enabled VPN, this AVC occured.

hashmarkername: setroubleshoot
kernel:         5.3.16-200.fc30.x86_64
package:        selinux-policy-3.14.3-53.fc30.noarch
reason:         SELinux is preventing openfortivpn from 'write' accesses on the file /etc/resolv.conf.
type:           libreport

Comment 2 Lukas Vrabec 2020-01-09 21:25:10 UTC
*** Bug 1788829 has been marked as a duplicate of this bug. ***

Comment 3 Enrico Macchiavelli 2020-01-17 08:34:47 UTC
Similar problem has been detected:

Attivando la vpn basata su fortinet

hashmarkername: setroubleshoot
kernel:         5.4.8-200.fc31.x86_64
package:        selinux-policy-3.14.4-43.fc31.noarch
reason:         SELinux is preventing openfortivpn from 'write' accesses on the file /etc/resolv.conf.
type:           libreport

Comment 4 fpasqua 2020-01-20 13:20:43 UTC
Similar problem has been detected:

Connected a VPN based on Forticlient

hashmarkername: setroubleshoot
kernel:         5.4.10-200.fc31.x86_64
package:        selinux-policy-3.14.4-43.fc31.noarch
reason:         SELinux is preventing openfortivpn from 'write' accesses on the file /etc/resolv.conf.
type:           libreport

Comment 5 fpasqua 2020-01-27 08:51:07 UTC
Similar problem has been detected:

Opened a fortivpn connection via the GNOME applet

hashmarkername: setroubleshoot
kernel:         5.4.12-200.fc31.x86_64
package:        selinux-policy-3.14.4-44.fc31.noarch
reason:         SELinux is preventing openfortivpn from 'write' accesses on the file /etc/resolv.conf.
type:           libreport

Comment 6 Lukas Vrabec 2020-01-27 13:16:22 UTC
commit f518d93075d1400fd34757cbb11f45766518ed59 (HEAD -> rawhide, origin/rawhide, origin/HEAD)
Author: Nikola Knazekova <nknazeko>
Date:   Mon Jan 13 17:00:57 2020 +0100

    Allow openfortivpn_t to manage net_conf_t files.
    
    Allow openfortivpn — client for PPP+SSL VPN tunnel services, to manage network config files.
    
    /etc/resolv.conf labeled as net_conf_t is used by openfortivpn for adding DNS name servers.
    
    Fixed Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1787944

commit 1a51196803354916c8655bce4431deabd80b50a0
Author: Nikola Knazekova <nknazeko>
Date:   Mon Jan 13 16:59:17 2020 +0100

    Introduce boolean openfortivpn_can_network_connect.
    
    Boolean openfortivpn_can_network_connect is by default enabled and determines whether openfortivpn can connect to the TCP network.

Comment 7 Fedora Update System 2020-03-20 08:00:24 UTC
FEDORA-2020-cde9529d3d has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-cde9529d3d

Comment 8 Fedora Update System 2020-03-21 01:22:24 UTC
selinux-policy-3.14.3-57.fc30 has been pushed to the Fedora 30 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-2020-cde9529d3d

Comment 9 Fedora Update System 2020-04-05 03:54:52 UTC
FEDORA-2020-cde9529d3d has been pushed to the Fedora 30 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Rafael Reuber 2020-04-28 15:11:31 UTC
I'm having the same problem

Comment 11 Zdenek Pytela 2020-04-28 16:06:59 UTC
Rafael,

What is your selinux-policy package version? Is the AVC denial the same as reported in this BZ?

Comment 12 Rafael Reuber 2020-04-28 16:37:00 UTC
selinux-policy-3.14.4-50.fc31.noarch

Comment 13 Rafael Reuber 2020-04-28 16:50:17 UTC
[reuber@stormy ~]$ journalctl -f
-- Logs begin at Mon 2019-12-09 06:03:32 -03. --
...
abr 28 13:48:01 stormy.example.com geoclue[7467]: Failed to query location: Error resolving “location.services.mozilla.com”: Nome ou serviço desconhecido
abr 28 13:48:01 stormy.example.com NetworkManager[933]: <info>  [1588092481.9940] audit: op="connection-activate" uuid="34638d8f-9b52-4d2d-b4b4-203722702687" name="vpn.unimedfortaleza.com.br" pid=7398 uid=1000 result="success"
abr 28 13:48:01 stormy.example.com NetworkManager[933]: <info>  [1588092481.9989] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: Started the VPN service, PID 16485
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0080] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: Saw the service appear; activating connection
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0646] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN plugin: state changed: starting (3)
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0646] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN connection: (ConnectInteractive) reply received
abr 28 13:48:02 stormy.example.com audit[16492]: AVC avc:  denied  { read } for  pid=16492 comm="openfortivpn" name="resolv.conf" dev="dm-0" ino=655703 scontext=system_u:system_r:openfortivpn_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0
abr 28 13:48:02 stormy.example.com NetworkManager[933]: ERROR:  getaddrinfo: Name or service not known
abr 28 13:48:02 stormy.example.com NetworkManager[933]: INFO:   Closed connection to gateway.
abr 28 13:48:02 stormy.example.com NetworkManager[933]: ERROR:  connect: Connection refused
abr 28 13:48:02 stormy.example.com NetworkManager[933]: INFO:   Could not log out.
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <warn>  [1588092482.0675] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN plugin: failed: connect-failed (1)
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <warn>  [1588092482.0675] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN plugin: failed: connect-failed (1)
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0676] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN plugin: state changed: stopping (5)
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0680] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN plugin: state changed: stopped (6)
abr 28 13:48:02 stormy.example.com NetworkManager[933]: <info>  [1588092482.0709] vpn-connection[0x55d12e7f8360,34638d8f-9b52-4d2d-b4b4-203722702687,"vpn.unimedfortaleza.com.br",0]: VPN service disappeared

Comment 14 Zdenek Pytela 2020-04-29 16:16:39 UTC
Rafael,

in your case the there is a denial on accessing resolv.conf with the user_home_t type that is assigned to files in user's home directory. The path is not logged, but in case it was /etc, you can fix the type with:

ls -lZ /etc/resolv.conf
restorecon -v /etc/resolv.conf


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