Bug 1306981 - Apache httpd cannot write to var_log_t fcontext /var/log/graphite-web anymore
Summary: Apache httpd cannot write to var_log_t fcontext /var/log/graphite-web anymore
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 23
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-12 10:54 UTC by Piotr Popieluch
Modified: 2016-03-01 14:44 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-03-01 14:44:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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