RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1213740 - pcp: postfix pmda needs access to /var/log/maillog
Summary: pcp: postfix pmda needs access to /var/log/maillog
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.1
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Patrik Kis
URL:
Whiteboard:
Depends On:
Blocks: 1232189
TreeView+ depends on / blocked
 
Reported: 2015-04-21 08:08 UTC by Miloš Prchlík
Modified: 2015-11-19 10:32 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.13.1-35.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1232189 (view as bug list)
Environment:
Last Closed: 2015-11-19 10:32:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2300 0 normal SHIPPED_LIVE selinux-policy bug fix update 2015-11-19 09:55:26 UTC

Description Miloš Prchlík 2015-04-21 08:08:59 UTC
Description of problem:

By reading mail log and running qshape utility produces Postfix PMDA (pmdapostfix) several statistics about postfix queue and mail flow though the system. pmdapostfix is ran by pmcd daemon, and asked to provide metrics. However selinux-policy disallows access to /var/log/maillog and Postfix queue directories. These AVC denials are raised when pmdapostfix is installed and during its usage:

type=AVC msg=audit(1429602211.057:2688): avc:  denied  { read } for  pid=4801 comm="perl" name="maillog" dev="dm-0" ino=68460443 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file
type=AVC msg=audit(1429602211.057:2688): avc:  denied  { open } for  pid=4801 comm="perl" path="/var/log/maillog" dev="dm-0" ino=68460443 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file
type=AVC msg=audit(1429602216.087:2689): avc:  denied  { read } for  pid=4810 comm="postconf" name="main.cf" dev="dm-0" ino=1013985 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_etc_t:s0 tclass=file
type=AVC msg=audit(1429602216.087:2689): avc:  denied  { open } for  pid=4810 comm="postconf" path="/etc/postfix/main.cf" dev="dm-0" ino=1013985 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_etc_t:s0 tclass=file
type=AVC msg=audit(1429602216.087:2690): avc:  denied  { getattr } for  pid=4810 comm="postconf" path="/etc/postfix/main.cf" dev="dm-0" ino=1013985 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_etc_t:s0 tclass=file
type=AVC msg=audit(1429602216.087:2691): avc:  denied  { search } for  pid=4809 comm="qshape" name="postfix" dev="dm-0" ino=68620051 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_spool_t:s0 tclass=dir
type=AVC msg=audit(1429602216.087:2692): avc:  denied  { getattr } for  pid=4809 comm="qshape" path="/var/spool/postfix/maildrop" dev="dm-0" ino=135531171 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 tclass=dir
type=AVC msg=audit(1429602216.137:2693): avc:  denied  { getattr } for  pid=4811 comm="qshape" path="/var/spool/postfix/incoming" dev="dm-0" ino=68620053 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:postfix_spool_t:s0 tclass=dir

As you can see, access to /etc/postfix/main.cf is also necessary - pmcd runs pmdapostfix (as a daemon-ed process) which calls qshape which calls postconf - which reads main.cf - to get e.g. postfix's queue directory.


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

selinux-policy-3.13.1-23.el7.noarch
pcp-3.9.10-8


How reproducible:


Steps to Reproduce:
1. cd /var/lib/pcp/pmdas/postfix
2. ./Install
3. pminfo -f postfix


Actual results:

AVCs raised, and error message "pmdapostfix(27060) Error: open failed (/var/log/maillog): Permission denied" appears in /var/log/pcp/pmcd/postfix.log


Expected results:


Additional info:

Comment 1 Lukas Vrabec 2015-07-23 13:48:48 UTC
commit dead79147829cba0c76720805eb5cfed8ef29856
Author: Lukas Vrabec <lvrabec>
Date:   Thu Jul 23 15:23:36 2015 +0200

    Added Booleans: pcp_read_generic_logs.
    Resolves: #1213740

commit c435cebc1293d3ae0b5acaff1e04909079ee384a
Author: Lukas Vrabec <lvrabec>
Date:   Thu Jul 23 14:37:47 2015 +0200

    Allow pcp_pmcd daemon to read postfix config files.
    Allow pcp_pmcd daemon to search postfix spool dirs.
    Resolves: #1213740

Comment 5 errata-xmlrpc 2015-11-19 10:32:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2300.html


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