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 1778349 - statistics-channel requires SELinux policy update
Summary: statistics-channel requires SELinux policy update
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: bind
Version: 8.4
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: 8.4
Assignee: Petr Menšík
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-30 05:04 UTC by Subhendu Ghosh
Modified: 2020-03-25 13:35 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-25 13:35:15 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Subhendu Ghosh 2019-11-30 05:04:20 UTC
Description of problem:

Adding a port for statics-channel access fails due to absence of SELinux policy

For example: adding the following to named.conf 
====
statistics-channels {
  inet 127.0.0.1 port 8053 allow { 127.0.0.1; };
};
=====

This is an old issue as noted by 
https://www.centos.org/forums/viewtopic.php?t=4890


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


How reproducible:

Always

Steps to Reproduce:
1. Add statistics-channel definition
2.
3.

Actual results:

statistics-channel fails to initialize

Expected results:
statistics-channel is access over socket

Additional info:

Comment 1 Petr Menšík 2020-03-02 09:57:38 UTC
Statistics channel is currently expected to be open only on http port. But it requires setting special Selinux boolean for it.

When port 80 or 8008 would be sufficient, boolean toggle would help:

$ (sudo) setsebool -P named_tcp_bind_http_port=on

statistics-channels {
  inet 127.0.0.1 port 8008 allow { 127.0.0.1; };
};

List of booleans related to bind is described on named_selinux(8) manual page when selinux-policy-doc package is installed.
$ (sudo) yum install selinux-policy-doc
$ man 8 named_selinux

When any custom port is desired, selinux policy has to be modified. First install semanage helper.

$ (sudo) yum install policycoreutils-python-utils

Then add custom port to dns_port_t type, which would allow bind to listen on that port. In this case, setsebool is not necessary.

$ (sudo) semanage port -a -t dns_port_t -p tcp 8053

All current port assigned to a type could be obtained by command

$ semanage port -l | grep dns_port_t

All ports available when named_tcp_bind_http_port=on is set could be obtained by command

$ semanage port -l | grep dns_port_t

Would do you think this is sufficient for listening on custom ports?

Comment 2 Subhendu Ghosh 2020-03-02 15:29:00 UTC
I think this is sufficient. Perhaps any sample config files could include a statistics-channel definition with recommended ports that have pre-aligend SELinux policies.  

The Prometheus exporter for BIND uses 8053 in their example 
https://github.com/prometheus-community/bind_exporter 

I'll post a comment there with a link to this BZ to cover the SELinux config

Comment 3 RHEL Program Management 2020-03-25 13:35:15 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.


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