Commit graph

10821 commits

Author SHA1 Message Date
Aram Sargsyan
35e37505f0 Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

(cherry picked from commit baa9698c9d)
2022-09-08 09:36:50 +02:00
Matthijs Mekking
d1315d1bc4 Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.

(cherry picked from commit 8b71cbd09c)
2022-09-07 16:26:12 +02:00
Aram Sargsyan
97197ef78e Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.

(cherry picked from commit a5d412d924)
2022-09-06 09:20:55 +00:00
Matthijs Mekking
5c4c32114f Remove implicit inline-signing code
Remove the code that sets implicit inline-signing on zones using
dnssec-policy.

(cherry picked from commit a6b09c9c69186e81a9be54e8b7bb413b1ac4d650)
2022-09-06 09:55:06 +02:00
Matthijs Mekking
c6e2d7d54d Update system tests
Update checkconf and kasp related system tests after requiring
inline-signing.

(cherry picked from commit 8fd75e8a4e1035ce0e81bf47d954a3f5b8a4d571)
2022-09-06 09:55:06 +02:00
Ondřej Surý
a22b0bebc2
Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.

(cherry picked from commit 87de726f5c)
2022-09-05 10:21:28 +02:00
Ondřej Surý
abc0382738
Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.

(cherry picked from commit 10923f9d87)
2022-09-05 10:21:28 +02:00
Evan Hunt
3304c694c8 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.

(cherry picked from commit 66eaf6bb73)
2022-08-31 16:17:56 -07:00
Matthijs Mekking
ba71f93e44 Fix nsec3 system test issues
The wait_for_zone_is_signed function was never called, which could lead
to test failures due to timing issues (where a zone was not fully signed
yet, but the test was trying to verify the zone).

Also add two missing set_nsec3param calls to ensure the ITERATIONS
value is set for these test cases.

(cherry picked from commit 08505651d1d9278314f61076ac7cd119a7790428)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
73431eef8f Add test case for #3486
Add two scenarios where we change the dnssec-policy from using RSASHA1
to something with NSEC3.

The first case should work, as the DS is still in hidden state and we
can basically do anything with DNSSEC.

The second case should fail, because the DS of the predecessor is
published and we can't immediately remove the predecessor DNSKEY. So
in this case we should keep the NSEC chain for a bit longer.

Add two more scenarios where we change the dnssec-policy from using
NSEC3 to something NSEC only. Both should work because there are no
restrictions on using NSEC when it comes to algorithms, but in the
cases where the DS is published we can't bluntly remove the predecessor.

Extend the nsec3 system test by also checking the DNSKEY RRset for the
expected DNSKEY records. This requires some "kasp system"-style setup
for each test (setting key properties and key states). Also move the
dnssec-verify check inside the check_nsec/check_nsec3 functions because
we will have to do that every time.

(cherry picked from commit 21729dd94efc9fc7b7317688dd9ff0ec45181bfd)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
39c0c5022d Wait with NSEC3 during a DNSSEC policy change
When doing a dnssec-policy reconfiguration from a zone with NSEC only
keys to a zone that uses NSEC3, figure out to wait with building the
NSEC3 chain.

Previously, BIND 9 would attempt to sign such a zone, but failed to
do so because the NSEC3 chain conflicted with existing DNSKEY records
in the zone that were not compatible with NSEC3.

There exists logic for detecting such a case in the functions
dnskey_sane() (in lib/dns/zone.c) and check_dnssec() (in
lib/ns/update.c). Both functions look very similar so refactor them
to use the same code and call the new function (called
dns_zone_check_dnskey_nsec3()).

Also update the dns_nsec_nseconly() function to take an additional
parameter 'diff' that, if provided, will be checked whether an
offending NSEC only DNSKEY will be deleted from the zone. If so,
this key will not be considered when checking the zone for NSEC only
DNSKEYs. This is needed to allow a transition from an NSEC zone with
NSEC only DNSKEYs to an NSEC3 zone.

(cherry picked from commit 09a81dc84ce0fee37442f03cdbd63c2398215376)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
b0ae2e4da7 Test checkconf NSEC3 and incompatible algorithm
The check code for this already exists, but was untested.

(cherry picked from commit 1996eaee547e046c8314cdb4a50a02eb9e59ce3f)
2022-08-22 16:37:38 +02:00
Aram Sargsyan
cbb5d4f08b Add pipelined POST requests check in the statschannel system test
Use `nc` to check that multiple POST requests with non-empty HTTP
body are serviced normally by the statistics channel.

