Commit graph

13170 commits

Author SHA1 Message Date
Mark Andrews
f99d7f4217
Check notify with bad notify source address and tsig
named was asserting when the notify source address was not available
and TSIG was being used.  Check this scenario by adding a nameserver
to the zone which is configured to uses a non-existent source address
and a blackholed destination address and a TSIG using a server clause
for that destination address.
2026-02-19 13:44:33 +01:00
Mark Andrews
757e503536 Return FORMERR for ECS family 0
RFC 7871 only defines family 1 (IPv4) and 2 (IPv6). Additionally
it requires FORMERR to be returned for all unknown families.
2026-02-19 13:17:19 +11:00
Mark Andrews
ea32141e48 Use shell function 'check_count' to check counts 2026-02-17 13:17:43 +11:00
Mark Andrews
591096f131 Test forward query/response counts 2026-02-17 13:17:43 +11:00
Mark Andrews
77278beaf3 Add missed ret!=0 checks 2026-02-17 13:17:38 +11:00
Matthijs Mekking
4a22921936 List 'rndc dnssec' arguments in alphabetic order
Same as rndc usage orderning,
2026-02-16 16:28:47 +00:00
Matthijs Mekking
0dd61d8773 Add rndc dnssec -step command to usage
The `-step` argument was erroneously omitted from the usage output.
2026-02-16 16:28:47 +00:00
Michał Kępień
3954025218
Use isctest.asyncserver in the "pipelined" test
Replace the custom DNS server used in the "pipelined" system test with
new code based on the isctest.asyncserver module.
2026-02-13 14:27:10 +01:00
Michał Kępień
10a2fc7f1f
Implement a response handler that forwards queries
Add a new response handler, ForwarderHandler, which enables forwarding
all queries to another DNS server.  To simplify implementation, always
forward queries to the target server via UDP, even if they are
originally received using a different transport protocol.
2026-02-13 14:27:10 +01:00
Michał Kępień
d3d9d166ed
Log the server socket receiving each query
Extend AsyncDnsServer._log_query() and AsyncDnsServer._log_response() so
that they also log the <address, port> tuple for the socket on which a
given query was received on.  Minimize the signatures of those methods
by taking advantage of all the information contained in the QueryContext
instances passed to them.
2026-02-13 14:27:10 +01:00
Michał Kępień
94a4793596
Store server socket information in QueryContext
Extend the QueryContext class with a field holding the <address, port>
tuple for the socket on which a given query was received.  This will
enable query handlers to act upon that information in arbitrary ways.
2026-02-13 14:27:10 +01:00
Colin Vidal
4f8788310b system test for the ADB fetch loop detection
Add a system test which implement the scenario described in the previous
commit "relaxes fetch loop detection".
2026-02-11 14:33:22 +01:00
Colin Vidal
e5f963262a extends named -T so ADB settings can be tweaked
ADB entry window and ADB min cache time can be tweaked using `named -T
adbentrywindow=<unsigned int>` and `named -T adbmincache=<unsigned
int>`.

While those values doesn't needs to be exposed to the operator, this can
be needed to be able to system test ADB behaviors without having to wait
as long as those values are by default.
2026-02-11 13:56:03 +01:00
Colin Vidal
e62cafd3c7 rename fetch response db field to cache
As the `dns_fetchresponse_t` `db` field can only be attached to the
resolver cache database, rename it into `cache` to avoid ambiguities.
2026-02-10 08:50:16 +01:00
Mark Andrews
879d2ed480 Document that query options are order sensitive 2026-02-10 09:00:48 +11:00
Matthijs Mekking
a5f934b7a1 Minor logging improvements for key lifetime 2026-02-06 15:06:47 +00:00
Michal Nowak
bf0df8b7f4
Rewrite xfer system test to pytest 2026-02-06 14:34:53 +01:00
Nicki Křížek
e4abb5bd07 Allow re-run of kasp test case on all FreeBSDs
Previously, the issue when the kasp.test_kasp_case[secondary.kasp] fails
due to a timeout has been only ocassionally observed on FreeBSD 13
in our CI. It seems to have come back on FreeBSD 15.
2026-02-06 13:22:11 +01:00
Nicki Křížek
d237048de2 Improve logging for isctest.run.retry_with_timeout
Add more debug messages around the retry function to facilitate
debugging in case of issues.
2026-02-06 13:22:11 +01:00
Mark Andrews
8f413fd589 Fix timing in tests_nsec3_change.py
The zone file is updated too soon causing the reload to fail.
Add a 1 second sleep to ensure the modification time has changed.
2026-02-06 09:39:15 +11:00
Matthijs Mekking
ce1d68cbc5
Add a regression test for the BRID/HHIT crash
Add two short records to example.com.db that cause assertion failures
when converted to wire form.

