Bug 1274018 - selinux blocks apcupsd scrips
Summary: selinux blocks apcupsd scrips
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 22
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 18:03 UTC by Roman Nádhera
Modified: 2016-05-10 17:57 UTC (History)
6 users (show)

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:
Clone Of:
Environment:
Last Closed: 2016-05-10 17:57:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Roman Nádhera 2015-10-21 18:03:32 UTC
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 12:06:34 UTC
commit 4a428cfb9b202d305835636229cca2dd5d93c3ad
Author: Lukas Vrabec <lvrabec>
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 13:56:14 UTC
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 23:22:51 UTC
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 13:20:42 UTC
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-20 03:53:54 UTC
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 17:47:47 UTC
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 06:26:41 UTC
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 12:28:47 UTC
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 18:29:33 UTC
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 17:56:18 UTC
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.