Commit graph

11411 commits

Author SHA1 Message Date
Mark Andrews
f7fb020b6e 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

(cherry picked from commit 6e9ed4983e)
2024-05-17 15:34:07 +10:00
Mark Andrews
e854c65f43 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.

(cherry picked from commit dd13f41ae1)
2024-05-16 12:10:01 +10:00
Mark Andrews
18bbd71015 Remove invalid DNSKEY RRset from zone
(cherry picked from commit 315ad2df7a)
2024-05-16 12:10:01 +10:00
Mark Andrews
797ec13904 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.

(cherry picked from commit 122111f75e)
2024-05-16 12:10:01 +10:00
Mark Andrews
529fa790a9 Fail if there are non apex DNSKEYs
DNSSEC only works when DNSKEYs are self signed.  This only occurs
when the DNSKEY RRset is at the apex.  Cause dnssec-signzone to
fail if it attempts to sign an non-apex DNSKEY RRset.

(cherry picked from commit b3efc15be4)
2024-05-16 12:09:57 +10:00
Mark Andrews
e27acff332
Address qp/rbtdb backup file style differences
qp and rbtdb produce stylistically different backup files.  This
was causing the xferquota system test to fail.  This has been
addressed by making the test independent of the stylistic differences.

(cherry picked from commit 1482e9bbb9)
2024-05-15 10:58:42 +02:00
Matthijs Mekking
5bb7d952a7
Fix xferquota system test
The change from RBT to QP has changed the contents of generated zone
files slightly: node names are now always absolute, so instead of using
$ORIGIN and relative names, generated zone files use full names for all
records.

This caused a failure in the xferquota system test, which was looking
for a relative name in secondary zone files. Replace the string
matching with a regular expression to fix the test.

(cherry picked from commit 618c963cb7)
2024-05-15 10:58:37 +02:00
Michal Nowak
fb7366db3e
Rewrite include-multiplecfg system test to pytest
(cherry picked from commit e9e8753306)
2024-05-14 12:54:40 +02:00
Michal Nowak
ec42164265
Use isctest.run.cmd() helper function in tests
(cherry picked from commit 77a42f8875)
2024-05-14 12:54:26 +02:00
Tom Krizek
78c3838310 Add isctest.run.cmd() helper function
(cherry picked from commit a9f3fb3db5)
2024-05-14 10:47:51 +00:00
Mark Andrews
35f1e43273 Use dns_view_findzone instead of dns_zt_find
With weak zone attachments being used for catzs, catzs->view->zonetable
may be NULL so we need to account for this which dns_view_findzone
does.  This is already done in main.
2024-05-14 08:46:00 +10:00
Mark Andrews
35d908caa8 catz should use weak attachment to the view
(cherry picked from commit 941ad2b3c5)
2024-05-09 10:53:02 +10:00
Petr Špaček
f148d39a9b Mention RFC 9276 Guidance for NSEC3 Parameter Settings
Draft was eventually published as RFC 9276 but we did not update our
docs. Also add couple mentions in relevant places in the ARM and
dnssec-signzone man page, mainly around "do not touch" places.

(cherry picked from commit 8e4c0329c3)
2024-05-08 07:09:35 +00:00
Petr Špaček
7817a483a4 Update DNSSEC Operational Practices references to Version 2
RFC 4641 was obsoleted by 6781.

(cherry picked from commit c5d6769e11)
2024-05-08 07:09:35 +00:00
Mark Andrews
602b20d3f5 Test including a directory in a zone file
(cherry picked from commit e697d20f00)
2024-05-07 01:06:14 +00:00
Mark Andrews
c8166d67f6 Test $GENERATE in nibble mode with a negative value
Negative values used to cause $GENERATE to loop forever.

(cherry picked from commit 32535de856)
2024-05-06 23:59:06 +00:00
Matthijs Mekking
4ef23ad0ff RPZ response's SOA record is incorrectly set to 1
An RPZ response's SOA record TTL is set to 1 instead of the SOA TTL,
a boolean value is passed on to query_addsoa, which is supposed to be
a TTL value. I don't see what value is appropriate to be used for
overriding, so we will pass UINT32_MAX.

(cherry picked from commit 5d7e613e81)
2024-05-06 12:18:08 +02:00
Ondřej Surý
78d92a2a93
Properly document -U <n> option to named
In the past, before the netmgr, the `-U <n>` option to `named`
configured number of listening dispatches for UDP per-interface.

Since 9.16, it only affects the number of outgoing UDP dispatches.
Properly document that in the `named` man page.
2024-04-24 22:50:22 +02:00
Petr Menšík
b491a82f56 Change exception SPDX to Autoconf-exception-generic
License text is in fact Autoconf generic exception, with already defined
SPDX identificator. Use that instead.

