2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00
Commit Graph

6385 Commits

Author SHA1 Message Date
Mark Andrews
fa35c67301 Check invalid alpn empty value 2024-08-01 10:20:55 +10:00
Mark Andrews
a49b2a3568 Check invalid alpn produced due to missing double escapes 2024-08-01 10:20:55 +10:00
Aram Sargsyan
7751c7eca6 Update the chain test
Update the CNAME chain test to correspond to the changed behavior,
because now named returns SERVFAIL when hitting the maximum query
restarts limit (e.g. happening when following a long CNAME chain).

In the current test auth will hit the limit and return partial data
with a SERVFAIL code, while the resolver will return no data with
a SERVFAIL code after auth returns SERVFAIL to it.
2024-07-31 10:54:10 +00:00
Aram Sargsyan
580f872fe1 Test that a long CNAME chain causes SERVFAIL
Also check that the expected partial answer in returned too.
2024-07-31 10:54:10 +00:00
Nicki Křížek
d7ace928b5 Initialize all environment variables when running isctest
Ensure all the variables are initialized when running the main function
of isctest module. This enables proper environment variables during test
script development when only conf.sh is sourced, rather than the script
being executed by the pytest runner.
2024-07-31 10:50:11 +02:00
Tom Krizek
fc84bf80e4 Replace testcrypto.sh invocations in tests
Use the provided environment variables instead.
2024-07-31 10:50:11 +02:00
Tom Krizek
25cb39b7fc Rewrite testcrypto.sh into python
Run the crypto support checks when initializing the isctest package and
save those results in environment variable. This removes the need to
repeatedly check for crypto operation support, as it's not something
that would change at test runtime.
2024-07-31 10:50:10 +02:00
Tom Krizek
8302db407c Move test algorithm configuration to isctest
Instead of invoking get_algorithms.py script repeatedly (which may yield
different results), move the algorithm configuration to an isctest
module. This ensures the variables are consistent across the entire test
run.
2024-07-31 10:50:09 +02:00
Mark Andrews
2e55a2ac69 Test that 'kill -USR1' works 2024-07-31 17:36:39 +10:00
Mark Andrews
5d26b8b71e Test that 'rndc closelogs' works 2024-07-31 17:36:38 +10:00
Mark Andrews
0d69afd764 Disable post zone verification for manykeys
As the expiration time is now+1 the RRSIG records may expire before
the verification step happens.
2024-07-31 03:32:14 +00:00
Matthijs Mekking
e874632488 Fix intermittent test failure dnssec system test
The updatecheck-kskonly.secure zone is being used to test dynamic
updates while the KSK is offline. It ensures that the DNSKEY RRset
will retain the RRSIG record, while the updated data is being signed
with the currently active ZSK.

When walking through ZSK rollovers, ensure that the newest ZSK (ZSK3)
is published before doing the dynamic update, preventing timing
related test failures.

Also fix the test log line ($ZSK_ID3 was not yet created at the time
of logging).
2024-07-30 10:33:45 +00:00
Matthijs Mekking
129973ebb0 No longer update key lifetime if key is retired
The key lifetime should no longer be adjusted if the key is being
retired earlier, for example because a manual rollover was started.

This would falsely be seen as a dnssec-policy lifetime reconfiguration,
and would adjust the retire/removed time again.

This also means we should update the status output, and the next
rollover scheduled is now calculated using (retire-active) instead of
key lifetime.
2024-07-30 10:57:14 +02:00
Matthijs Mekking
2237895bb4 Test updating dnssec-policy key lifetime
Check if the key lifetime is updated in the key files. Make sure the
inactive and removed timing metadata are adjusted accordingly.
2024-07-30 10:57:14 +02:00
Matthijs Mekking
93326e3e18 Move dnssec-policy to kasp-fips.conf.in
All dnssec-policy configurations are here, so why not this one?
2024-07-30 10:57:14 +02:00
Ondřej Surý
4089f4e2c3 Add more tests for adding many RR types to the database
More reclimit tests that test various scenarios adding combinations of
priority and non-priority RR types into the database.
2024-07-01 12:49:02 +02:00
Ondřej Surý
58f660cf2b Make the resolver qtype ANY test order agnostic
Instead of relying on a specific order of the RR types in the databases
pick the first RR type as returned from the cache.
2024-07-01 12:47:30 +02:00
Aram Sargsyan
a2b61c0a65 Test that named checks maximum two keys for SIG(0)-signed messages
Send three updates with three different keys, and expect that one
of them should fail.