The checks added to tests.sh are technically not required: the relevant
assertion failures are already hit when the zone is transferred out of
ns1.

Update the relevant unit tests with 1-byte records.

Co-authored-by: Mark Andrews <marka@isc.org>
2026-02-05 18:21:52 +01:00
Aydın Mercan
5ae9b4d14c
cleanup unused header in isc/md.h
Use `isc/crypto.h` whenever needed instead.
2026-02-02 11:50:14 +03:00
Colin Vidal
d0d4b40b62 dns_rdataset_* const parameters
dns_rdataset_clone() now have a const source rdataset. Also,
dns_rdataset_isassociated() also takes a const rdataset.
2026-01-30 19:33:42 +01:00
Ondřej Surý
0bebf8ee9d
Enable minimal ANY answers by default
ANY queries are widely abused by attackers doing reflection attacks as
they return the largest answers.  Enable minimal ANY answers by default
to reduce the attack surface of the DNS servers.
2026-01-28 15:38:18 +01:00
Aram Sargsyan
d81a2457d6 Add a new check in the RPZ system test
Check that reloading a response policy zone which has an '$INCLUDE'
directive defined is working as expected.
2026-01-27 11:31:15 +00:00
Nicki Křížek
b1e3469059 Resolve the system_test_dir in pytest
If the system_test_dir contains a symlink, then it might cause issues
further down when using relative_to(), unless it is resolved first. This
has been observed on FreeBSD13 in CI where /home is a symlink to
/usr/home.
2026-01-27 11:05:18 +01:00
Nicki Křížek
6eb2088320 Fix a race condition in dnssec test
When dumpdb command is executed, it might take a while until the file is
written. Rather than checking the file once, use the WatchLog mechanism
to allow the desired line to appear before a timeout happens.

This affected test_validation_recovery and test_cache tests which have
been intermittently failing on EL8 in our CI.
2026-01-26 10:45:34 +01:00
Štěpán Balážik
c336c1feab Fix bugs in 'resolver/ans2' and 'resolver/ans3'
There were multiple typos and omissions regarding query minimization.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
cef851740b Reimplement 'resolver/ans10' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
8f2526a27d Reimplement 'resolver/ans8' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
5004d278e4 Reimplement 'resolver/ans3' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
d203a39314 Reimplement 'resolver/ans2' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
23d9055617 Add common parts of resolver test custom servers
These will be shared by all the ans*/ans.py files.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
eba89fd38b Add StaticResponseHandler to isctest.asyncserver
It is used to prepare and yield one DNS response and avoid the
`get_responses` boiler-plate.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
8a45f5b485 Add QnameQtypeHandler for matching QNAME, QTYPE pairs
This is a pattern in the resolver system test and also elsewhere.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
7d5ec7167b Delete unused ResponseHandlers from statistics ans server
Turns out the original ans.pl implementation before (!10928) was a copy
of an old version of the ans2 server from the resolver system test.

I reimplemented it fully, even though only two ResponseHandlers are
actually used in the statistics test.
2026-01-23 16:39:00 +01:00
Štěpán Balážik
b89cc2bd86 Store the most specific matched domain in DomainHandler
Store the most specific matching domain in DomainHandler and
expose it through the `matched_domain` property for subclasses
to use in their implementations of `get_responses`.
2026-01-23 16:39:00 +01:00
Matthijs Mekking
bcb65f52f2 Add kasp test zone with uppercase characters
The test ensures that such zone is signed correctly.  In addition, test
that the next owner name field of the NSEC record is lowercased.
2026-01-23 11:52:59 +00:00
Nicki Křížek
bb6d7a0fc3 Apply black formatting changes
Generated by black 26.1.0 which got updated in CI.
2026-01-22 09:41:21 +01:00
Nicki Křížek
08630ca744 Silence incorrect pylint warnings for hypothesis.assume()
With hypothesis>6.148.3, pylint generates

