Bug 691723

Summary: SELinux is preventing /usr/libexec/ipsec/pluto from 'read' accesses on the file ipsec.info.
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: avagarwa, dwalsh, mcepl, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:a3f30f5a71683a88d446f9fafd3a67be73d9621eac0bc2c1c19a601d40d1deb1
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-07 13:59:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matěj Cepl 2011-03-29 10:42:00 UTC
SELinux is preventing /usr/libexec/ipsec/pluto from 'read' accesses on the file ipsec.info.

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

If you believe that pluto should be allowed read access on the ipsec.info 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                system_u:object_r:ipsec_mgmt_var_run_t:s0
Target Objects                ipsec.info [ file ]
Source                        pluto
Source Path                   /usr/libexec/ipsec/pluto
Port                          <Neznámé>
Host                          (removed)
Source RPM Packages           openswan-2.6.32-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-6.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38-1.fc15.x86_64 #1 SMP Tue Mar
                              15 05:29:00 UTC 2011 x86_64 x86_64
Alert Count                   3
First Seen                    St 23. březen 2011, 08:35:15 CET
Last Seen                     Čt 24. březen 2011, 12:40:06 CET
Local ID                      30f16c87-55c4-4418-867b-674d239c8051

Raw Audit Messages
type=AVC msg=audit(1300966806.935:89): avc:  denied  { read } for  pid=1542 comm="pluto" name="ipsec.info" dev=tmpfs ino=19292 scontext=system_u:system_r:ipsec_t:s0 tcontext=system_u:object_r:ipsec_mgmt_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1300966806.935:89): arch=x86_64 syscall=open success=no exit=EACCES a0=7f0e6bc27fc5 a1=0 a2=1b6 a3=7fffb9d6c580 items=0 ppid=1538 pid=1542 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=pluto exe=/usr/libexec/ipsec/pluto subj=system_u:system_r:ipsec_t:s0 key=(null)

Hash: pluto,ipsec_t,ipsec_mgmt_var_run_t,file,read

audit2allow

#============= ipsec_t ==============
allow ipsec_t ipsec_mgmt_var_run_t:file read;

audit2allow -R

#============= ipsec_t ==============
allow ipsec_t ipsec_mgmt_var_run_t:file read;

Comment 1 Miroslav Grepl 2011-03-29 12:52:41 UTC
Btw. what does

# ls -Z PATHO/ipsec.info

# matchpathcon PATHO/ipsec.info

Comment 2 Matěj Cepl 2011-03-30 01:18:08 UTC
bradford:~# ls -lZ /var/run/pluto/ipsec.info
-rw-r--r--. root root staff_u:object_r:ipsec_mgmt_var_run_t:s0 /var/run/pluto/ipsec.info
bradford:~# matchpathcon /var/run/pluto/ipsec.info
/var/run/pluto/ipsec.info	system_u:object_r:ipsec_var_run_t:s0
bradford:~#

Comment 3 Miroslav Grepl 2011-03-30 07:10:45 UTC
And

# ls -dZ /var/run/pluto

Comment 4 Matěj Cepl 2011-03-30 10:10:55 UTC
(In reply to comment #3)
> And
> 
> # ls -dZ /var/run/pluto

bradford:~ $ ls -ldZ /var/run/pluto
drwxr-xr-x. root root system_u:object_r:var_run_t:s0   /var/run/pluto
bradford:~ $

Comment 5 Daniel Walsh 2011-03-30 19:40:20 UTC
The problem is /var/run/pluto is mislabeled.  

matchpathcon /var/run/pluto
/var/run/pluto	system_u:object_r:ipsec_var_run_t:s0


How was that directory created?

Comment 6 Matěj Cepl 2011-03-30 23:03:42 UTC
Well, it’s /var/run so I guess it should be generated on startup of ipsec service, right (http://fedoraproject.org/wiki/Features/var-run-tmpfs)?

Adding Avesh to CC list, so that he may hopefully help us.

Comment 7 Miroslav Grepl 2011-10-07 13:59:59 UTC
I am closing this bug. It the problem still persists, please reopen the bug.