Also retain more artifacts for neighboring nsupdate calls.
2024-06-10 17:35:39 +02:00
Aram Sargsyan
c7f79a0353 Add a quota for SIG(0) signature checks
In order to protect from a malicious DNS client that sends many
queries with a SIG(0)-signed message, add a quota of simultaneously
running SIG(0) checks.

This protection can only help when named is using more than one worker
threads. For example, if named is running with the '-n 4' option, and
'sig0checks-quota 2;' is used, then named will make sure to not use
more than 2 workers for the SIG(0) signature checks in parallel, thus
leaving the other workers to serve the remaining clients which do not
use SIG(0)-signed messages.

That limitation is going to change when SIG(0) signature checks are
offloaded to "slow" threads in a future commit.

The 'sig0checks-quota-exempt' ACL option can be used to exempt certain
clients from the quota requirements using their IP or network addresses.

The 'sig0checks-quota-maxwait-ms' option is used to define a maximum
amount of time for named to wait for a quota to appear. If during that
time no new quota becomes available, named will answer to the client
with DNS_R_REFUSED.
2024-06-10 17:33:08 +02:00
Matthijs Mekking
4e46453035 Add new test cases with DNSSEC signing
kasp-max-types-per-name (named2.conf.in):
An unsigned zone with RR type count on a name right below the
configured limit. Then sign the zone using KASP. Adding a RRSIG would
push it over the RR type limit per name. Signing should fail, but
the server should not crash, nor end up in infinite resign-attempt loop.

kasp-max-records-per-type-dnskey (named1.conf.in):
Test with low max-record-per-rrset limit and a DNSSEC policy requiring
more than the limit. Signing should fail.

kasp-max-types-per-name (named1.conf.in):
Each RRSIG(covered type) is counted as an individual RR type. Test the
corner case where a signed zone, which is just below the limit-1,
adds a new type - doing so would trigger signing for the new type and
thus increase the number of "types" by 2, pushing it over the limit
again.
2024-06-10 16:55:11 +02:00
Matthijs Mekking
15ecd2cce6 Check if restart works 2024-06-10 16:55:11 +02:00
Matthijs Mekking
ef9d5cf552 Switch to inline-signing no 2024-06-10 16:55:11 +02:00
Matthijs Mekking
6297e0d7a9 Add test cases that use DNSSEC signing
Add two new masterformat tests that use signing. In the case of
'under-limit-kasp', the signing will keep the number of records in the
RRset under the limit. In the case of 'on-limit-kasp', the signing
will push the number of records in the RRset over the limit, because
of the added RRSIG record.
2024-06-10 16:55:11 +02:00
Petr Špaček
b2afc83040 Remove duplicated empty zone files 2024-06-10 16:55:11 +02:00
Petr Špaček
d85f516f5b masterformat: rename zone names to reflect intended meaning 2024-06-10 16:55:10 +02:00
Petr Špaček
124e220579 Test owner name rename: a b c d e -> <number>-txt 2024-06-10 16:55:10 +02:00
Petr Špaček
c080e510ab Test variable rename i->_attempt 2024-06-10 16:55:10 +02:00
Petr Špaček
35faf81680 Test variable rename a->rrcount 2024-06-10 16:55:10 +02:00
Ondřej Surý
ccde4911ca Add test for not-loading many RRsets per name on a secondary
This tests makes sure the zone with many RRsets per name is not loaded
via XFR on the secondary server.
2024-06-10 16:55:10 +02:00
Ondřej Surý
86aa4674ab Add a test for not caching large number of RRsets
Send a recursive query for a large number of RRsets, which should
fail when using the default max-types-per-name setting of 100, but
succeed when the cap is disabled.
2024-06-10 16:55:10 +02:00
Evan Hunt
3dc4388f4a Add a test for not caching large RRset
Send a recursive query for a large (2500 record) RRset, which should
fail when using the default max-records-per-type setting of 100, but
succeed when the cap is disabled.
2024-06-10 16:55:09 +02:00
Ondřej Surý
5d4e57b914 Add test for not-loading and not-transfering huge RRSets
Add two new masterformat tests - the 'huge' zone fits within the ns1
limit and loads on the primary ns1 server, but must not transfer to the
ns2 secondary, and the 'uber' zone should not even load on the primary
ns1 server.
2024-06-10 16:55:09 +02:00
Ondřej Surý
32af7299eb Add a limit to the number of RRs in RRSets
Previously, the number of RRs in the RRSets were internally unlimited.
As the data structure that holds the RRs is just a linked list, and
there are places where we just walk through all of the RRs, adding an
RRSet with huge number of RRs inside would slow down processing of said
RRSets.

