Bug 1589534 - SELinux is preventing charon-nm from using the 'dac_override' capabilities.
Summary: SELinux is preventing charon-nm from using the 'dac_override' capabilities.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 28
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:9914a232222c5303b157d47be51...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-10 14:40 UTC by imgx64+bzrh
Modified: 2018-07-29 03:21 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.14.1-36.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-29 03:21:32 UTC
Type: ---


Attachments (Terms of Use)

Description imgx64+bzrh 2018-06-10 14:40:22 UTC
Description of problem:
1- Install NetworkManager-strongswan-gnome
2- Copy IPsec certificates and private key to ~/.cert/
3- In NetworkManager, add new VPN of type "IPsec/IKEv2 (strongswan)", and select the files copied earlier
4- Try to start the VPN
SELinux is preventing charon-nm from using the 'dac_override' capabilities.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
Then turn on full auditing to get path information about the offending file and generate the error again.
Do

Turn on full auditing
# auditctl -w /etc/shadow -p w
Try to recreate AVC. Then execute
# ausearch -m avc -ts recent
If you see PATH record check ownership/permissions on file, and fix it,
otherwise report as a bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that charon-nm should have the dac_override capability 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 'charon-nm' --raw | audit2allow -M my-charonnm
# semodule -X 300 -i my-charonnm.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                system_u:system_r:ipsec_t:s0
Target Objects                Unknown [ capability ]
Source                        charon-nm
Source Path                   charon-nm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-32.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.16.14-300.fc28.x86_64 #1 SMP Tue
                              Jun 5 16:23:44 UTC 2018 x86_64 x86_64
Alert Count                   23
First Seen                    2018-06-09 18:14:03 +03
Last Seen                     2018-06-10 17:34:08 +03
Local ID                      afde8813-3cc5-4e28-ab49-c1ea0393d94b

Raw Audit Messages
type=AVC msg=audit(1528641248.193:238): avc:  denied  { dac_override } for  pid=2405 comm="charon-nm" capability=1  scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:system_r:ipsec_t:s0 tclass=capability permissive=1


Hash: charon-nm,ipsec_t,ipsec_t,capability,dac_override

Version-Release number of selected component:
selinux-policy-3.14.1-32.fc28.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.14-300.fc28.x86_64
type:           libreport

Comment 1 imgx64+bzrh 2018-06-10 14:44:26 UTC
Additional info: I'm trying to setup Algo VPN (https://github.com/trailofbits/algo/), in case that's relevant.
Also, enabling SELinux permissive mode makes the VPN work.

