Bug 1274018 - selinux blocks apcupsd scrips
selinux blocks apcupsd scrips
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
22
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-21 14:03 EDT by Roman Nádhera
Modified: 2016-05-10 13:57 EDT (History)
6 users (show)

See Also:
Fixed In Version: selinux-policy-3.13.1-128.22.fc22 selinux-policy-3.13.1-128.28.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 13:57:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Roman Nádhera 2015-10-21 14:03:32 EDT
Description of problem:

The apcupsd calls scripts onbattery a offbattery, the scripts calls program smtp-cli to send an e-mail about power fail. 

But selinux prevents run the smtp-cli from these scripts 


Version-Release number of selected component (if applicable):
Fedora 22, 
apcupsd 3.14.13 (02 February 2015) redhat


How reproducible:
always

Steps to Reproduce:
1.plug-out the power cord, wait 15 sec, plug in again
  nothing will be sent
2. stop the selinux, or switch it to permissive mode
3. repeat point 1.  The onbattery and offbattery  scripts will send e-mails by smtp-cli

Actual results:
[root@alcyone rna]# cat /var/log/audit/audit.log | grep apcups
type=SERVICE_START msg=audit(1445280990.750:121): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=apcupsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=SERVICE_STOP msg=audit(1445281442.215:197): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=apcupsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=SERVICE_START msg=audit(1445282911.132:129): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=apcupsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=SERVICE_STOP msg=audit(1445283763.104:274): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=apcupsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=SERVICE_START msg=audit(1445297256.369:125): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=apcupsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
type=AVC msg=audit(1445364639.374:7087): avc:  denied  { read } for  pid=19758 comm="smtp-cli" name="urandom" dev="devtmpfs" ino=2057 scontext=system_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:urandom_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1445364639.374:7088): avc:  denied  { open } for  pid=19758 comm="smtp-cli" path="/dev/urandom" dev="devtmpfs" ino=2057 scontext=system_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:urandom_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1445364639.826:7089): avc:  denied  { getattr } for  pid=19758 comm="smtp-cli" path="/dev/urandom" dev="devtmpfs" ino=2057 scontext=system_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:urandom_device_t:s0 tclass=chr_file permissive=1
type=AVC msg=audit(1445364640.201:7090): avc:  denied  { name_connect } for  pid=19758 comm="smtp-cli" dest=25 scontext=system_u:system_r:apcupsd_t:s0 tcontext=system_u:object_r:smtp_port_t:s0 tclass=tcp_socket permissive=1
[root@alcyone rna]#


Expected results:


Additional info:
Comment 1 Lukas Vrabec 2015-11-23 07:06:34 EST
commit 4a428cfb9b202d305835636229cca2dd5d93c3ad
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Mon Nov 23 13:04:41 2015 +0100

    Allow apcupsd sending mails about battery state. BZ(1274018)
Comment 2 Fedora Update System 2015-12-09 08:56:14 EST
selinux-policy-3.13.1-128.22.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-8083abc683
Comment 3 Fedora Update System 2015-12-09 18:22:51 EST
selinux-policy-3.13.1-128.22.fc22 has been pushed to the Fedora 22 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 'dnf --enablerepo=updates-testing update selinux-policy'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-8083abc683
Comment 4 Fedora Update System 2016-01-18 08:20:42 EST
selinux-policy-3.13.1-128.25.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-825869e1a4
Comment 5 Fedora Update System 2016-01-19 22:53:54 EST
selinux-policy-3.13.1-128.25.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-825869e1a4
Comment 6 Fedora Update System 2016-02-15 12:47:47 EST
selinux-policy-3.13.1-128.27.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab
Comment 7 Fedora Update System 2016-02-17 01:26:41 EST
selinux-policy-3.13.1-128.27.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab
Comment 8 Fedora Update System 2016-02-18 07:28:47 EST
selinux-policy-3.13.1-128.28.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab
Comment 9 Fedora Update System 2016-02-21 13:29:33 EST
selinux-policy-3.13.1-128.28.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ce419c9cab
Comment 10 Fedora Update System 2016-05-10 13:56:18 EDT
selinux-policy-3.13.1-128.28.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

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