Commit Graph

36965 Commits

Author SHA1 Message Date
Matthijs Mekking
e4467aa841 Add release note and change for GL #3591
Breaking news.

(cherry picked from commit 1cf2f6fe68)
2022-11-03 11:51:22 +01:00
Matthijs Mekking
b12572b4af If a zone is not reusable, trigger full sign
If after a reconfig a zone is not reusable because inline-signing
was turned on/off, trigger a full resign. This is necessary because
otherwise the zone maintenance may decide to only apply the changes
in the journal, leaving the zone in an inconsistent DNSSEC state.

(cherry picked from commit 4d143f2cc4)
2022-11-03 11:43:14 +01:00
Matthijs Mekking
3609dce81d Don't allow DNSSEC records in the raw zone
There was an exception for dnssec-policy that allowed DNSSEC in the
unsigned version of the zone. This however causes a crash if the
zone switches from dynamic to inline-signing in the case of NSEC3,
because we are now trying to add an NSEC3 record to a non-NSEC3 node.
This is because BIND expects none of the records in the unsigned
version of the zone to be NSEC3.

Remove the exception for dnssec-policy when copying non DNSSEC
records, but do allow for DNSKEY as this may be a published DNSKEY
from a different provider.

(cherry picked from commit 332b98ae49)
2022-11-03 11:43:08 +01:00
Matthijs Mekking
bb1c40e0a3 Remove checks when going to dnssec-policy none
The changes in the code have the side effect that the CDNSKEY and CDS
records in the secure version of the zone are not reusable and thus
are thrashed from the zone. Remove the apex checks for this use case.
We only care about that the zone is not immediately goes bogus, but
a user really should use the built-in "insecure" policy when unsigning
a zone.

(cherry picked from commit bc703a12e7)
2022-11-03 11:43:02 +01:00
Matthijs Mekking
7a8eb8d035 Add nsec3 system test that transfers in NSEC3
Similar to an attempt to add NSEC through dynamic update, add a test
case that tries to add NSEC3 through zone transfer.

(cherry picked from commit ef1cb9935c)
2022-11-03 11:42:56 +01:00
Matthijs Mekking
b9726ad03c Add two more nsec3 system tests
Add one more case that tests reconfiguring a zone to turn off
inline-signing. It should still be a valid DNSSEC zone and the NSEC3
parameters should not change.

Add another test to ensure that you cannot update the zone with a
NSEC3 record.

(cherry picked from commit 4cd8e8e9c3)
2022-11-03 11:42:49 +01:00
Matthijs Mekking
1815a9a4f4 Update kasp system test to work with .signed files
We no longer accept copying DNSSEC records from the raw zone to
the secure zone, so update the kasp system test that relies on this
accordingly.

Also add more debugging and store the dnssec-verify results in a file.

(cherry picked from commit 57ea9e08c6)
2022-11-03 11:42:44 +01:00
Matthijs Mekking
518218e053 Test changing from dynamic to inline-signing
Add a kasp system test that reconfigures a dnssec-policy zone from
maintaining DNSSEC records directly to the zone to using inline-signing.

Add a similar test case to the nsec3 system test, testing the same
thing but now with NSEC3 in use.

(cherry picked from commit 9018fbb205)
2022-11-03 11:42:38 +01:00
Arаm Sаrgsyаn
fd77c37820 Merge branch '2895-named-can-create-unrecoverable-managed-keys-v9_18' into 'v9_18'
[v9_18] Don't trust a placeholder KEYDATA record

