Bug 450373

Summary: SELinux preventing cyphesis from creating log file
Product: [Fedora] Fedora Reporter: Alexey Torkhov <atorkhov>
Component: cyphesisAssignee: Wart <wart>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-21 08:22:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexey Torkhov 2008-06-07 06:57:20 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Alexey Torkhov 2008-06-07 07:04:29 UTC
Sorry, submitted too early. So,

SELinux is preventing cyphesis from creating log file

Description of problem:
I see following avc deny when starting cyphesis
host=nat.tortilla.ru type=AVC msg=audit(1212820072.648:139): avc: denied {
append } for pid=4309 comm="cyphesis" name="cyphesis_event.log" dev=sdd3
ino=2588853 scontext=unconfined_u:system_r:cyphesis_t:s0
tcontext=system_u:object_r:var_log_t:s0 tclass=file host=nat.tortilla.ru
type=SYSCALL msg=audit(1212820072.648:139): arch=40000003 syscall=5 success=no
exit=-13 a0=9ea4fac a1=8441 a2=1b6 a3=440 items=0 ppid=4308 pid=4309 auid=502
uid=493 gid=487 euid=493 suid=493 fsuid=493 egid=487 sgid=487 fsgid=487
tty=(none) ses=1 comm="cyphesis" exe="/usr/bin/cyphesis"
subj=unconfined_u:system_r:cyphesis_t:s0 key=(null) 

Version-Release number of selected component (if applicable):
cyphesis-0.5.15-8.fc9.i386

How reproducible:
Always.

Additional info:
In previous cyphesis-selinux package cyphesis was allowed to var_log_t, but in
new policy cyphesis_log_t was introduced. But gen_context on /var/log/cyphesis
wasn't added. So, I'm guessing, it should be added there.

Comment 2 Alexey Torkhov 2008-06-07 07:06:06 UTC
P.S. As a workaround, I've made
chcon -t cyphesis_log_t /var/log/cyphesis /var/log/cyphesis/cyphesis_event.log
after this, all seems to work fine.

Comment 3 Wart 2008-06-09 00:32:17 UTC
I'm unable to reproduce this.  On my F9-i386 system, /var/log/cyphesis has:

# ls -Zd /var/log/cyphesis
drwxr-xr-x  cyphesis cyphesis system_u:object_r:var_log_t:s0   /var/log/cyphesis

...and the log file has:

# ls -Z /var/log/cyphesis
-rw-r--r--  cyphesis cyphesis unconfined_u:object_r:cyphesis_log_t:s0
cyphesis_event.log

cyphesis has no trouble creating and writing to the log file at startup when
selinux is in Enforcing mode.  What version of selinux-policy-targeted are you
using?

# rpm -q selinux-policy-targeted
selinux-policy-targeted-3.3.1-42.fc9.noarch

Comment 4 Alexey Torkhov 2008-06-09 07:36:11 UTC
In my system it is newer:
selinux-policy-targeted-3.3.1-55.fc9.noarch

Comment 5 Wart 2008-06-15 19:50:32 UTC
I still can't reproduce this with a clean F-9 install+updates and
selinux-policy-targeted-3.3.1-64.fc9.noarch

Is it possible that you have a leftover cyphesis-selinux package installed?  Or
maybe the cyphesis-selinux policies are still loaded and you need a reboot to
unload them?

Comment 6 Alexey Torkhov 2008-06-16 07:12:39 UTC
Oh. Right, to be sure, I made policy reload and reinstalled the package. Now,
cyphesis is able to create log labeled cyphesis_log_t and write to it. Other
cyphesis selinux bug distracted me and I misreaded your comment #3, sorry.

In my system, log had var_log_t after update. In new installations all is
working fine.

But I think that file context for /var/log/cyphesis/cyphesis_event.log should be
added into selinux policy - it will allow to do restorecon on update and will
preserve label if user decides to do relabel himself.

Comment 7 Alexey Torkhov 2008-07-04 17:03:30 UTC
Sometimes, for unknown reason, logfile selunux type got reset to standard
var_log_t. May be something is making restorecon on it?

Anyway, policy should be updated.

Comment 8 Fedora Update System 2008-11-17 18:16:58 UTC
cyphesis-0.5.17-1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/cyphesis-0.5.17-1.fc10

Comment 9 Fedora Update System 2008-11-22 16:47:38 UTC
cyphesis-0.5.17-1.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cyphesis'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/f10/FEDORA-2008-9949

Comment 10 Fedora Update System 2008-12-21 08:22:04 UTC
cyphesis-0.5.17-1.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.