Bug 1306981

Summary: Apache httpd cannot write to var_log_t fcontext /var/log/graphite-web anymore
Product: [Fedora] Fedora Reporter: Piotr Popieluch <piotr1212>
Component: selinux-policy-targetedAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: 23CC: dwalsh, lvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-01 14:44:28 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:

Description Piotr Popieluch 2016-02-12 10:54:45 UTC
Description of problem:

Maintainer of graphite-web here.

Somewhere between selinux-policy-3.13.1-152.fc23.noarch and 
selinux-policy-3.13.1-158.4.fc23.noarch Apache HTTPD stopped being able to write to /var/log/graphite-web

/var/log/graphite-web should have fcontext httpd_log_t but has var_log_t.

This should be fixed by adding a policy for /var/log/graphite-web think this would do
serefpolicy-contrib-3.13.1/apache.fc:
/var/log/graphite-web(/.*)? gen_context(system_u:object_r:httpd_log_t,s0)


I just can't wrap my head on why this always worked before. Tested on a f23 vm with 3.13.1-152 to confirm apache httpd can write to var_log_t, updated to 3.13.1-158.4 and it fails...


Could this be added/patched in all active Fedora branches? Or should I add the policy to the graphite-web package?


AVC Denial:
type=AVC msg=audit(1455268959.531:649): avc:  denied  { open } for  pid=10875 comm="httpd" path="/var/log/graphite-web/info.log" dev="dm-1" ino=29006499 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=0

Comment 2 Lukas Vrabec 2016-03-01 12:14:17 UTC
Hello, 

lvrabec:~
$ matchpathcon /var/log/graphite-web
/var/log/graphite-web	system_u:object_r:httpd_log_t:s0
lvrabec:~
$ rpm -q selinux-policy
selinux-policy-3.13.1-158.9.fc23.noarch

Could you update selinux-policy rpm package and try to reproduce it?

Comment 3 Piotr Popieluch 2016-03-01 14:42:30 UTC
Yes, update fixes the issue.