See merge request isc-projects/bind9!7008
2022-11-01 11:26:24 +00:00
Aram Sargsyan
ac25292556 Add CHANGES and release notes for [GL #2895]
(cherry picked from commit 3bf4bc7336)
2022-11-01 10:49:58 +00:00
Aram Sargsyan
4b80324f51 Don't trust a placeholder KEYDATA record
When named starts it creates an empty KEYDATA record in the managed-keys
zone as a placeholder, then schedules a key refresh. If key refresh
fails for some reason (e.g. connectivity problems), named will load the
placeholder key into secroots as a trusted key during the next startup,
which will break the chain of trust, and named will never recover from
that state until managed-keys.bind and managed-keys.bind.jnl files are
manually deleted before (re)starting named again.

Before calling load_secroots(), check that we are not dealing with a
placeholder.

(cherry picked from commit 354ae2d7e3)
2022-11-01 10:49:51 +00:00
Aram Sargsyan
5e26074ce4 Test managed-keys placeholder
Add a dnssec test to make sure that named can correctly process a
managed-keys zone with a placeholder KEYDATA record.

(cherry picked from commit 8c48eabbc1)
2022-11-01 10:49:43 +00:00
Evan Hunt
dfcbbdcb6f Merge branch '3617-keyfetch-race-v9_18' into 'v9_18'
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

See merge request isc-projects/bind9!7006
2022-11-01 08:44:07 +00:00
Evan Hunt
67f60e5ae4 CHANGES for [GL #3617] 2022-11-01 00:23:05 -07:00
Evan Hunt
28d0c37ef0 Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()
Because dns_resolver_createfetch() locks the view, it was necessary
to unlock the zone in zone_refreshkeys() before calling it in order
to maintain the lock order, and relock afterward. this permitted a race
with dns_zone_synckeyzone().

This commit moves the call to dns_resolver_createfetch() into a separate
function which is called asynchronously after the zone has been
unlocked.

The keyfetch object now attaches to the zone to ensure that
it won't be shut down before the asynchronous call completes.

This necessitated refactoring dns_zone_detach() so it always runs
unlocked. For managed zones it schedules zone_shutdown() to
run asynchronously; for unmanaged zones there is no task.
2022-11-01 00:23:05 -07:00
Ondřej Surý
c8ff8108e7 Merge branch '3634-dont-enforce-jemalloc-on-NetBSD-v9_18' into 'v9_18'
Don't enforce jemalloc on NetBSD [v9.18]

See merge request isc-projects/bind9!7005
2022-10-31 15:24:25 +00:00
Ondřej Surý
0cc485faf1 Add CHANGES note for [GL #3634]
(cherry picked from commit fdf1e226fd)
2022-10-31 16:15:32 +01:00
Ondřej Surý
a4341b4338 Don't enforce jemalloc on NetBSD
The NetBSD system allocator is in fact based on the jemalloc, but it
doesn't export the extended interface, so we can't use that.  Remove
the jemalloc enforcement for the NetBSD.

(cherry picked from commit feea72414b)
2022-10-31 16:15:11 +01:00
Evan Hunt
82df6b5a55 Merge branch 'each-dupsigs-test-v9_18' into 'v9_18'
make dupsigs test less timing-sensitive

See merge request isc-projects/bind9!7002
2022-10-31 11:27:06 +00:00
Evan Hunt
ebacebec15 make dupsigs test less timing-sensitive
the dupsigs test is prone to failing on slow CI machines
because the first test can occur before the zone is fully
signed.

instead of just waiting ten seconds arbitrarily, we now
check every second, and allow up to 30 seconds before giving
up.

(cherry picked from commit d9b85cbaae)
2022-10-31 04:24:37 -07:00
Evan Hunt
e65a34e504 Merge branch '3631-fix-zone-maintenance-race-v9_18' into 'v9_18'
fix a potential data race in zone_maintenance()

See merge request isc-projects/bind9!7001
2022-10-31 11:01:14 +00:00
Evan Hunt
c7e2fae6de fix a potential data race in zone_maintenance()
zone_maintenance() accessed zone timer information without locking.

(cherry picked from commit f92b946df3)
2022-10-31 03:29:28 -07:00
Tom Krizek
eae3d11cee Merge branch '3503-random-default-algorithm-in-tests-v9_18' into 'v9_18'
Random selection of DEFAULT_ALGORITHM in system tests at runtime [v9_18]

See merge request isc-projects/bind9!6992
2022-10-27 11:26:28 +00:00
Tom Krizek
05a1a0e7b5 Randomize algorithm selection for mkeys test
Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

(cherry picked from commit f65f276f98)
2022-10-27 13:24:52 +02:00
Tom Krizek
e3b5521845 Set algorithms for system tests at runtime
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f)
2022-10-27 13:24:52 +02:00
Tom Krizek
550c0e8964 Script for random algorithm selection in system tests
Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

(cherry picked from commit 5f480c8485)
2022-10-27 13:24:52 +02:00
Tom Krizek
01b4a28d59 Export env variables in system tests
Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

(cherry picked from commit 37d14c69c0)
2022-10-27 13:24:52 +02:00
Tom Krizek
2843d32d00 Support testcrypto.sh usage without including conf.sh
The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

(cherry picked from commit bb1c6bbdc7)
2022-10-27 13:24:52 +02:00
Tom Krizek
798f969043 Unify indentation level in testcrypto.sh
(cherry picked from commit 01b293b055)
2022-10-27 13:24:50 +02:00
Matthijs Mekking
e891053c31 Merge branch '3627-inheritance-bug-remote-server-port-v9_18' into 'v9_18'
[v9_18] Fix inheritance bug when setting port in remote server configuration

See merge request isc-projects/bind9!6993
2022-10-27 10:53:24 +00:00
Matthijs Mekking
2655ee4902 Add release note and change entry for [GL #3627]
(cherry picked from commit 5585256bf6)
2022-10-27 12:18:27 +02:00
Matthijs Mekking
9a05448f13 Fix config bug related to port setting
There are three levels there for the port value, with increasing
priority:

1. The default ports, defined by 'port' and 'tls-port' config options.
2. The primaries-level default port: primaries port <number>  { ... };
3. The primaries element-level port: primaries { <address> port
   <number>; ... };"

In 'named_config_getipandkeylist()', the 'def_port' and 'def_tlsport'
variables are extracted from level 1. The 'port' variable is extracted
from the level 2. Currently if that is unset, it defaults to the
default port ('def_port' or 'def_tlsport' depending on the transport
used), but overrides the level 2 port setting for the next primaries in
the list.

Update the code such that we inherit the port only if the level 3 port
is not set, and inherit from the default ports if the level 2 port is
also not set.

(cherry picked from commit 72d3bf8e4e)
2022-10-27 12:18:18 +02:00
Matthijs Mekking
bf6961c551 Add xfer system test case
Add a test case that if the first primary fails, the fallback of a
second primary on plain DNS works. This is mainly to test that the port
configuration inheritance works correctly.

(cherry picked from commit 622a499027)
2022-10-27 12:18:12 +02:00
Tom Krizek
222a1fc4eb Merge branch '3517-serve-stale-cache-timeout-0-test-v9_18' into 'v9_18'
[v9_18] [CVE-2022-3080] Test serve stale cache with timeout 0 and CNAME

See merge request isc-projects/bind9!6976
2022-10-24 13:00:50 +00:00
Tom Krizek
9a159fc4c4 Remove misleading comment from serve-stale test
The stale-answer-client-timeout option is not set to 0 in the config
neither is it the default value. This was probably caused by a
copy-paste error.
2022-10-24 14:30:43 +02:00
Tom Krizek
3a9ae0249d Test serve stale cache with timeout 0 and CNAME
Add a couple of tests that verify the serve-stale behavior when
stale-answer-client-timeout is set to 0 and a (stale) CNAME record is
queried.

Related #3517
2022-10-24 14:30:41 +02:00
Michał Kępień
b272185c38 Merge branch 'michal/bump-sphinx-version-to-5.3.0-v9_18' into 'v9_18'
[v9_18] Bump Sphinx version to 5.3.0

See merge request isc-projects/bind9!6973
2022-10-24 09:57:41 +00:00
Michał Kępień
da0cd8c6db Bump Sphinx version to 5.3.0
Make the Sphinx version listed in doc/arm/requirements.txt match the
version currently used in GitLab CI, so that Read the Docs builds the
documentation using the same Python software versions as those used in
GitLab CI.

(cherry picked from commit a8f0ab7df6)
2022-10-24 11:45:11 +02:00
Arаm Sаrgsyаn
65467dfcff Merge branch '3603-resolver-prefetch-eligibility-edge-case-bug-v9_18' into 'v9_18'
[v9_18] Synchronize prefetch "trigger" and "eligibility" code and documentation

See merge request isc-projects/bind9!6969
2022-10-21 11:29:08 +00:00
Aram Sargsyan
840cad93c7 Getting the "prefetch" setting from the configuration cannot fail
The "prefetch" setting is in "defaultconf" so it cannot fail, use
INSIST to confirm that.

The 'trigger' and 'eligible' variables are now prefixed with
'prefetch_' and their declaration moved to an upper level, because
there is no more additional code block after this change.

(cherry picked from commit 0227565cf1)
2022-10-21 10:22:51 +00:00
Aram Sargsyan
6d64f9e4ec Fix prefetch "trigger" value's documentation in ARM
For the prefetch "trigger" parameter ARM states that when a cache
record with a lower TTL value is encountered during query processing,
it is refreshed. But in reality, the record is refreshed when the TTL
value is lower or equal to the configured "trigger" value.

Fix the documentation to make it match with with the code.

(cherry picked from commit ef344b1f52)
2022-10-21 10:22:44 +00:00
Aram Sargsyan
b7149536ee Add a CHANGES note for [GL #3603]
(cherry picked from commit 041ffac0d7)
2022-10-21 10:22:37 +00:00
Aram Sargsyan
bb9cc81dd4 Match prefetch eligibility behavior with ARM
ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.

(cherry picked from commit 863f51466e)
2022-10-21 10:22:29 +00:00
Aram Sargsyan
9000b43d46 Add another prefetch check in the resolver system test
The test triggers a prefetch, but fails to check if it acutally
happened, which prevented it from catching a bug when the record's
TTL value matches the configured prefetch eligibility value.

Check that prefetch happened by comparing the TTL values.

(cherry picked from commit 89fa9a6592)
2022-10-21 10:22:23 +00:00
Arаm Sаrgsyаn
ccbd389ed2 Merge branch '3598-adb-quota-might-not-be-decremented-v9_18' into 'v9_18'
[v9_18] Resolve "ADB quota might not be decremented"

See merge request isc-projects/bind9!6967
2022-10-21 10:09:09 +00:00
Aram Sargsyan
192373a26e Add CHANGES and release notes for [GL #3598]
(cherry picked from commit 6f50972e5f)
2022-10-21 09:04:51 +00:00
Aram Sargsyan
64feeba60f Call dns_adb_endudpfetch() on error path, if required
For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.

(cherry picked from commit 5da79e2be0)
2022-10-21 08:36:34 +00:00
Aram Sargsyan
a83a58467d Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.

(cherry picked from commit e4569373ca)
2022-10-21 08:36:34 +00:00
Aram Sargsyan
4a311b9bb4 Unlink the query under cleanup_query
In the cleanup code of fctx_query() function there is a code path
where 'query' is linked to 'fctx' and it is being destroyed.

Make sure that 'query' is unlinked before destroying it.

(cherry picked from commit ac889684c7)
2022-10-21 08:36:34 +00:00
Ondřej Surý
b55f4068ff Merge branch '3270-use-curl-in-statschannel-system-test-v9_18' into 'v9_18'
Replace some raw nc usage in statschannel system test with curl [v9.18]

See merge request isc-projects/bind9!6966
2022-10-20 16:28:29 +00:00