Commit graph

11439 commits

Author SHA1 Message Date
Matthijs Mekking
8ec554e3de 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.

(cherry picked from commit 129973ebb0)
2024-07-30 13:38:04 +02:00
Matthijs Mekking
55f79b34b6 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.

(cherry picked from commit 2237895bb4)
2024-07-30 10:22:53 +00:00
Matthijs Mekking
6c0380db8a Move dnssec-policy to kasp-fips.conf.in
All dnssec-policy configurations are here, so why not this one?

(cherry picked from commit 93326e3e18)
2024-07-30 10:22:53 +00:00
Matthijs Mekking
1f2faa8470 Fix dig connection timeout argument when using DOH
bin/dig/dighost.c calls isc_nm_httpconnect. The timeout setting
(local_timeout) is passed as the 11th argument, but the function in
lib/isc/netmgr/http.c has the timeout argument as the 11th argument.
The 10th and 11th argument were reversed. This commit fixes that.

Thanks to Nicolas Dehaine for reporting and providing the fix.
2024-07-30 08:52:05 +00:00
Nicki Křížek
ff983ed647
Mark the keyfromlabel&enginepkcs11 tests as xfail
The tests currently fail on debian:bookworm due to a bug in OpenSSL
3.0.13.
2024-07-29 16:55:01 +02:00
Ondřej Surý
8979166d35
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 15:04:43 +02:00
Ondřej Surý
90c7c8078b
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.

(cherry picked from commit 58f660cf2b)
2024-07-01 13:15:04 +02:00
Aram Sargsyan
227f9aa064
Adapt the upforwd test to the SIG(0) removal
Change the check so that update with SIG(0) is expected to fail.
2024-06-10 19:02:52 +02:00
Petr Špaček
02dffb63a8
Adapt the tsiggss test to the SIG(0) removal
Test that SIG(0) signer is NOT sent to the external socket for
authorization. It MUST NOT be considered a valid signature by
any chance.

Also check that the signer's name does not appear in authsock.pl
output.
2024-06-10 19:02:52 +02:00
Aram Sargsyan
4b1f026ad9
Enable stdout autoflush in authsock.pl
With enabled buffering the output gets lost when the process
receives a TERM signal. Disable the buffering.
2024-06-10 19:02:52 +02:00
Matthijs Mekking
2f5c670ce9
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.

(cherry picked from commit 14e5230f897a178221b606c242b8fbcb357704aa)
2024-06-10 18:51:27 +02:00
Matthijs Mekking
4a0118c16e
Check if restart works
(cherry picked from commit 4e69ece8f27f3623a4c7a9100477a5547b94c311)
2024-06-10 18:51:27 +02:00
Matthijs Mekking
6fe1df142b
Switch to inline-signing no
(cherry picked from commit 0949221c07fe102ca608899b21f1f5ac5e271953)
2024-06-10 18:51:27 +02:00
Matthijs Mekking
270512949e
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.

(cherry picked from commit 4c677882e66883670990a771337ecbb5206a6faa)
2024-06-10 18:51:27 +02:00
Petr Špaček
5067ab6120
Remove duplicated empty zone files
(cherry picked from commit 1456b4fc7778b851256107dbc79fb67d45f752f5)
2024-06-10 18:51:26 +02:00
Petr Špaček
aa2a1ab919
masterformat: rename zone names to reflect intended meaning
(cherry picked from commit d34bfb1eeaa2f8faab80b1620b992b5495e6f88c)
2024-06-10 18:51:26 +02:00
Petr Špaček
e38a92cef8
Test owner name rename: a b c d e -> <number>-txt
(cherry picked from commit 6ce03f75d1935c2e1991e9c0a01c49b0099a58cb)
2024-06-10 18:51:26 +02:00
Petr Špaček
1a8ea606d9
Test variable rename i->_attempt
(cherry picked from commit 13417eb277cc8a30ee4ddbb6fc02442b0d8e6d3c)
2024-06-10 18:51:26 +02:00
Petr Špaček
ac39dcb397
Test variable rename a->rrcount
(cherry picked from commit 338b45ae713cded921fd3e5494ca38bd59ff9ee8)
2024-06-10 18:51:26 +02:00
Ondřej Surý
4bdd1bf4f3
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.

(cherry picked from commit 4cfeed912a5e7440f04cb088a461ff47305da2e7)
2024-06-10 18:50:06 +02:00
Ondřej Surý
19dc77ac48
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.

(cherry picked from commit 7e4530f847c8dc541c5e5bf9f790deed520aaa16)
2024-06-10 18:50:06 +02:00
Ondřej Surý
39d3e2a8ec
Add a limit to the number of RR types for single name
Previously, the number of RR types for a single owner name was limited
only by the maximum number of the types (64k).  As the data structure
that holds the RR types for the database node is just a linked list, and
there are places where we just walk through the whole list (again and
again), adding a large number of RR types for a single owner named with
would slow down processing of such name (database node).

Add a configurable limit to cap the number of the RR types for a single
owner.  This is enforced at the database (rbtdb, qpzone, qpcache) level
and configured with new max-types-per-name configuration option that
can be configured globally, per-view and per-zone.

(cherry picked from commit 00d16211d6368b99f070c1182d8c76b3798ca1db)
2024-06-10 18:50:06 +02:00
Evan Hunt
197b08009d
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.

(cherry picked from commit 8e3efb4e06ba68cc3f9bc5be2bacb2596bd74cb3)
2024-06-10 18:50:06 +02:00
Ondřej Surý
b77606d167
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.

(cherry picked from commit cee9ad81db6e5a1167b311e5c2f42cf65ba457cd)
2024-06-10 18:50:05 +02:00
Ondřej Surý
e699ef939e
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.

(cherry picked from commit 3fbd21f69a1bcbd26c4c00920e7b0a419e8762fc)
2024-06-10 18:50:03 +02:00
Mark Andrews
13be6cd991 Pass a memory context in to dns_cache_create
(cherry picked from commit 87e3b9dbf3)
2024-06-04 12:42:05 +00:00
Mark Andrews
26ad166a05 Use a new memory context when flushing the cache
When the cache's memory context was in over memory state when the
cache was flushed it resulted in LRU cleaning removing newly entered
data in the new cache straight away until the old cache had been
destroyed enough to take it out of over memory state.  When flushing
the cache create a new memory context for the new db to prevent this.

(cherry picked from commit 5e77edd074)
2024-06-04 12:42:05 +00:00
Mark Andrews
4be2caa345 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.

(cherry picked from commit 07cdf3e945)
2024-06-03 13:52:37 +00:00
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