Comment 2 imgx64+bzrh 2018-06-11 12:17:28 UTC
More logs:
$ ls -l ~/.cert/*
-rw-rw-r--. 1 user user 2555 Jun  9 16:05 /home/user/.cert/cert.pem
-rw-rw-r--. 1 user user  241 Jun  9 16:05 /home/user/.cert/privkey.pem
-rw-rw-r--. 1 user user  648 Jun  9 16:04 /home/user/.cert/cacert.pem

$ sudo auditctl -w /etc/shadow -p w

$ nmcli connection up VPN1
Error: Connection activation failed: The VPN service failed to start

$ sudo ausearch -m avc -ts recent
----
time->Mon Jun 11 14:54:07 2018
type=AVC msg=audit(1528718047.621:261): avc:  denied  { dac_override } for  pid=2931 comm="charon-nm" capability=1  scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:system_r:ipsec_t:s0 tclass=capability permissive=0
----
time->Mon Jun 11 14:54:07 2018
type=AVC msg=audit(1528718047.625:262): avc:  denied  { dac_override } for  pid=2931 comm="charon-nm" capability=1  scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:system_r:ipsec_t:s0 tclass=capability permissive=0

$ journalctl --this-boot | grep 'charon-nm\|NetworkManager'
[snip]
Jun 11 14:54:07 comp1 NetworkManager[915]: <info>  [1528718047.0957] audit: op="connection-activate" uuid="6a52dcf1-8a56-489f-b8f7-1b1c80eba76d" name="VPN1" pid=2887 uid=1000 result="success"
Jun 11 14:54:07 comp1 NetworkManager[915]: <info>  [1528718047.4122] vpn-connection[0x55ddb9144110,6a52dcf1-8a56-489f-b8f7-1b1c80eba76d,"VPN1",0]: Started the VPN service, PID 2931
Jun 11 14:54:07 comp1 charon-nm[2931]: 00[DMN] Starting charon NetworkManager backend (strongSwan 5.6.2)
Jun 11 14:54:07 comp1 charon-nm[2931]: 00[LIB] openssl FIPS mode(2) - enabled
Jun 11 14:54:07 comp1 NetworkManager[915]: <info>  [1528718047.6156] vpn-connection[0x55ddb9144110,6a52dcf1-8a56-489f-b8f7-1b1c80eba76d,"VPN1",0]: Saw the service appear; activating connection
Jun 11 14:54:07 comp1 charon-nm[2931]: 00[LIB] loaded plugins: nm-backend charon-nm pkcs11 tpm aesni aes des rc2 sha2 sha1 md4 md5 mgf1 random nonce x509 revocation constraints pkcs1 pkcs7 pkcs8 sshkey pem openssl gcrypt fips-prf gmp curve25519 chapoly xcbc cmac hmac ctr ccm gcm curl kernel-netlink socket-default eap-identity eap-md5 eap-gtc eap-mschapv2 eap-tls eap-ttls eap-peap
Jun 11 14:54:07 comp1 charon-nm[2931]: 00[JOB] spawning 16 worker threads
Jun 11 14:54:07 comp1 audit[2931]: AVC avc:  denied  { dac_override } for  pid=2931 comm="charon-nm" capability=1  scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:system_r:ipsec_t:s0 tclass=capability permissive=0
Jun 11 14:54:07 comp1 charon-nm[2931]: 05[LIB]   opening '/home/user/.cert/privkey.pem' failed: Permission denied
Jun 11 14:54:07 comp1 charon-nm[2931]: 05[LIB] building CRED_PRIVATE_KEY - RSA failed, tried 9 builders
Jun 11 14:54:07 comp1 NetworkManager[915]: <info>  [1528718047.6255] vpn-connection[0x55ddb9144110,6a52dcf1-8a56-489f-b8f7-1b1c80eba76d,"VPN1",0]: VPN connection: (ConnectInteractive) reply received
Jun 11 14:54:07 comp1 charon-nm[2931]: 05[CFG] received initiate for NetworkManager connection VPN1
Jun 11 14:54:07 comp1 audit[2931]: AVC avc:  denied  { dac_override } for  pid=2931 comm="charon-nm" capability=1  scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:system_r:ipsec_t:s0 tclass=capability permissive=0
Jun 11 14:54:07 comp1 charon-nm[2931]: 05[LIB]   opening '/home/user/.cert/cacert.pem' failed: Permission denied
Jun 11 14:54:07 comp1 charon-nm[2931]: 05[LIB] building CRED_CERTIFICATE - X509 failed, tried 6 builders
Jun 11 14:54:07 comp1 NetworkManager[915]: <warn>  [1528718047.6272] vpn-connection[0x55ddb9144110,6a52dcf1-8a56-489f-b8f7-1b1c80eba76d,"VPN1",0]: VPN connection: failed to connect: 'Loading gateway certificate failed.'
Jun 11 14:54:07 comp1 NetworkManager[915]: <info>  [1528718047.6285] vpn-connection[0x55ddb9144110,6a52dcf1-8a56-489f-b8f7-1b1c80eba76d,"VPN1",0]: VPN plugin: state changed: stopped (6)
Jun 11 14:54:11 comp1 setroubleshoot[2958]: SELinux is preventing charon-nm from using the dac_override capability. For complete SELinux messages run: sealert -l afde8813-3cc5-4e28-ab49-c1ea0393d94b
Jun 11 14:54:11 comp1 python3[2958]: SELinux is preventing charon-nm from using the dac_override capability.
                                           If you believe that charon-nm should have the dac_override capability by default.
                                           # ausearch -c 'charon-nm' --raw | audit2allow -M my-charonnm
Jun 11 14:54:11 comp1 setroubleshoot[2958]: SELinux is preventing charon-nm from using the dac_override capability. For complete SELinux messages run: sealert -l afde8813-3cc5-4e28-ab49-c1ea0393d94b
Jun 11 14:54:11 comp1 python3[2958]: SELinux is preventing charon-nm from using the dac_override capability.
                                           If you believe that charon-nm should have the dac_override capability by default.
                                           # ausearch -c 'charon-nm' --raw | audit2allow -M my-charonnm

Comment 3 Fedora Update System 2018-07-25 22:27:00 UTC
selinux-policy-3.14.1-36.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1050fb248b

Comment 4 Fedora Update System 2018-07-26 16:29:34 UTC
selinux-policy-3.14.1-36.fc28 has been pushed to the Fedora 28 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-1050fb248b

Comment 5 Fedora Update System 2018-07-29 03:21:32 UTC
selinux-policy-3.14.1-36.fc28 has been pushed to the Fedora 28 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.