https://spdx.org/licenses/Autoconf-exception-generic.html
(cherry picked from commit 2b348a5daa)
2024-04-24 09:52:19 +00:00
Mark Andrews
fc7cba3d43 check behaviour with invalid notify-source-v6 address
This was reported as causing the server to fail to shutdown on
NetBSD.  Look for the expected informational and error messages.

(cherry picked from commit 580c41de0d)
2024-04-24 01:10:01 +00:00
Michal Nowak
ea413a6fae Update sources to Clang 18 formatting
(cherry picked from commit f454fa6dea)
2024-04-23 12:48:56 +00:00
Matthijs Mekking
f211c05990 Add checkconf check for signatures-jitter
Having a value higher than signatures-validity does not make sense
and should be treated as a configuration error.

(cherry picked from commit c3d8932f79)
2024-04-18 15:00:07 +00:00
Matthijs Mekking
104eabdc2e Add signatures-jitter option
Add an option to speficy signatures jitter.

(cherry picked from commit 2a4daaedca)
2024-04-18 15:00:07 +00:00
Michał Kępień
cd64a3747b Fix check interaction in the "serve-stale" test
Commit 2eee1e1761 modified the
"serve-stale" system test by adding the ns3/named9.conf.in configuration
file and making the ns3 named instance load that file near the end of
the test.  However, ns3/named9.conf.in changes the
stale-answer-client-timeout setting to a very low value, which affects
all subsequent checks in tests.sh (rather than just the check that needs
the low value to be set) and may cause false positives.  Fix by
reloading configuration from ns3/named8.conf.in as soon as the check
using a very low stale-answer-client-timeout value is finished.
2024-03-28 18:56:35 +01:00
Mark Andrews
2eee1e1761 Check dns64 + server-stale short timeout
Check that named correctly returns a synthesized DNS64 answer when the
server stale timer triggers for the A lookup.  Use a small value for
stale-answer-client-timeout (2ms) and delay the A response by 1 second.
2024-03-28 15:28:55 +01:00
Mark Andrews
9c53bb94b0 Checking nxdomain-redirect against built-in RFC-1918 zone
Check that RFC 1918 leak detection does not trigger an assertion
when nxdomain redirection is enabled in the server but not for the
RFC 1918 reverse namespace.

(cherry picked from commit 2789906ce4)
2024-03-28 13:15:45 +01:00
Mark Andrews
fff8de8430
IO::Socket::INET6 has been replaced by IO::Socket::IP
IO::Socket::INET6 is no longer being maintained and its functionality
has been replaced by IO::Socket::IP.

(cherry picked from commit d1983adc22)
2024-03-25 16:02:01 +01:00
Tom Krizek
2d7cc261f2
Mark the autosign system test as flaky
The autosign test uses sleep in many cases to wait for something to
happen. This inevitably leads to an instability that manifests in our
CI. Allow an automatic rerun of the test to improve its stability.

(cherry picked from commit a061fd67f6)
2024-03-21 16:23:55 +01:00
Tom Krizek
6891291953
Export variable in resolver system test
Variable assignment when calling subroutines might not be portable.
Notably, it doesn't work with FreeBSD shell, where the value of HOME
would be ignored in this case.

Since the commands are already executed in a subshell, export the HOME
variable to ensure it is properly handled in all shells.

(cherry picked from commit 86a192cece)
2024-03-21 14:15:31 +01:00
Mark Andrews
aa9f88b070 Stop named-checkzone leaking test queries
(cherry picked from commit ad083897cc)
2024-03-21 13:40:04 +11:00
Mark Andrews
127566f9e2 Add RESOLVER.ARPA to the built in empty zones
RFC 9462 adds RESOLVER.ARPA to the list of built in empty zones.

(cherry picked from commit 49561277de)
2024-03-21 11:13:47 +11:00
Michal Nowak
8ed4961ad8
Use bitwise operation to remove RD from default flags
(cherry picked from commit 69d3efed89)
2024-03-19 20:38:28 +01:00
Michal Nowak
4ce5f50162
Rewrite glue system test to pytest
(cherry picked from commit 9950f6d651)
2024-03-19 20:38:28 +01:00
Michal Nowak
8c38897c5b
Rewrite masterfile system test to pytest
(cherry picked from commit 7a161f615a)
2024-03-19 11:16:40 +01:00
Michal Nowak
f152ee9291
Add zones_equal() with optional TTL comparison
(cherry picked from commit 686033e48d)
2024-03-19 11:15:08 +01:00
Michal Nowak
ff6fc0c98f
Modify rrsets_equal() to optionally compare TTL
(cherry picked from commit 5af3b713af)
2024-03-19 11:15:04 +01:00
Michal Nowak
f94687069c
Rewrite limits system test to pytest
Also, tweak the IP ranges of A RRsets so they are more easily processed
by for loops.

