Commit graph

3972 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
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
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
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
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
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
Mark Andrews
f3658af717 chain: use $DEFAULT_ALGORITHM
(cherry picked from commit 3419178bd2)
2022-08-10 17:25:26 +10:00
Mark Andrews
2cbfb22d2f cds: use $DEFAULT_ALGORITHM
(cherry picked from commit 6cf0b73ede)
2022-08-10 17:25:26 +10:00
Mark Andrews
f970186979 autosign: use $DEFAULT_ALGORITHM
(cherry picked from commit bb810b0ac9)
2022-08-10 17:25:26 +10:00
Mark Andrews
c06815dede Use DEFAULT_HMAC for rndc
(cherry picked from commit ce324ae8ba)
2022-08-10 17:25:26 +10:00
Mark Andrews
8fa29c5699 Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py
initalise suffix to ""

    170        r.answer.append(
    171            dns.rrset.from_text(
    172                lqname + suffix, 1, IN, NS, "a.bit.longer.ns.name." + suffix
    173            )
    174        )
    175        r.flags |= dns.flags.AA
           15. Condition endswith(lqname, "icky.ptang.zoop.boing."), taking true branch.
    176    elif endswith(lqname, "icky.ptang.zoop.boing."):
           CID 350722 (#7 of 7): Bad use of null-like value (FORWARD_NULL)
           16. invalid_operation: Invalid operation on null-like value suffix.
    177        r.authority.append(
    178            dns.rrset.from_text(
    179                "icky.ptang.zoop.boing." + suffix,
    180                1,
    181                IN,
    182                SOA,
    183                "ns2." + suffix + " hostmaster.arpa. 2018050100 1 1 1 1",
    184            )
    185        )

(cherry picked from commit eb798d047849aa28b0b0f14379a8e264dfa41c7f)
2022-07-27 14:27:18 -04:00
Evan Hunt
4720f13730 warn about zones with both dnssec-policy and max-zone-ttl
max-zone-ttl in zone/view/options is a no-op if dnssec-policy
is in use, so generate a warning.
2022-07-22 13:13:24 -07:00
Matthijs Mekking
9c872756c3 Test dnssec-policy max-zone-ttl rejects zone with too high TTL
Similar to the 'max-zone-ttl' zone option, the 'dnssec-policy' option
should reject zones with TTLs that are out of range.
2022-07-22 13:13:24 -07:00
Aram Sargsyan
c0bb75e9ef Suppress warning/error comments in dig outputs for "rrsetorder" test
In the CI dig sometimes produces warning/error comments when
communicating with the server, which produces problems when comparing
the outputs.

Here is an example of a dig output with a warning message which
is benign, because dig, after a retry, managed to query the server.

;; communications error to 10.53.0.3#7529: timed out
1.2.3.1
1.2.3.2
1.2.3.3
1.2.3.4

When comparing this to the expected output, which doesn't contain
the comment line (starting with double ';'), the outputs don't match.

Use grep inverse logic to strip the comments from the dig outputs.

(cherry picked from commit a5b2aa7c977b5c40b62698a8f46ffd839b764814)
2022-07-22 09:03:54 +00:00