Bug 978601
Summary: | "type=AVC msg=audit(...): avc: denied { create } for pid=... comm="cobblerd" name="buildiso" scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir" when running `cobbler buildiso` | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite 5 | Reporter: | Jan Hutař <jhutar> | ||||
Component: | Provisioning | Assignee: | Stephen Herr <sherr> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jan Hutař <jhutar> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | unspecified | CC: | cperry, rjerrido | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | cobbler-2.0.7-33-sat | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-10-01 21:39:35 UTC | Type: | Bug | ||||
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: | 506485, 924171, 924190 | ||||||
Attachments: |
|
Description
Jan Hutař
2013-06-26 22:22:04 UTC
I've run into this bug as well. What is happening is that since cobblerd is a confined daemon, it can only write to where the SELinux policy allows it. You can work around this using the --tempdir & --iso switches to redirect cobbler to use a directory that it can write to. (after creating it) I've worked around this using the following workflow. Find a file context that cobblerd can write to: # sesearch -A -s cobblerd_t -c file | grep write Select a file type from that output. I used 'cobbler_tmp_t' as it seemed most fitting. Create a directory and update the SELinux policy with the correct file context. # semanage fcontext -a -t cobbler_tmp_t "/srv/cobbler(/.*)?" # mkdir /srv/cobbler/tempdir # restorecon -Rv /srv/cobbler run cobbler # cobbler buildiso --tempdir /srv/cobbler/tempdir/ --iso /srv/cobbler/generated.iso Created attachment 770693 [details]
Proposed patch to /usr/lib/python2.6/site-packages/cobbler/cli.py
The attached patch is an update to /usr/lib/python2.6/site-packages/cobbler/cli.py. It sets an explicit default location for the generated iso (the --iso paramater) and the temporary directory (the --tempdir paramater). It is assumed that the cobbler installation will create those directories (maybe in the %post section of the RPM install) with the correct SELinux contexts.
Thanks for the patch and explanation Rich, that was very helpful. I would rather not require policycoreutils-python in order to get the semanage tool so I think I'll just default the tempdir to /tmp/cobbler/buildiso instead. There were also a couple of references to the cwd on the server-side code that needed to be replaced. So I'm going to do things a little differently, but the same basic idea. Satellite 5.6 has been released. This bug was tracked under the release. This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly before release). Moving to CLOSED CURRENT_RELEASE. Text from Upgrade Erratum follows: Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2013-1395.html |