(cherry picked from commit f90a772298)
2024-03-18 17:07:17 +01:00
Mark Andrews
e185d23d9e Test +noedns +ednsflags=non-zero-value
(cherry picked from commit 8babbd09a1)
2024-03-17 13:11:51 +10:00
Mark Andrews
c356e86457 Re-enable EDNS if an EDNS flag gets set to 1 by +ednsflags
This is consistent with +dnssec and +nsid which only re-enable
EDNS if do is set to 1 or nsid is requested.

(cherry picked from commit d74bba4fae)
2024-03-17 13:11:51 +10:00
Michal Nowak
481989cfa9
Rewrite rrchecker system test to pytest
(cherry picked from commit 6a301c1d35)
2024-03-15 10:07:27 +01:00
Matthijs Mekking
a621e035d4 Detect invalid durations
Be stricter in durations that are accepted. Basically we accept ISO 8601
formats, but fail to detect garbage after the integers in such strings.

For example, 'P7.5D' will be treated as 7 days. Pass 'endptr' to
'strtoll' and check if the endptr is at the correct suffix.

(cherry picked from commit e39de45adc)
2024-03-14 11:40:43 +01:00
Mark Andrews
6d43b3011e Check static-stub synthesised NS is not returned
(cherry picked from commit 229bf863e2)
2024-03-14 15:33:25 +11:00
Matthijs Mekking
464950214c Test secure chain that includes inactive KSK
Add a regression test case for the scenario where a secure chain of
trust includes an inactive KSK, that is a KSK that is not signing the
DNSKEY RRset.

(cherry picked from commit f0bfd276e0)
2024-03-12 09:35:46 +01:00
Ondřej Surý
231b2375e5
Create a second pruning task for rbtdb with unlimited quantum
Previously, rbtdb->task had quantum of 1 because it was originally used
just for freeing RBTDB contents, which can happen on a "best effort"
basis (does not need to be prioritized).  However, when tree pruning was
implemented, it also started sending events to that task, enabling the
latter to become clogged up with a significant event backlog because it
only pruned a single RBTDB node per event.

To prioritize tree pruning (as it is necessary for enforcing the
configured memory use limit for the cache memory context), create a
second task with a virtually unlimited quantum (UINT_MAX) and send the
tree-pruning events to this new task, to ensure that all nodes scheduled
for pruning will be processed before further nodes are queued in a
similar fashion.

This change enables dropping the prunenodes list and restoring the
originally-used logic that allocates and sends a separate event for each
node to prune.
2024-03-06 17:11:14 +01:00
Evan Hunt
046b62bf02 move RRL broken-config check to checkconf
the RRL test included a test case that tried to start named with
a broken configuration.  the same error could be found with
named-checkconf, so it should have been tested in the checkconf
system test.

(cherry picked from commit 05398c1488)
2024-03-01 15:59:38 -08:00
Mark Andrews
111abe9940 Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4)
2024-02-28 11:38:18 +11:00
Aydın Mercan
abc47f5ce4
Expose the TCP client count in statistics channel
The statistics channel does not expose the current number of TCP clients
connected, only the highwater. Therefore, users did not have an easy
means to collect statistics about TCP clients served over time. This
information could only be measured as a seperate mechanism via rndc by
looking at the TCP quota filled.

In order to expose the exact current count of connected TCP clients
(tracked by the "tcp-clients" quota) as a statistics counter, an
extra, dedicated Network Manager callback would need to be
implemented for that purpose (a counterpart of ns__client_tcpconn()
that would be run when a TCP connection is torn down), which is
inefficient. Instead, track the number of currently-connected TCP
clients separately for IPv4 and IPv6, as Network Manager statistics.

(cherry picked from commit 2690dc48d3)
2024-02-27 11:04:28 +03:00
Michal Nowak
195b892bde
Watch logs from start in dialup system test
When the first parametrized test takes a bit longer than usual, the zone
transfer in ns3 may succeed before the second parametrized test is even
started, and then watch_log_from_here() won't find the "Transfer status:
success" message in the named log. Using watch_log_from_start() instead
makes sure the test is more stable.

(cherry picked from commit 283a7ab17d)
2024-02-26 12:11:07 +01:00
Mark Andrews
2e224d46d2 Add RESINFO record type
This is a TXT clone using code point 261.

(cherry picked from commit 0651063658)
2024-02-26 13:20:48 +11:00
Michal Nowak
05416a52b8
Rewrite dsdigest system test to pytest
(cherry picked from commit cfb68bda79)
2024-02-23 14:19:22 +01:00