Commit Graph

10124 Commits

Author SHA1 Message Date
Matthijs Mekking
229bc4ee95 Add statschannel test case for key removal
Add a statschannel test case to confirm that when keys are removed
(in this case because of a dnssec-policy change), the corresponding
dnssec-sign stats are cleared and are no longer shown in the
statistics.

(cherry picked from commit 1a3c82f765)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
7e90ef8f8c Add back the statschannel manykeys test case
Add a test case that has more than four keys (the initial number of
key slots that are created for dnssec-sign statistics). We shouldn't
be expecting weird values.

This fixes some errors in the manykeys zone configuration (keys
were created for algorithm RSASHA256, but the policy expected RSASHA1,
and the zone was not allowing dynamic updates).

This also fixes an error in the calls to 'zones-json.pl': The perl
script excepts an index number where the zone can be found, rather
than the zone name.

(cherry picked from commit 019a52a184)
2021-08-24 09:51:45 +02:00
Matthijs Mekking
4822c2a618 Add a test case for non-SEP CSK migration
A zone with a single key without the SEP bit set must also be assumed
to be a CSK.

(cherry picked from commit a8d0d2feed)
2021-08-23 10:37:17 +02:00
Matthijs Mekking
073f11fcac Changes to kasp script to deal with non-SEP CSK
In order to test cases with non-SEP CSK keys, the Flags Field needs to
be determined differently to deal with such exceptional scenarios.

(cherry picked from commit 36ad0331e2)
2021-08-23 10:37:11 +02:00
Matthijs Mekking
9df0bf8f17 Test migrating CSK to dnssec-policy
Add a test case for migrating CSK to dnssec-policy. The keymgr has no
way of telling that the key is used as a CSK, but if there is only one
key to migrate it is going to assume it must be a CSK.

(cherry picked from commit 96ee323622)
2021-08-23 10:36:37 +02:00
Mark Andrews
9eb98e024d wait for each staged to complete
(cherry picked from commit 8e189840b1)
2021-08-19 11:44:38 +02:00
Matthijs Mekking
d9b19dade5 Add test for in-view zone edits
Add a test case for GL #2845 where a zone is in two views, one base
view and one "in-view" and that zone is using an $INCLUDE. Make sure
that there is a jnl file (have ixfr-from-differences enabled and do a
dynamic update). Then freeze and make updates in the included file
(this requires the test.db file also to be updated because 'rndc freeze'
causes the zone file to be overwritten). Finally reload and ensure that
the edit in the included file has been loaded.

(cherry picked from commit 598bf1c29b)
2021-08-19 11:44:38 +02:00
Mark Andrews
c9e67b33c1 Add check-names for svbc (https) server name examples
(cherry picked from commit f6bfc685aa)
2021-08-18 16:54:31 +10:00
Mark Andrews
c7130b36fc Parse and print HTTPS and SVCB records
(cherry picked from commit 36f34a3e79)
2021-08-18 14:59:29 +10:00
Mark Andrews
4ba4d7cfbe More correctly implement ends with label sequence check
string.endswith("label.sequence") doesn't check for the implict
period before "label.sequence" when matching longer strings.

"foo.label.sequence" should match but "foolabel.sequence shouldn't".

(cherry picked from commit f79876b2d5)
2021-08-16 19:32:16 +02:00
Matthijs Mekking
ca0f078dbc Add qmin test cases when RRset has expired
Add test cases for GL #2665: The QNAME minimization (if enabled) should
also occur on the second query, after the RRsets have expired from
cache. BIND will still have the entries in cache, but marked stale.
These stale entries should not prevent the resolver from minimizing
the QNAME. We query for the test domain a.b.stale. in all cases (QNAME
minimization off, strict mode, and relaxed mode) and expect it to
behave the same the second time we have a stale delegation structure in
cache.

(cherry picked from commit 322626ab5b)
2021-08-16 16:42:34 +02:00
Petr Menšík
ca52adf81c Document return codes of dig
The dig tool reports some states as exit status. Document them briefly
in the manual page.

(cherry picked from commit f20cc30a6a)
2021-08-12 10:34:46 -07:00
Mark Andrews
3376aec286 Check 'rndc freeze' with in-view zones works
(cherry picked from commit ebc92b799b)
2021-08-12 04:19:44 +00:00
Mark Andrews
e7e6b50300 replace '-print0 | xargs -0' with '-exec ... {} +'
(cherry picked from commit de88d83a78)
2021-08-12 11:12:32 +10:00
Matthijs Mekking
e43d9f08b9 Add test for dnssec-signzone smooth ZSK roll
Add a test case to the dnssec system test to check that:
- a zone with a prepublished key is only signed with the active key.
- a zone with an inactive key but valid signatures retains those
  signatures and does not add signatures from successor key.
- signatures are swapped in a zone when signatures of predecessor
  inactive key are within the refresh interval.

