Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1825663

Summary: Missing selinux rules are preventing pcp-pmda-named from execution of /usr/sbin/rndc
Product: Red Hat Enterprise Linux 8 Reporter: Jan Kurik <jkurik>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED DUPLICATE QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: agerstmayr, jkurik, mgoodwin, nathans, patrickm
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcp-5.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-21 00:02:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kurik 2020-04-19 18:39:25 UTC
Description of problem:
pcp-pmda-named uses /usr/sbin/rndc to get data from named.
Unfortunately when pcp-pmda-named executes /usr/sbin/rndc the execution fails due to a missing SELinux rules allowing the execution of rndc.


Version-Release number of selected component (if applicable):
pcp-5.0.2-5.el8
selinux-policy-3.14.3-41.el8
pcp-selinux-5.0.2-5.el8
pcp-pmda-named-5.0.2-5.el8


How reproducible:
Always

Steps to Reproduce:
1. Install pcp with pcp-pmda-named
2. Install bind, bind-chroot, caching-nameserver, bind-utils packages
3. Configure bind as a caching nameserver
4. Start PCP as well as bind
5. Use i.e. "dig @127.0.0.1" to query DNS

Actual results:
Output of "audit2allow -a" shows:
<stdout>
#============= pcp_pmcd_t ==============
allow pcp_pmcd_t ndc_exec_t:file execute;
allow pcp_pmcd_t ndc_exec_t:file execute_no_trans;
</stdout>

# grep 'type=AVC ' /var/log/audit/audit.log
type=AVC msg=audit(1586150510.119:1454): avc:  denied  { execute_no_trans } for  pid=30473 comm="perl" path="/usr/sbin/rndc" dev="vda1" ino=7449669 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ndc_exec_t:s0 tclass=file permissive=0
type=AVC msg=audit(1586150510.120:1455) : avc:  denied  { execute } for  pid=30473 comm=perl name=rndc dev="vda1" ino=7449669 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ndc_exec_t:s0 tclass=file permissive=0 


Expected results:
Output of "audit2allow -a" should be empty.
No AVC records in "/var/log/audit/audit.log".

Additional info:
This is RHEL-8.2 clone of BZ1749870 and BZ1821122.

Comment 1 Nathan Scott 2020-04-21 00:02:38 UTC
This is resolved upstream by the commit below, will arrive via rebase to pcp-5.1.x - thanks Jan!

commit 57d763755cd081802d7074cb11af41c51173b98c
Author: Nathan Scott <nathans>
Date:   Tue Apr 7 10:15:41 2020 +1000

    selinux: additional policy needs for named PMDA in el7
    
    Resolves Red Hat BZ #1821122.

*** This bug has been marked as a duplicate of bug 1792971 ***

Comment 2 Jan Kurik 2020-06-12 15:52:17 UTC
Verified on pcp-5.1.1-2.el8 build.