View Issue Details

IDProjectCategoryView StatusLast Update
0015313CentOS-7selinux-policypublic2018-09-24 17:34
Reporterweblee 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
PlatformOSOS Version7
Product Version 
Target VersionFixed in Version 
Summary0015313: SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file error.log.
DescriptionDescription of problem:
Trying to get apache to be able to write to a log file in a cakephp install. Permissions all messed up I think
SELinux is preventing /usr/sbin/httpd from 'append' accesses on the file error.log.

***** Plugin httpd_write_content (92.2 confidence) suggests ***************

If you want to allow httpd to have append access on the error.log file
Then you need to change the label on 'error.log'
Do
# semanage fcontext -a -t httpd_sys_rw_content_t 'error.log'
# restorecon -v 'error.log'

***** Plugin catchall_boolean (7.83 confidence) suggests ******************

If you want to allow httpd to unified
Then you must tell SELinux about this by enabling the 'httpd_unified' boolean.

Do
setsebool -P httpd_unified 1

***** Plugin catchall (1.41 confidence) suggests **************************

If you believe that httpd should be allowed append access on the error.log file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'httpd' --raw | audit2allow -M my-httpd
# semodule -i my-httpd.pp

Additional Information:
Source Context system_u:system_r:httpd_t:s0
Target Context unconfined_u:object_r:httpd_sys_content_t:s0
Target Objects error.log [ file ]
Source httpd
Source Path /usr/sbin/httpd
Port <Unknown>
Host (removed)
Source RPM Packages httpd-2.4.6-80.el7.centos.1.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.1-192.el7_5.6.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name (removed)
Platform Linux (removed) 3.10.0-862.11.6.el7.x86_64 #1 SMP
                              Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64
Alert Count 173
First Seen 2018-09-12 19:39:32 EDT
Last Seen 2018-09-23 13:09:19 EDT
Local ID ae7310da-46ad-45be-86fd-ca979ea4a9df

Raw Audit Messages
type=AVC msg=audit(1537722559.188:13545): avc: denied { append } for pid=10333 comm="httpd" name="error.log" dev="dm-0" ino=101537365 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file


type=SYSCALL msg=audit(1537722559.188:13545): arch=x86_64 syscall=open success=no exit=EACCES a0=7ffc207d7ca0 a1=441 a2=1b6 a3=30 items=0 ppid=10317 pid=10333 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: httpd,httpd_t,httpd_sys_content_t,file,append

Version-Release number of selected component:
selinux-policy-3.13.1-192.el7_5.6.noarch
Additional Informationreporter: libreport-2.1.11.1
hashmarkername: setroubleshoot
kernel: 3.10.0-862.11.6.el7.x86_64
reproducible: Not sure how to reproduce the problem
type: libreport
TagsNo tags attached.
abrt_hash0c43e5cc44b71777fcfcc36d2ef88c6f518d6c1f685da7a93ee8952f0e5dfc21
URL

Activities

TrevorH

TrevorH

2018-09-24 17:34

manager   ~0032776

That looks like your error_log is under /var/www/html and not under /var/log/httpd. Don't log to places under your web root.

Issue History

Date Modified Username Field Change
2018-09-24 17:19 weblee New Issue
2018-09-24 17:34 TrevorH Note Added: 0032776