(cherry picked from commit 35efbc270f)
2021-08-11 15:17:55 +02:00
Matthijs Mekking
c3bdc06278 dnssec-signzone ZSK smooth rollover
When signing with a ZSK, check if it has a predecessor. If so, and if
the predecessor key is sane (same algorithm, key id matches predecessor
value, is zsk), check if the RRset is signed with this key. If so, skip
signing with this successor key. Otherwise, do sign with the successor
key.

This change means we also need to apply the interval to keys that are
not actively signing. In other words, 'expired' is always
'isc_serial_gt(now + cycle, rrsig.timeexpire)'.

Fix a print style issue ("removing signature by ..." was untabbed).

(cherry picked from commit 837adb93d3)
2021-08-11 15:17:49 +02:00
Mark Andrews
d18bec59cb save named.stats files
(cherry picked from commit 53afccf42b)
2021-08-03 10:54:33 +10:00
Tinderbox User
b22548d8be Add prereq.sh script for the "checkds" system test 2021-07-23 09:43:46 +02:00
Mark Andrews
18fc3319bc Check that reload with deleted journal works
(cherry picked from commit cf8aadfeb6)
2021-07-23 09:20:26 +10:00
Mark Andrews
d51b8f7228 Check that restart with zone changes and deleted journal works
(cherry picked from commit 163fb0b825)
2021-07-23 09:20:25 +10:00
Mark Andrews
8a81830001 Check reload of dnssec-policy zone works
(cherry picked from commit c7fc13a9fa)
2021-07-23 09:20:25 +10:00
Mark Andrews
d50a1ade1c Remove spurious early exit
(cherry picked from commit 9c9ee59fa7)
2021-07-23 09:20:25 +10:00
Mark Andrews
0ffdca4e83 Check that load time was recorded for unchanged inline zone
subsequent reloads should not report 'ixfr-from-differences: unchanged'

(cherry picked from commit b84c057130)
2021-07-23 07:49:21 +10:00
Mark Andrews
17a65b2443 check nsupdate handles UPDATE response to QUERY
(cherry picked from commit 0bba0ab10d)
2021-07-21 12:40:47 +10:00
Mark Andrews
498de906fa Check opcode of messages returned by dns_request_getresponse
(cherry picked from commit ed4e00713f)
2021-07-21 12:40:47 +10:00
Michal Nowak
195b88cb22 Fix handling of restart option in run.sh
The support for stat.pl's --restart option was incomplete in run.sh.
This change makes sure it's handled properly and that named.run file is
not being removed by clean.sh when the --restart option is used.

(cherry picked from commit a39697635b)
2021-07-16 17:37:58 +02:00
Michal Nowak
3e0f3e1d57 Process core dump from named which failed to start
When named failed to start and produced core dump, the core file wasn't
processed by GDB because of run.sh script exiting immediately. This
remedies the limitation, simplifies the surrounding code, and makes the
script shellcheck clean.

(cherry picked from commit bc097d3358)
2021-07-16 17:27:24 +02:00
Michał Kępień
5c8f3463d5 Extend tests for signed, CNAME-sourced delegations
Extend the "chain" system test with AUTHORITY section checks for signed,
secure delegations.  This complements the checks for signed, insecure
delegations added by commit 82b7e6ccef.

Extend the existing AUTHORITY section checks for signed, insecure
delegations to ensure nonexistence of DS RRsets in such responses.
Adjust comments accordingly.

Ensure dig failures cause the "chain" system test to fail.

(cherry picked from commit a14efdf54c)
2021-07-16 07:24:34 +02:00
Mark Andrews
5e4f22aa83 Test that 'zone-statistics full;' is properly processed
(cherry picked from commit 592f9ff6bc)
2021-07-16 14:13:49 +10:00
Matthijs Mekking
9aeadf31f0 Add test for allowing update CDS/CDNSKEY
Add tests to the nsupdate system test to make sure that CDS and/or
CDNSKEY that match an algorithm in the DNSKEY RRset are allowed. Also
add tests that updates are rejected if the algorithm does not match.

Remove the now redundant test cases from the dnssec system test.

Update the checkzone system test: Change the algorithm of the CDS and
CDNSKEY records so that the zone is still rejected.

(cherry picked from commit 6b79db1fdd)
2021-07-15 09:26:11 +02:00
Ondřej Surý
46ecb94cb6 Disable the cpu system test
As we don't set the thread affinity, the cpu test would consistently
fail.  Disable it, but don't remove it as we might restore setting the
affinity in the future versions of BIND 9.

(cherry picked from commit 4c5dc1904b)
2021-07-13 15:48:27 +02:00
Mark Andrews
1f36600e5a Add DBC REQUIRE to check that 'text' is non NULL
for all control channel commands.  This should silence
gcc-10-analyzer reporting NULL pointer dereference of 'text'.

