Bug 971126 - SELinux is preventing /usr/bin/sed from 'write' accesses on the directory /etc/default.
SELinux is preventing /usr/bin/sed from 'write' accesses on the directory /et...
Status: CLOSED DUPLICATE of bug 971125
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:e6582b32edb61d531608db86735...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-05 14:23 EDT by Moez Roy
Modified: 2013-06-07 15:24 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-07 15:24:21 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 Moez Roy 2013-06-05 14:23:38 EDT
Description of problem:
SELinux is preventing /usr/bin/sed from 'write' accesses on the directory /etc/default.

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

If you want to allow sed to have write access on the default directory
Then you need to change the label on /etc/default
Do
# semanage fcontext -a -t FILE_TYPE '/etc/default'
where FILE_TYPE is one of the following: openshift_rw_file_t, openshift_tmp_t, openshift_tmpfs_t, tmp_t, tmpfs_t. 
Then execute: 
restorecon -v '/etc/default'


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

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

Additional Information:
Source Context                unconfined_u:system_r:openshift_app_t:s0-s0:c0.c10
                              23
Target Context                system_u:object_r:etc_t:s0
Target Objects                /etc/default [ dir ]
Source                        sed
Source Path                   /usr/bin/sed
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           sed-4.2.1-10.fc18.x86_64
Target RPM Packages           glibc-common-2.16-31.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.9.4-200.fc18.x86_64 #1 SMP Fri
                              May 24 20:10:49 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-06-05 11:19:00 PDT
Last Seen                     2013-06-05 11:19:00 PDT
Local ID                      194a5c00-dc96-488f-9815-5e9d55333889

Raw Audit Messages
type=AVC msg=audit(1370456340.104:653): avc:  denied  { write } for  pid=5758 comm="sed" name="default" dev="dm-2" ino=2490411 scontext=unconfined_u:system_r:openshift_app_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir


type=AVC msg=audit(1370456340.104:653): avc:  denied  { add_name } for  pid=5758 comm="sed" name="sedQK1KFU" scontext=unconfined_u:system_r:openshift_app_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir


type=AVC msg=audit(1370456340.104:653): avc:  denied  { create } for  pid=5758 comm="sed" name="sedQK1KFU" scontext=unconfined_u:system_r:openshift_app_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file


type=AVC msg=audit(1370456340.104:653): avc:  denied  { write } for  pid=5758 comm="sed" path="/etc/default/sedQK1KFU" dev="dm-2" ino=2496341 scontext=unconfined_u:system_r:openshift_app_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1370456340.104:653): arch=x86_64 syscall=open success=yes exit=EINTR a0=105fd60 a1=c2 a2=180 a3=12573e63892 items=0 ppid=5728 pid=5758 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=10 tty=(none) comm=sed exe=/usr/bin/sed subj=unconfined_u:system_r:openshift_app_t:s0-s0:c0.c1023 key=(null)

Hash: sed,openshift_app_t,etc_t,dir,write

audit2allow

#============= openshift_app_t ==============
allow openshift_app_t etc_t:dir { write add_name };
allow openshift_app_t etc_t:file { write create };

audit2allow -R
require {
	type openshift_app_t;
}

#============= openshift_app_t ==============
files_manage_etc_files(openshift_app_t)
files_rw_etc_dirs(openshift_app_t)


Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.4-200.fc18.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-06-07 15:24:21 EDT

*** This bug has been marked as a duplicate of bug 971125 ***

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