Bug 1306981 - Apache httpd cannot write to var_log_t fcontext /var/log/graphite-web anymore
Apache httpd cannot write to var_log_t fcontext /var/log/graphite-web anymore
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Lukas Vrabec
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2016-02-12 05:54 EST by Piotr Popieluch
Modified: 2016-03-01 09:44 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-01 09:44:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Piotr Popieluch 2016-02-12 05:54:45 EST
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
/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 07:14:17 EST

$ matchpathcon /var/log/graphite-web
/var/log/graphite-web	system_u:object_r:httpd_log_t:s0
$ rpm -q selinux-policy

Could you update selinux-policy rpm package and try to reproduce it?
Comment 3 Piotr Popieluch 2016-03-01 09:42:30 EST
Yes, update fixes the issue.

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