(cherry picked from commit ac0fc3c2de)
2021-07-12 14:55:46 +10:00
Mark Andrews
bcaf23dd27 Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock 2021-07-12 02:40:25 +00:00
Evan Hunt
68a40622ef allow multiple key algorithms in the same control listener
if a control channel listener was configured with more than one
key algorithm, message verification would be attempted with each
algorithm in turn. if the first key failed due to the wrong
signature length, the entire verification process was aborted,
rather than continuing on to try with another key.

(cherry picked from commit 841b557df8)
2021-07-06 12:55:28 -07:00
Matthijs Mekking
d02002321c Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.

(cherry picked from commit c92128eada)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
2dfd09fa3a Add missing VERIFY export
This makes the 'dnssec-verify' tool visible to the test environment.

(cherry picked from commit 4c337a8e72)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
8ca6571ee9 Slightly improved dnssec tools fatal message
Return the offending key state identifier.

(cherry picked from commit 71d5932a14)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
850aed0219 Add helpful function 'dns_zone_getdnsseckeys'
This code gathers DNSSEC keys from key files and from the DNSKEY RRset.
It is used for the 'rndc dnssec -status' command, but will also be
needed for "checkds". Turn it into a function.

(cherry picked from commit 40331a20c4)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
9c0e252e2b Add "parental-source[-v6]" config option
Similar to "notify-source" and "transfer-source", add options to
set the source address when querying parental agents for DS records.

(manually picked from commit 2872d6a12e)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
63582dc778 Parse "parental-agents" configuration
Parse the new "parental-agents" configuration and store it in the zone
structure.

(cherry picked from commit 6f92d4b9a5)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
72d97df483 Make "primaries" config parsing generic
Make the code to parse "primaries" configuration more generic so
it can be reused for "parental-agents".

(cherry picked from commit 6040c71478)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
6369dec812 Remove stray "setup zone" in kasp system setup
(cherry picked from commit 8327cb7839)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
7d877cea14 Add checkds system test
Add a Pytest based system test for the 'checkds' feature. There is
one nameserver (ns9, because it should be started the latest) that
has configured several zones with dnssec-policy. The zones are set
in such a state that they are waiting for DS publication or DS
withdrawal.

Then several other name servers act as parent servers that either have
the DS for these published, or not. Also one server in the mix is
to test a badly configured parental-agent.

There are tests for DS publication, DS publication error handling,
DS withdrawal and DS withdrawal error handling.

The tests ensures that the zone is DNSSEC valid, and that the
DSPublish/DSRemoved key metadata is set (or not in case of the error
handling).

It does not test if the rollover continues, this is already tested in
the kasp system test (that uses 'rndc -dnssec checkds' to set the
DSPublish/DSRemoved key metadata).

(manually picked from commit 56262db9cd)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
514eccf730 Move checkds system test to checkdstool
There is a checkds system test in v9_16 that does not exist in the
main branch. This existing checkds system test checks the behaviour of
the dnssec-checkds tool. Before backporting the new checkds system
test, that tests the feature where BIND checks periodically the
parental agents if the DS for a given KSK has been published, move the
existing checkds system test to checkdstool.
2021-07-01 14:48:23 +02:00
Matthijs Mekking
ab26fc2d66 Check parental-agents config
Add checks for "parental-agents" configuration, checking for the option
being at wrong type of zone (only allowed for primaries and
secondaries), duplicate definitions, duplicate references, and
undefined parental clauses (the name referenced in the zone clause
does not have a matching "parental-agent" clause).

(cherry picked from commit 1e763e582b)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
90ef2b9c81 Add parental-agents configuration
Introduce a way to configure parental agents that can be used to
query DS records to be used in automatic key rollovers.

(manually picked from commit 0311705d4b)
2021-07-01 14:48:23 +02:00
Matthijs Mekking
42da0e7790 Change primaries objects to remote-servers
Change the primaries configuration objects to the more generic
remote-servers, that we can reuse for other purposes (such as
parental-agents).

(manually picked from commit 39a961112f)
2021-07-01 14:48:21 +02:00
Mark Andrews
8be9a67aec Handle placeholder KEYDATA record
A placeholder keydata record can appear in a zone file.  Allow them
to be read back in.

(cherry picked from commit c6fa8a1d45)
2021-07-01 15:01:05 +10:00
Matthijs Mekking
37db953d9d Fix setnsec3param hang on shutdown
When performing the 'setnsec3param' task, zones that are not loaded
will have their task rescheduled. We should do this only if the zone
load is still pending, this prevents zones that failed to load get
stuck in a busy wait and causing a hang on shutdown.

(cherry picked from commit 10055d44e3)
2021-06-28 11:07:31 +02:00
Matthijs Mekking
2fe799f637 Add configuration that causes setnsec3param hang
Add a zone to the configuration file that uses NSEC3 with dnssec-policy
and fails to load. This will cause setnsec3param to go into a busy wait
and will cause a hang on shutdown.

(cherry picked from commit 3631a23c7f)
2021-06-28 11:02:55 +02:00