Bug 1016411 - SELinux is preventing /usr/libexec/ipsec/pluto from 'write' accesses on the file /etc/ipsec.d/cert8.db.
SELinux is preventing /usr/libexec/ipsec/pluto from 'write' accesses on the f...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: libreswan (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Paul Wouters
Fedora Extras Quality Assurance
abrt_hash:5a0bab2504d68b97e0a2ffbd8cd...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-08 02:27 EDT by Hedayat Vatankhah
Modified: 2014-09-19 06:16 EDT (History)
6 users (show)

See Also:
Fixed In Version: libreswan-3.10-3.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-19 06:12:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hedayat Vatankhah 2013-10-08 02:27:14 EDT
Description of problem:
Trying to connect to an L2TP VPN with ipsec enabled
SELinux is preventing /usr/libexec/ipsec/pluto from 'write' accesses on the file /etc/ipsec.d/cert8.db.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow pluto to have write access on the cert8.db file
Then you need to change the label on /etc/ipsec.d/cert8.db
Do
# semanage fcontext -a -t FILE_TYPE '/etc/ipsec.d/cert8.db'
where FILE_TYPE is one of the following: afs_cache_t, initrc_tmp_t, ipsec_key_file_t, ipsec_tmp_t, ipsec_var_run_t, net_conf_t, puppet_tmp_t, security_t, user_cron_spool_t. 
Then execute: 
restorecon -v '/etc/ipsec.d/cert8.db'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that pluto should be allowed write access on the cert8.db 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 pluto /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ipsec_t:s0
Target Context                unconfined_u:object_r:etc_t:s0
Target Objects                /etc/ipsec.d/cert8.db [ file ]
Source                        pluto
Source Path                   /usr/libexec/ipsec/pluto
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           libreswan-3.5-2.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.8.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.3-201.fc19.x86_64 #1 SMP Thu
                              Oct 3 00:47:03 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-10-07 14:58:35 IRST
Last Seen                     2013-10-07 14:58:51 IRST
Local ID                      9901f76a-96ed-4b78-bb1d-7142bd740ece

Raw Audit Messages
type=AVC msg=audit(1381145331.944:639): avc:  denied  { write } for  pid=26311 comm="pluto" name="cert8.db" dev="sda6" ino=2101181 scontext=system_u:system_r:ipsec_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1381145331.944:639): arch=x86_64 syscall=open success=yes exit=EINTR a0=7fe1f8979210 a1=2 a2=180 a3=0 items=0 ppid=26310 pid=26311 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=pluto exe=/usr/libexec/ipsec/pluto subj=system_u:system_r:ipsec_t:s0 key=(null)

Hash: pluto,ipsec_t,etc_t,file,write

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.3-201.fc19.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-10-09 10:16:21 EDT
Why does libreswan/pluto trying to write into a config directory?
Comment 2 Paul Wouters 2013-10-09 10:27:34 EDT
Right now, nothing, so I'm testing using NSS_Init() versus NSS_InitReadWrite() which seems to work fine,

However, if we have incoming CRLs that are fetched by pluto, (thread, helper process  or other method like cronjob) we need to store those for future use.

I'm not (yet) sure if we can store the CRLs in a different nss db file in /var/lib/pluto/
Comment 3 Daniel Walsh 2013-10-09 10:51:18 EDT
Well I can setup labeling on /etc/ipsec.d for this if necessary, although I would prefer not.
Comment 4 Juan Dayer 2013-10-21 17:45:33 EDT
Description of problem:
Trying to use an ipsec tunnel

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.3-201.fc19.x86_64
type:           libreport
Comment 5 Paul Wouters 2013-10-21 22:08:59 EDT
dwalsh: libreswan 3.6 will open the db files readonly
Comment 6 Daniel Walsh 2013-10-22 13:39:28 EDT
Great.
Comment 7 Fedora Update System 2014-07-11 11:53:25 EDT
libreswan-3.9-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libreswan-3.9-1.fc20
Comment 8 Fedora Update System 2014-07-11 11:54:30 EDT
libreswan-3.9-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libreswan-3.9-1.fc19
Comment 9 Fedora Update System 2014-07-11 22:21:46 EDT
Package libreswan-3.9-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libreswan-3.9-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-8272/libreswan-3.9-1.fc19
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2014-09-09 15:17:46 EDT
libreswan-3.10-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libreswan-3.10-3.fc20
Comment 11 Fedora Update System 2014-09-09 15:30:17 EDT
libreswan-3.10-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/libreswan-3.10-3.fc19
Comment 12 Fedora Update System 2014-09-19 06:12:27 EDT
libreswan-3.10-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 Fedora Update System 2014-09-19 06:16:34 EDT
libreswan-3.10-3.fc19 has been pushed to the Fedora 19 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.