Bug 752425

Summary: SELinux prevents creation of kickstart profile.
Product: [Community] Spacewalk Reporter: Andrey Lyarskiy <andrey.liarskiy>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.5CC: dburkland
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-10 05:55: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:
Embargoed:
Bug Depends On:    
Bug Blocks: 723481    

Description Andrey Lyarskiy 2011-11-09 13:32:07 UTC
Description of problem:
AVC denials while setting up kickstart profile. OS ScientificLinux 6.1 x86_64

Version-Release number of selected component (if applicable):
Spacewalk 1.5

How reproducible:
Always

Steps to Reproduce:
1. Install ScientificLinux 6 x86_64 with SELinux enforcing
2. Install Spacewalk 1.5 from repos
3. Create base channel and kickstart distribution
4. Create kickstart profile
5. Click Finish at Step 3
  
Actual results:
Server 500 Internal Error after clicking Finish

Expected results:
Profile created

Additional info:
Guess there is missing permissions in selinux-policy:
# grep cobblerd /var/log/audit/audit.log | audit2allow -m cobblerd

module cobblerd 1.0;

require {
	type cobblerd_t;
	type var_lib_t;
	class file { read getattr open };
}

#============= cobblerd_t ==============
allow cobblerd_t var_lib_t:file { read getattr open };

Will attach audit.log on request/

Comment 1 Andrey Lyarskiy 2011-11-09 13:38:24 UTC
audit.log:
type=AVC msg=audit(1320843474.395:533): avc:  denied  { getattr } for  pid=7712 comm="cobblerd" path="/var/lib/rhn/kickstarts/wizard/sl6-vm-common-x86_64--1.cfg" dev=dm-0 ino=4205465 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=file
type=SYSCALL msg=audit(1320843474.395:533): arch=c000003e syscall=4 success=no exit=-13 a0=7f4cd00010e0 a1=7f4ce09f3a10 a2=7f4ce09f3a10 a3=762d366c732f6472 items=0 ppid=1 pid=7712 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="cobblerd" exe="/usr/bin/python" subj=system_u:system_r:cobblerd_t:s0 key=(null)

# ls -Z /var/lib/rhn/kickstarts/wizard/
-rw-r--r--. tomcat tomcat system_u:object_r:var_lib_t:s0   sl6-vm-common-x86_64--1.cfg

Comment 2 Michael Mráka 2011-11-09 14:25:39 UTC
It seems to be wrong selinux context, correct context of /var/lib/rhn/kickstarts/* is system_u:object_r:spacewalk_data_t.

What does says: restorecon -vvR  /var/lib/rhn/kickstarts/ ?

Comment 3 Andrey Lyarskiy 2011-11-10 05:55:59 UTC
After restorecon context changed to system_u:object_r:spacewalk_data_t:s0. Not a bug.

Suppose it should be added to HowTo.

Comment 4 Michael Mráka 2011-11-21 10:10:53 UTC
*** Bug 755357 has been marked as a duplicate of this bug. ***