Bug 701042

Summary: SELinux is preventing /bin/bash from 'append' accesses on the file ipsec.info.
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dwalsh, mcepl, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:8619d0d64042c6ce64d3a0045768b83e143d362c47a42bdb3d8f4aa8f2aa87a3
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-02 14:48:29 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-04-30 15:03:44 UTC
SELinux is preventing /bin/bash from 'append' accesses on the file ipsec.info.
Running service ipsec restart
*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that bash should be allowed append 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 _startnetkey /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                staff_u:system_r:ipsec_mgmt_t:s0
Target Context                staff_u:object_r:var_run_t:s0
Target Objects                ipsec.info [ file ]
Source                        _startnetkey
Source Path                   /bin/bash
Port                          <Neznámé>
Host                          (removed)
Source RPM Packages           bash-4.2.8-2.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-18.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.4-20.fc15.x86_64 #1 SMP Thu
                              Apr 28 23:32:48 UTC 2011 x86_64 x86_64
Alert Count                   4
First Seen                    So 30. duben 2011, 17:02:48 CEST
Last Seen                     So 30. duben 2011, 17:02:48 CEST
Local ID                      7455bf93-4107-4c2a-8d3e-255916fd14c5

Raw Audit Messages
type=AVC msg=audit(1304175768.468:870): avc:  denied  { append } for  pid=26209 comm="auto" name="ipsec.info" dev=tmpfs ino=271337 scontext=staff_u:system_r:ipsec_mgmt_t:s0 tcontext=staff_u:object_r:var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1304175768.468:870): arch=x86_64 syscall=open success=no exit=EACCES a0=2733440 a1=401 a2=1b6 a3=fffffffffffffff0 items=0 ppid=26179 pid=26209 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=84 comm=auto exe=/bin/bash subj=staff_u:system_r:ipsec_mgmt_t:s0 key=(null)

Hash: _startnetkey,ipsec_mgmt_t,var_run_t,file,append

audit2allow

#============= ipsec_mgmt_t ==============
allow ipsec_mgmt_t var_run_t:file append;

audit2allow -R

#============= ipsec_mgmt_t ==============
allow ipsec_mgmt_t var_run_t:file append;

Comment 1 Miroslav Grepl 2011-05-02 07:55:47 UTC
It looks like you have mislabeled /var/run/pluto directory.

# ls -dZ /var/run/pluto

Comment 2 Daniel Walsh 2011-05-02 14:48:29 UTC
restorecon -R -v /var/run/pluto

Any idea how it got mislabeled?

Did you create it yourself.

Comment 3 Matěj Cepl 2011-05-02 20:45:31 UTC
bradford:bugzilla-triage (next) $ sudo ls -dZ /var/run/pluto/
drwxr-xr-x. root root system_u:object_r:var_run_t:s0   /var/run/pluto/
bradford:bugzilla-triage (next) $ 

bradford:bugzilla-triage (next) $ sudo restorecon -v -R /var/run/
/sbin/restorecon reset /var/run/libvirt/qemu context system_u:object_r:virt_var_run_t:s0->system_u:object_r:qemu_var_run_t:s0
/sbin/restorecon reset /var/run/libvirt/network context system_u:object_r:virt_var_run_t:s0->system_u:object_r:dnsmasq_var_run_t:s0
/sbin/restorecon reset /var/run/pluto context system_u:object_r:var_run_t:s0->system_u:object_r:ipsec_var_run_t:s0
/sbin/restorecon reset /var/run/pluto/openswan-resolv-conf-backup context staff_u:object_r:ipsec_mgmt_var_run_t:s0->system_u:object_r:ipsec_var_run_t:s0
/sbin/restorecon reset /var/run/pluto/ipsec.info context staff_u:object_r:ipsec_mgmt_var_run_t:s0->system_u:object_r:ipsec_var_run_t:s0
/sbin/restorecon reset /var/run/pluto/ipsec_setup.pid context staff_u:object_r:ipsec_mgmt_var_run_t:s0->system_u:object_r:ipsec_var_run_t:s0
bradford:bugzilla-triage (next) $ 

(In reply to comment #2)
> restorecon -R -v /var/run/pluto
> 
> Any idea how it got mislabeled?
> 
> Did you create it yourself.

Ask Lennart http://fedoraproject.org/wiki/Features/var-run-tmpfs