(cherry picked from commit bc32885ba981cab6308981936f49ab625af84bf2)
2022-08-19 08:27:24 +00:00
Aram Sargsyan
8e37e5f27f Replace expr commands with $((expression)) shell constucts
Update the "statschannel" system test to use the $((expression))
shell constucts instead of executing the `expr` program.

(cherry picked from commit 8034819b53789b52dd1c80b0256880b506a3f31b)
2022-08-19 08:27:17 +00:00
Petr Menšík
fdd9e39dfe Reset parser before parsing of internal trust anchor
It might be reused if /etc/bind.keys exists, but failed correct parsing.
Release traces of previous parsing attempt of different data.

(cherry picked from commit dc07394c4724c1e1235af85dd8c044af70da93ae)
2022-08-19 15:21:41 +10:00
Artem Boldariev
c8e551299c Modify the doth system test to verify HTTP method usage
Before the commit some checks in the system test would try to verify
that different HTTP methods can be used and are functional. However,
until recently, it was not possible to tell from the output which
method was in fact used, so it turned out that +http-plain-get option
is broken.

This commit add the additional checks to prevent that from happening
in the future.

(cherry picked from commit 625991c810b4086a5fbfc48ecb54974f6b6e3f9a)
2022-08-18 14:25:03 +03:00
Artem Boldariev
3c4d6c4ee0 DIG: mark HTTP GET method in output
This commit makes dig mark the usage of HTTP(S) GET protocol usage in
its output.

(cherry picked from commit f86d8c62b01a7ae88a3543ba85c41834e64d011a)
2022-08-18 14:24:43 +03:00
Artem Boldariev
bd033f92fd DIG: fix handling of +http-plain-{get, post} options
Support for parsing +http-plain-get and +http-plain-post options was
broken. This commit fixes that.

(cherry picked from commit fb135867644684a21d79bc3a5cebe3c83217a221)
2022-08-18 14:24:27 +03:00
Mark Andrews
d19916bde4 Improve awk tests to prevent false negatives
The old code could incorrectly match "INSOA" in the RRSIG rdata
when looking for the SOA record.

(cherry picked from commit 2fc5f6fb2831697c79f75c50a769449ac561aad0)
2022-08-18 13:43:33 +10:00
Mark Andrews
d48f9f84e3
Fix mkeys to work with DEFAULT_ALGORITHM properly
Stop using a RSASHA1 fixed key in ns3's named.conf as the
trusted key and instead compute a broken digest from the
real digest to use in trusted-keys.

(cherry picked from commit be4cbe2b80b52a1f07c438e5ef4f060909ce5251)
2022-08-10 14:06:57 +02:00
Mark Andrews
7e1b02fc4e kasp: stop using RSASHA1 unless necessary for the test
Moves tests from being RSASHA1 based to RSASHA256 based where possible
and split out the remaining RSASHA1 based tests so that they are not
run on OS's that don't support RSASHA1.

(cherry picked from commit db028684e50c58100ea5eeadd5aa340981d83151)
2022-08-10 17:26:29 +10:00
Mark Andrews
62ddc10933 keymgr2kasp: use FIPS compliant algorithms and key sizes
migrate-nomatch-alglen: switched to RSASHA256 instead of RSASHA1
and the key size now changes from 2048 bits to 3072 bits instead
of 1024 bits to 2048 bits.

migrate-nomatch-algnum: switched to RSASHA256 instead of RSASHA1
as initial algorithm and adjusted mininum key size to 2048 bits.

rsasha256: adjusted minimum key size to 2048 bits.

(cherry picked from commit 048b0151665d6111bb61a98b349c510c36ed99f2)
2022-08-10 17:26:29 +10:00
Mark Andrews
945f901722 dnssec/signer/general: Replace RSASHA1 keys with RSASHA512 keys
RSASHA1 is verify only in FIPS mode. Use RSASHA256 instead.

(cherry picked from commit 9c6de6d12dc93e273d5d3545169c3d1f95906ee5)
2022-08-10 17:26:29 +10:00
Mark Andrews
c652c94024 autosign: use FIPS compatible algorithms and key sizes
The nsec-only.example zone was not converted as we use it to
test nsec-only DNSSEC algorithms to nsec3 conversion failure.
The subtest is skipped in fips mode.

Update "checking revoked key with duplicate key ID" test
to use FIPS compatible algorithm.

(cherry picked from commit 99ad09975e07cce3cadf7b6b75cda745e72d87a0)
2022-08-10 17:26:29 +10:00
Mark Andrews
5b3c17f330 rsabigexponent: convert the test from RSASHA1 to RSASHA256
RSASHA1 is not supported on some platforms.