W0101: Unreachable code (unreachable)

when any code is present after hypothesis.assume(). Silence these until
it is fixed upstream.

See https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217
2026-01-21 16:07:31 +01:00
Nicki Křížek
1291fa1a6d Remove hypothesis version checks
The minimum required hypothesis version has been set in requirements.txt
and no longer needs to be checked at runtime.

Since the hypothesis package is now a mandatory prerequisite, include it
in isctest as the other subpackages.
2026-01-21 16:07:31 +01:00
Nicki Křížek
ce385d8100 Remove compatibility hacks for dnspython<2.7.0
The minimum required dnspython version is now 2.7.0 and those
compatibility hacks can be dropped.
2026-01-21 16:07:31 +01:00
Nicki Křížek
ac8e2905b8 Bump the minimum required python version to 3.10
Drop support of EoL python versions for running system tests. The
maintenance cost of supporting end of life ecosystem, especially Python
3.6 on EL8 and the related outdated packages (pytest, dnspython, ...),
has become unreasonable.
2026-01-21 16:07:31 +01:00
Nicki Křížek
e276c3d5bd Remove pytest<7 compatibility hacks
Minimum pytest version has been bumped to 7.0.0, thus these are no
longer needed.
2026-01-21 16:07:31 +01:00
Nicki Křížek
093bef9211 Add support for pytest>=9.0.0
Use collection_path rather than the deprecated path argument for
pytest_ignore_collect() hook.

The collection_path argument was added in pytest 7.0.0, which is the
minimum supported pytest version from now on.
2026-01-21 16:07:31 +01:00
Nicki Křížek
628e16d057 Add requirements.txt for system tests
This file lists the required Python packages and versions for running
system tests. The easiest way to obtain them is:

    pip install -r requirements.txt

The minimum dnspython version is 2.7.0 because it supports TSIG parsing
without validation (for tsig/tests_tsig_hypothesis.py) and wire() (for
names/tests_names.py).

The minimum pytest version was bumped to 7.0.0 because it supports the
collection hook API required by pytest 9.

The minimum hypothesis version was set to 4.41.2 as prior versions might
have issues on FIPS systems.
2026-01-21 16:07:31 +01:00
Mark Andrews
f01497e05b Fix timing issues in nsec3/tests_nsec3_reconfig.py
ns3/nsec3-ent.kasp.db is regenerated too fast resulting in
the subsequent 'rndc reload' call failing.  This has been
fixed.
2026-01-21 16:01:57 +11:00
Mark Andrews
af379e10cc Use const pointer with strchr of const pointer
C23 now has qualifier preserving standard functions for strchr,
bsearch, strpbrk, strrchr, strstr, memchr.  There where a few places
where the return value was not assigned to a const qualified pointer.
These have been fixed.
2026-01-20 16:23:58 +11:00
Colin Vidal
e8b0d4749c rename dns_view_findzonecut() into dns_view_bestzonecut()
`dns_view_findzonecut()` is used only in the context where the closest
name servers for a name need to be queried.  In the future, this API
will also return the glues (if known) for those name servers, as well
as (exclusively, if both NS and DELEG exist) the DELEG record.

To avoid ambiguities with other code flows using `dns_db_findzonecut()`,
`dns_view_findzonecut()` has been renamed into `dns_view_bestzonecut()`.
2026-01-16 07:52:56 +01:00
Colin Vidal
18d6b94c1f remove sigrdataset from dns_view_findzonecut()
Since the `sigrdataset` "output" parameter of `dns_view_findzonecut()`
is never used (always called with NULL), it is now removed.

Also, since the resolver is moving towards a parent-centric direction,
there is no point having a signature for the NS record (which is not
authoritative in the parent, so never signed) in the contextes where
`dns_view_findzonecut()` is called.
2026-01-15 19:48:30 -08:00