Add a configurable limit to cap the number of the RRs in a single RRSet.
This is enforced at the database (rbtdb, qpzone, qpcache) level and
configured with new max-records-per-type configuration option that can
be configured globally, per-view and per-zone.
2024-06-10 16:55:07 +02:00
Evan Hunt
c3d3d12911 change allow-transfer default to "none"
Changed the default value for 'allow-transfer' to 'none'; zone
transfers now require explicit authorization.

Updated all system tests to specify an allow-transfer ACL when needed.

Revised the ARM to specify that the default is 'none'.
2024-06-05 10:50:06 -07:00
Mark Andrews
07cdf3e945 Check that no primaries is logged with -4 or -6
When in -4 mode check that "IPv6 disabled and no IPv4 primaries"
is logged and when in -6 mode check that "IPv4 disabled and no IPv6
primaries" is logged.
2024-06-03 18:34:31 +10:00
Štěpán Balážik
9584a7bdcd Add a helper for uncompressed length of dnspython's dns.name.Name
This is useful for generating using hypothesis but also for other
cases.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
bb1e5cfa09 Move hypothesis strategies to isctest for later reuse
`isctest.hypothesis` seems to be a nice place to have these.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
f55cacbbfd Disable deadlines for hypothesis tests when running in CI
The times it takes to run tests CI vary significantly enough
that it makes hypothesis test reach their deadlines and fail randomly
marking the tests as flaky.

This commit disables the deadlines when running in CI.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
9943172566 Test nested wildcard special case in the respective system test
See final remark of RFC 4592 2.2.1. for details.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
d0cfbd398e Expand the wildcard system test with wider use of hypothesis
The queries are now generated more generally (i. e. they have
multiple labels, etc.).
2024-05-28 12:12:16 +00:00
Štěpán Balážik
5d738cd9ed Add hypothesis strategies for generating DNS names and company
The most important being `dns_names` that generates dns.name.Name
objects based on given paramaters.

No guarantees are given when it comes the uniformity of generated
samples, however it plays nicely with the hypothesis' shrinking
algorithm.

Once we use hypothesis more widely (in at least one more test) this file
should be moved for it to be reused easily.
2024-05-28 12:12:16 +00:00
Štěpán Balážik
e7d46ad8ba Extend isctest package with more utility functions
Check for more rcodes and various properties needed in the wildcard
test. Add a `name` module for various dns.name.Name operations (with
`prepend_label` function only now).

Expose `timeout` as a parameter of `query.tcp`/`query.udp`.
2024-05-28 12:12:16 +00:00
Mark Andrews
6e9ed4983e add test cases for several FORMERR code paths:
- duplicated question
  - duplicated answer
  - qtype as an answer
  - two question types
  - question names
  - nsec3 bad owner name
  - short record
  - short question
  - mismatching question class
  - bad record owner name
  - mismatched class in record
  - mismatched KEY class
  - OPT wrong owner name
  - invalid RRSIG "covers" type
  - UPDATE malformed delete type
  - TSIG wrong class
  - TSIG not the last record
2024-05-17 13:39:22 +10:00
Mark Andrews
dd13f41ae1 Don't sign non-apex DNSKEY records
DNSKEY can only be validated if it is signed by itself.  Stop
attempting to sign non apex DNSKEY RRsets.
2024-05-16 10:28:27 +10:00
Mark Andrews
315ad2df7a Remove invalid DNSKEY RRset from zone 2024-05-16 10:28:27 +10:00
Mark Andrews
122111f75e Add regression test data for [GL #4517]
An obscured DNSKEY RRset at a delegation was incorrectly added to
the NSEC/NSEC3 type bit map leading to zone verification failures.
This adds such a RRset to the test zone.
2024-05-16 10:28:27 +10:00
Michal Nowak
e9e8753306 Rewrite include-multiplecfg system test to pytest 2024-05-14 11:45:55 +02:00
Michal Nowak
77a42f8875 Use isctest.run.cmd() helper function in tests 2024-05-14 11:45:55 +02:00
Tom Krizek
a9f3fb3db5 Add isctest.run.cmd() helper function 2024-05-14 11:45:55 +02:00
Nicki Křížek
faeec83b64 Ensure OPENSSL_CONF is a file if it exists
Prevent unexpected behavior in cases where the OPENSSL_CONF path would
exist, but it wouldn't point to a file.
2024-05-09 17:08:11 +02:00