(cherry picked from commit 8c3c0118607f0b2c7b69ce072037634c881794a8)
2022-08-10 17:26:29 +10:00
Mark Andrews
ff17c10d7d notify: remove duplicate test number
(cherry picked from commit d396aa227eed31b604dd517bed14d15b5d233f3b)
2022-08-10 17:26:29 +10:00
Mark Andrews
69a8132d7d mkeys: use $() instead of back quotes
(cherry picked from commit 0e45a2b02cf634119afaf30ba7a4dedad5701949)
2022-08-10 17:26:29 +10:00
Mark Andrews
aff8219f3e Upgrade uses of hmac-sha1 to DEFAULT_HMAC
where the test is not hmac-sha1 specific

(cherry picked from commit c533e8bc5b)
2022-08-10 17:26:29 +10:00
Mark Andrews
c6adebb22c zonechecks: use $DEFAULT_ALGORITHM
(cherry picked from commit 459e6980e5)
2022-08-10 17:25:26 +10:00
Mark Andrews
2e3554fe68 wildcard: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f65c9cf85)
2022-08-10 17:25:26 +10:00
Mark Andrews
23e087131a views: use $DEFAULT_ALGORITHM
(cherry picked from commit 86b29606c3)
2022-08-10 17:25:26 +10:00
Mark Andrews
0b05da9f29 verify: use $DEFAULT_ALGORITHM
(cherry picked from commit 93f7c7cdcd)
2022-08-10 17:25:26 +10:00
Mark Andrews
d3a502f19e upforwd: use $DEFAULT_ALGORITHM
(cherry picked from commit 5585909904)
2022-08-10 17:25:26 +10:00
Mark Andrews
620a16bcff unknown: use $DEFAULT_ALGORITHM
(cherry picked from commit 9970d4317d)
2022-08-10 17:25:26 +10:00
Mark Andrews
6d544309a0 synthfromdnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit 73fd49f8bb)
2022-08-10 17:25:26 +10:00
Mark Andrews
2144febc9d staticstub: use $DEFAULT_ALGORITHM
(cherry picked from commit 32337b9dbf)
2022-08-10 17:25:26 +10:00
Mark Andrews
b380473ca2 smartsign: use $DEFAULT_ALGORITHM
(cherry picked from commit 941b95edb0)
2022-08-10 17:25:26 +10:00
Mark Andrews
bb981e0d68 rpz: use $DEFAULT_ALGORITHM
(cherry picked from commit 1861c3e503)
2022-08-10 17:25:26 +10:00
Mark Andrews
b57457e754 rootkeysentinel: use $DEFAULT_ALGORITHM
(cherry picked from commit b0e1d9b1b3)
2022-08-10 17:25:26 +10:00
Mark Andrews
e756c4c0f3 resolver: use $DEFAULT_ALGORITHM
(cherry picked from commit 05ef8c81dd)
2022-08-10 17:25:26 +10:00
Mark Andrews
62d50d3b23 redirect: use $DEFAULT_ALGORITHM
(cherry picked from commit e0e03602ba)
2022-08-10 17:25:26 +10:00
Mark Andrews
c1f7fd282a pending: use $DEFAULT_ALGORITHM
(cherry picked from commit 6fd50b9fda)
2022-08-10 17:25:26 +10:00
Mark Andrews
c5d5e20c8f nsupdate: use $DEFAULT_ALGORITHM
(cherry picked from commit c2d18567fc)
2022-08-10 17:25:26 +10:00
Mark Andrews
64d2dc174b mkeys: use $DEFAULT_ALGORITHM
(cherry picked from commit 78fa082999)
2022-08-10 17:25:26 +10:00
Mark Andrews
647e4c0d9b mirror: use $DEFAULT_ALGORITHM
(cherry picked from commit ff95bafa39)
2022-08-10 17:25:26 +10:00
Mark Andrews
7c100effd2 metadata: use $DEFAULT_ALGORITHM
(cherry picked from commit 3f1dc83bfb)
2022-08-10 17:25:26 +10:00
Mark Andrews
db5eb04f4a inline: use $DEFAULT_ALGORITHM
(cherry picked from commit e3acddefd1)
2022-08-10 17:25:26 +10:00
Mark Andrews
73f2c501a5 dsdigest: use $DEFAULT_ALGORITHM
(cherry picked from commit 49de14cb9e)
2022-08-10 17:25:26 +10:00
Mark Andrews
5aad0a38e8 dnssec: use $DEFAULT_ALGORITHM
(cherry picked from commit d0b0139c90)
2022-08-10 17:25:26 +10:00
Mark Andrews
642d5963d9 dns64: use $DEFAULT_ALGORITHM
(cherry picked from commit 5cbf1e1598)
2022-08-10 17:25:26 +10:00