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 2013595 - SELinux is preventing /usr/sbin/named from 'name_bind' accesses on the udp_socket port 61000.
Summary: SELinux is preventing /usr/sbin/named from 'name_bind' accesses on the udp_so...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: bind
Version: 9.1
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Menšík
QA Contact: Petr Sklenar
URL:
Whiteboard:
Depends On: 1950714 2013597
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-13 10:18 UTC by Petr Menšík
Modified: 2022-05-17 13:34 UTC (History)
8 users (show)

Fixed In Version: bind-9.16.20-5.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1950714
Environment:
Last Closed: 2022-05-17 13:24:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/centos-stream/rpms bind merge_requests 6 0 None None None 2021-10-14 20:56:19 UTC
Red Hat Issue Tracker RHELPLAN-99621 0 None None None 2021-10-13 10:21:23 UTC
Red Hat Product Errata RHBA-2022:2502 0 None None None 2022-05-17 13:24:18 UTC

Description Petr Menšík 2021-10-13 10:18:42 UTC
+++ This bug was initially created as a clone of Bug #1950714 +++

Description of problem:

This is a duplicate issue of the https://bugzilla.redhat.com/show_bug.cgi?id=1272835. However, this time is on a RHEL 8.3 server. 

Journal is full of those messages:
=======
SELinux is preventing /usr/sbin/named from name_bind access on the udp_socket port 61000. For complete SELinux messages >
AnalyzeThread.run(): Set alarm timeout to 10
SELinux is preventing /usr/sbin/named from name_bind access on the udp_socket port 61000.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow nis to enabled
Then you must tell SELinux about this by enabling the 'nis_enabled' boolean.

Do
setsebool -P nis_enabled 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that named should be allowed name_bind access on the port 61000 udp_socket by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'named' --raw | audit2allow -M my-named
# semodule -X 300 -i my-named.pp
========

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

selinux-policy-targeted-3.14.3-54.el8_3.3.noarch

How reproducible:
Install named with chroot in a RHEL 8.3 systems

--- Additional comment from Zdenek Pytela on 2021-04-19 20:23:41 CEST ---

Switching the component to bind for the maintainer to assess.

--- Additional comment from Zdenek Pytela on 2021-04-19 20:24:50 CEST ---

Seems to be alike to bz 1830625 which is for unbound, not sure if there also was one for bind.

--- Additional comment from Petr Menšík on 2021-10-12 15:53:06 CEST ---

BIND reads ephemeral values from /proc/sys/net/ipv4/ip_local_port_range file during startup. It should adjust its used range during startup, reported in log.

journalctl -xeu named | grep 'port range'
...named[5001]: using default UDP/IPv4 port range: [32768, 60999]

However, bind-chroot package and named-chroot service do not propagate /proc to chroot, so it cannot read used range from the system. It therefore falls back to defaults, which are blocked by selinux.

journalctl -xeu named-chroot | grep 'port range'
named[5126]: using default UDP/IPv6 port range: [1024, 65535]

It would therefore use also blocked ports by SELinux in this case. I think we do not want whole /proc propagated into chroot for security reasons. But I guess this single file should be propagated there.

Possible workarounds are:
- Not using bind-chroot/named-chroot, but using just named.service. With SELinux enforcing mode it should be well protected even without chroot. chroot is a weak protection compared to SELinux.
- mkdir -p /var/named/chroot/proc/sys/net/ipv4; add /proc/sys/net/ipv4/ip_local_port_range to /etc/named-chroot.files before /var/named
- Add into options section in /etc/named.conf:
        use-v4-udp-ports { range 32768 60999; };
        use-v6-udp-ports { range 32768 60999; };

--- Additional comment from Zdenek Pytela on 2021-10-12 18:32:02 CEST ---

(In reply to Petr Menšík from comment #3)
> Possible workarounds are:
> - Not using bind-chroot/named-chroot, but using just named.service. With
> SELinux enforcing mode it should be well protected even without chroot.
> chroot is a weak protection compared to SELinux.
Personally, I'd not stop using chroot, especially for the cases where customers decide not to use SELinux protection. Also note SELinux can be put into permissive mode temporarily.

> - mkdir -p /var/named/chroot/proc/sys/net/ipv4; add
> /proc/sys/net/ipv4/ip_local_port_range to /etc/named-chroot.files before
> /var/named
> - Add into options section in /etc/named.conf:
>         use-v4-udp-ports { range 32768 60999; };
>         use-v6-udp-ports { range 32768 60999; };

Comment 13 errata-xmlrpc 2022-05-17 13:24:10 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 (new packages: bind), 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://access.redhat.com/errata/RHBA-2022:2502


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