Bug 1797393

Summary: bind 9.11 responds to RFC 1918 requests with default named configuration
Product: Red Hat Enterprise Linux 8 Reporter: Striker Leggette <striker>
Component: bind-dyndb-ldapAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED MIGRATED QA Contact: ipa-qe <ipa-qe>
Severity: high Docs Contact:
Priority: high    
Version: ---CC: abokovoy, pemensik, pvoborni
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-18 18:01:21 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:
Bug Depends On:    
Bug Blocks: 1780662    

Description Striker Leggette 2020-02-03 02:01:18 UTC
[+] Description of problem:
 - Bind 9.11 with default Named configuration responds to RFC 1918 requests

[+] Version-Release number of selected component (if applicable):
 - bind-9.11.4-9.P2.el7.x86_64

[+] How reproducible:
 - Always

[+] Steps to Reproduce:
1. Install IdM with default Named configuration
2. Send RFC 1918 requests to IdM server

[+] Actual results:
 - Jan 10 09:43:31 serverhostname named-pkcs11[20650]: client @0x7******** 192.168.0.2#42094 (1.0.168.192.in-addr.arpa): RFC 1918 response from Internet for 1.0.168.192.in-addr.arpa

[+] Expected results:
 - RFC 1918 requests are blocked

[+] Additional info:
 - Upstream documentation states that Bind 9.9 and above have empty-zones-enable set to 'yes' by default. With a basic deployment of RHEL 7 minimal with IdM installed, this does not seem to be the case with named-pkcs11.
 - https://www.zytrax.com/books/dns/ch7/queries.html#empty-zones-enable
 - "By default empty-zones-enable is set to yes which means that reverse queries for IPv4 and IPv6 addresses covered by RFCs 1918, 4193, 5737 and 6598 (as well as IPv6 local address (locally assigned), IPv6 link local addresses, the IPv6 loopback address and the IPv6 unknown address) but which is not not covered by a locally defined zone clause will automatically return an NXDOMAIN response from the local name server."

Comment 2 Petr Menšík 2020-03-17 12:51:02 UTC
Bind documentation states it is by default enabled and it is indeed by default enabled. But not a single true or false value is used. Smart detection is in place instead. If both statements empty-zones-enable and disable-empty-zone are missing in configuration, recursion value for given view is used.

But it is enabled only when no global forwarders are used, or when forward policy is set to forward first;
When forward only is configured, all queries are passed to forwarders without any change. That means no authoritative empty zones are created, even when explicitly requested in configuration. It is expected forwarder would handle possible leaks and has empty zones configured itself.

Comment 3 Petr Menšík 2020-03-17 13:43:27 UTC
But above seems to be valid just for normal bind configured by named.conf. When testing it on configured IPA server, my responses were passed to forwarders always, regardless first or only was set in ipa dnsconfig-mod forward-policy.

Tested on:
bind-pkcs11-9.11.4-16.P2.el7.x86_64
bind-dyndb-ldap-11.1-7.el7.x86_64

named-pkcs11 configured via LDAP does not seem to change behaviour even if empty zones are requested in named.conf explicitly. It seems to be feature of bind-dyndb-ldap, implemented in src/empty_zones.c.
My log lists:

ignoring inherited 'forward first;' for zone '.' - did you want 'forward only;' to override automatic empty zone '10.IN-ADDR.ARPA'?

then:
zone 10.IN-ADDR.ARPA/IN: shutting down
shutting down automatic empty zones to enable forwarding for domain '.'

for each private domain. It seems this behaviour is intentional, forwards all domains to forwarder and not to stop any query on the server empty zone itself. Not yet sure whether it can be disabled.

Comment 10 Petr Čech 2021-03-02 20:33:00 UTC
Thank you taking your time and submitting this request for Red Hat Enterprise Linux 7.
Red Hat Enterprise Linux 7 is in Maintenance Support 2 Phase. This bug was reevaluated and will be postponed to RHEL 8.
Thank you for understanding.
Red Hat Enterprise Linux Identity Management Team

Comment 13 RHEL Program Management 2023-09-18 17:56:21 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 14 RHEL Program Management 2023-09-18 18:01:21 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.