Commit Graph

10940 Commits

Author SHA1 Message Date
Tony Finch
08d0d24d3b A couple of RPZ options were not reconfigured as expected
[bug]	Changes to the RPZ response-policy min-update-interval
	and add-soa options now take effect as expected when
	named is reconfigured. [GL #3740]

(cherry picked from commit d8a3d328db)
2022-12-16 09:53:01 +00:00
Aram Sargsyan
eae5c06e57 Add big SOA serial logging check into the catz system test
Check that the SOA serial numbers printed when updating a catalog zone
is represented correctly for numbers bigger than 2^31.

(cherry picked from commit de232ab446)
2022-12-15 13:31:04 +00:00
Artem Boldariev
e903ce1f3e Extend the 'doth' system test with a Mutual TLS resumption check
This commit adds a simple check to the 'doth' system test which
ensures that session resumption when Mutual TLS is used works as
expected.

(cherry picked from commit d5d31c6ba1)
2022-12-14 18:32:32 +02:00
Tony Finch
24d02d0986 List supported DNSSEC algorithms at log level NOTICE
NOTICE matches the other startup messages. WARNING weirdly
suggests the list is a problem.

(cherry picked from commit 72f8d03cad)
2022-12-14 11:03:48 +00:00
Mark Andrews
d2aa4ad87c Properly initialise local_ndata in isdotlocal in dig
Remove the trailing '\0' so that the length field of the dns_name_t
structure is correct.  The old data just happens to work with
dns_name_issubdomain but would fail with dns_name_equal.

(cherry picked from commit 8ce163bbc5)
2022-12-14 10:30:16 +11:00
Tom Krizek
f4d0b2dca9 Revert "Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'"
This reverts commit 81b6f17e7c, reversing
changes made to ea47a9c100.

It also removes release note 6038, since the fix is reverted.
2022-12-08 10:22:33 +01:00
Mark Andrews
6f998bbe51 Extend dns_db_allrdatasets to control interation results
Add an options parameter to control what rdatasets are returned when
iteratating over the node.  Specific modes will be added later.

(cherry picked from commit 7695c36a5d)
2022-12-07 23:59:36 +00:00
Mark Andrews
52a9db2180 Check TTLs of mixed TTL ANY response with expired records
(cherry picked from commit e49f83499a)
2022-12-07 23:59:36 +00:00
Mark Andrews
f8ce443684 Add reference to +tcp for +ignore
(cherry picked from commit b5951f0411)
2022-12-08 09:29:35 +11:00
Ondřej Surý
5164ba8d71 Fix missing zone_check() call in checkds test
The bad2-dswithdrawn.checkds tests were missing call to the
zone_checks() contributing to intermittent timing failures of the
checkds system test.

(cherry picked from commit 718831bfcc)
2022-12-07 19:34:42 +01:00
Evan Hunt
2b78a2f9fa don't keep stale NXDOMAIN cache entries
when serve-stale is enabled, NXDOMAIN cache entries are no longer
preserved after the normal negative cache TTL, in order to reduce
unnecessary cache memory consumption.

(cherry picked from commit f1485ca145)
2022-12-07 17:21:00 +01:00
Mark Andrews
814ae11d19 Check that restored catalog zone works
Using a restored catalog zone excercised a use-after-free bug.
The test checks that the use-after-free bug is gone and is just
a reasonable behaviour check in its own right.

(cherry picked from commit bca84c8601)
2022-12-07 09:44:35 +11:00
Aram Sargsyan
4ae4f1fd48 Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 21faf44ef7)
2022-12-06 13:46:55 +00:00
Mark Andrews
0569fa0d25 Remember that the port was set in host and nslookup
Set 'port_set = true;' so that the TCP/DOT/DOH code doesn't reset
the port when making connections.

(cherry picked from commit 8caa94bdf1)
2022-12-06 09:21:43 +11:00
Mark Andrews
e1234f66c6 Add checks for 'host'
(cherry picked from commit e9c4192ee5)
2022-12-06 09:21:43 +11:00
Mark Andrews
375918493e Check ANY lookup using nslookup
(cherry picked from commit c367dd1b0b)
2022-12-06 09:21:43 +11:00
Tom Krizek
ca4ebedf02 Add dnstap prerequisite for dnstap system test
(cherry picked from commit 9846c920c3)
2022-12-02 10:45:21 +01:00
Tom Krizek
5a0d5c6e6f Add libnghttp2 prerequisite for doth system test
While some of these tests are for DoT which doesn't require nghttp2,
the server configs won't allow the server to start without nghttp2
support during compile time.

It might be possible to split these tests into DoT and DoH and only
require nghttp2 for DoH tests, but since almost all of our CI jobs are
compiled with nghttp2, we wouldn't gain a lot of coverage, so it's
probably not worth the effort.

(cherry picked from commit f514604613)
2022-12-02 10:45:21 +01:00
Tom Krizek
184f6d25e5 Add lmdb prerequisite for nzd2nzf system test
(cherry picked from commit b1e011e158)
2022-12-02 10:45:21 +01:00
Tom Krizek
8339c60346 Check for pkcs11-tool in keyfromlabel system test
pkcs11-tool which is typically part of the opensc package is required
for the keyfromlabel test.

(cherry picked from commit e9d9f11539)
2022-12-02 10:45:21 +01:00
Tom Krizek
e8f1c7e1fb Use feature-test feature detection in pytests
Avoid using the environment variables for feature detection and use the
feature-test utility instead.

Remove the obsolete environment variables from conf.sh, since they're no
longer used anywhere.

(cherry picked from commit 9730ac4c56)
2022-12-02 10:45:21 +01:00
Tom Krizek
a97a72fb8b Use feature-test to detect feature support in system tests
Previously, there were two different ways to detect feature support.
Either through an environment variable set by configure in conf.sh, or
using the feature-test utility.

It is more simple and consistent to have only one way of detecting the
feature support. Using the feature-test utility seems superior the the
environment variables set by configure.

(cherry picked from commit d24fb1122e)
2022-12-02 10:45:20 +01:00
Tom Krizek
418f7bb0ae Add missing options to feature-test utility
(cherry picked from commit e22d27da71)
2022-12-02 10:45:18 +01:00
Matthijs Mekking
fe910b2cc0 Update serve-stale test messages to include RRtype
(cherry picked from commit 45f7a15785)
2022-11-30 14:29:30 +01:00
Michal Nowak
1d7d504338 Update sources to Clang 15 formatting 2022-11-29 09:14:07 +01:00
Mark Andrews
acdf043360 Fix typo in dig man page '+qr' should be '+noqr'
Reported by Fabian P. Schmidt

(cherry picked from commit 3769266318)
2022-11-29 09:45:36 +11:00
Tony Finch
303cdf8e27 Deduplicate time unit conversion factors
The various factors like NS_PER_MS are now defined in a single place
and the names are no longer inconsistent. I chose the _PER_SEC names
rather than _PER_S because it is slightly more clear in isolation;
but the smaller units are always NS, US, and MS.

(cherry picked from commit 00307fe318)
2022-11-25 14:16:09 +00:00
Tom Krizek
34eda91697 Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.

(cherry picked from commit c100308b7d)
2022-11-25 12:57:46 +01:00
Mark Andrews
f21c770733 Back port @DEFAULT_HMAC@ changes for tsig_key in catz 2022-11-25 10:42:53 +11:00
Mark Andrews
55bcdcf943 Add catalog zone that requires TLS for all transfers
Both the catalog zone (catalog-tls.example) the zone managed using
the catalog zone (tls1.example) require TLS and a TSIG for zone
transfers.

(cherry picked from commit bb66ef2a47)
2022-11-25 09:57:30 +11:00
Matthijs Mekking
556acc0b85 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.

(cherry picked from commit f9845dd128)
2022-11-23 11:19:40 +01:00
Ondřej Surý
0d1c3ef7c2 Deprecate setting operating system limits from named.conf
It was possible to set operating system limits (RLIMIT_DATA,
RLIMIT_STACK, RLIMIT_CORE and RLIMIT_NOFILE) from named.conf.  It's
better to leave these untouched as setting these is responsibility of
the operating system and/or supervisor.

Deprecate the configuration options and remove them in future BIND 9
release.

(cherry picked from commit 379929e052)
2022-11-21 15:57:09 +01:00
Matthijs Mekking
ba2ef65483 Tweak kasp system test script
The retry 3 times when checking signatures did not make sense because
at this point the input file does not change.

Raise the number of retries when checking the apex DNSKEY response to
reduce the number of intermittent failures due to unexpected delays.

(cherry picked from commit 6ef0417274)
2022-11-17 12:31:48 +01:00
Mark Andrews
726aa21913 Add system test for dual-stack-servers with possible DNAME response
Create a zone that triggers DNAME owner name checks in a zone that
is only reachable using a dual stack server.  The answer contains
a name that is higher in the tree than the query name.

e.g.
	foo.v4only.net.	CNAME	v4only.net.
	v4only.net.	A	10.0.0.1

ns4 is serving the test zone (ipv4-only)
ns6 is the root server for this test (dual stacked)
ns7 is acting as the dual stack server (dual stacked)
ns9 is the server under test (ipv6-only)

(cherry picked from commit f946133ec9)
2022-11-17 13:05:12 +11:00
Mark Andrews
c77af4be6f Support starting and stopping IPv6 only servers
Look for $testdir/$server/named.ipv6-only and use
fd92:7065:b8e:ffff::$n instead of 10.53.0.$n to
communicate with the server.

(cherry picked from commit a35c34e10f)
2022-11-17 13:05:12 +11:00
Mark Andrews
4906ae9fe0 Check 'named-checkconf -z' and check-wildcard
Add tests to check the behavior of 'named-checkconf -z' and
check-wildcard setting in named.conf.

(cherry picked from commit 708dadac59)
2022-11-17 10:58:54 +11:00
Mark Andrews
27250ec8d2 named-checkzone -z ignored the check-wildcard option
Lookup and set the wildcard option according to the configuration
settings.  The default is on as per bin/named/config.c.

(cherry picked from commit dfc5c1e018)
2022-11-17 10:54:36 +11:00
Michal Nowak
e30f71f6f1 Replace "sha1sum" with "openssl sha1 -r"
"sha1sum" is part of GNU Coreutils, neither BIND 9 dependency nor POSIX.
Replace it with "openssl sha1 -r" as OpenSSL is BIND 9 dependency.

(cherry picked from commit d34c7ae227)
2022-11-14 21:03:01 +01:00
Michal Nowak
18965b6ecd Rename $HOSTNAME to $HOST_NAME to silence checkbashisms
checkbashisms warns about possible reliance on HOSTNAME environmental
variable which Bash sets to the name of the current host, and some
commands may leverage it:

    possible bashism in builtin/tests.sh line 199 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns1.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 221 ($HOST(TYPE|NAME)):
    grep "^\"$HOSTNAME\"$" dig.out.ns2.$n > /dev/null || ret=1
    possible bashism in builtin/tests.sh line 228 ($HOST(TYPE|NAME)):
    grep "^; NSID: .* (\"$HOSTNAME\")$" dig.out.ns2.$n > /dev/null || ret=1

We don't use the variable this way but rename it to HOST_NAME to silence
the tool.

(cherry picked from commit ae33a8ddea)
2022-11-14 21:03:01 +01:00
Michal Nowak
c13bb5a7c1 Remove no-op assignment from kasp/tests.sh
"next_key_event_threshold" is assigned with
"next_key_event_threshold+i", but "i" is empty (never set, nor used
afterwards).

posh, the Policy-compliant Ordinary SHell, failed on this assignment
with:

    tests.sh:253: : unexpected `end of expression'

(cherry picked from commit 00c3b1e309)
2022-11-14 21:03:01 +01:00
Michal Nowak
d247b6c09e Remove unused $@ array from cds/setup.sh
posh, the Policy-compliant Ordinary SHell, failed with:

    setup.sh:57: @: parameter not set

(cherry picked from commit 02a4a95395)
2022-11-14 21:03:01 +01:00
Michal Nowak
a55099ba5b Drop interpolated string replacement
Interpolated string is Bashism:

    possible bashism in bin/tests/system/engine_pkcs11/setup.sh line 34 ($'...' should be "$(printf '...')"):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-engine_pkcs11" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id 2> pkcs11-tool.err.$zone.$id || return 1
    possible bashism in bin/tests/system/engine_pkcs11/setup.sh line 34 (${parm/?/pat[/str]}):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-engine_pkcs11" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id 2> pkcs11-tool.err.$zone.$id || return 1
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 27 ($'...' should be "$(printf '...')"):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-keyfromlabel" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id || return 1
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 27 (${parm/?/pat[/str]}):
            pkcs11-tool --module $SOFTHSM2_MODULE --token-label "softhsm2-keyfromlabel" -l -k --key-type $type:$bits --label "${label}" --id "${p11id//$'\n'/}" --pin $(cat $PWD/pin) > pkcs11-tool.out.$zone.$id || return 1

The replacement is actually not needed as $p11id holds only one line.

Also see https://www.shellcheck.net/wiki/SC3003 and
https://www.shellcheck.net/wiki/SC3060.

(cherry picked from commit ac3fcb612d)
2022-11-14 21:03:01 +01:00
Michal Nowak
64311314dc Join two rndc lines not to confuse checkbashisms
checkbashisms gets confused by the rndc command being on two lines:

    possible bashism in bin/tests/system/nzd2nzf/tests.sh line 37 (type):
    rndccmd 10.53.0.1 addzone "added.example { type primary; file \"added.db\";

(cherry picked from commit 9eb2f6b0e8)
2022-11-14 21:03:00 +01:00
Michal Nowak
e7e0d1dd0a Replace string comparisons with integer comparisons
checkbashisms reports Bash-style ("==") string comparisons inside test/[
command:

    possible bashism in bin/tests/system/checkconf/tests.sh line 105 (should be 'b = a'):
                    if [ $? == 0 ]; then echo_i "failed"; ret=1; fi
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 62 (should be 'b = a'):
                    test $ret == 0 || continue
    possible bashism in bin/tests/system/keyfromlabel/tests.sh line 79 (should be 'b = a'):
                    test $ret == 0 || continue

(cherry picked from commit 7640fc5b39)
2022-11-14 21:02:59 +01:00
Michal Nowak
5bab6f2104 Add shell interpreter line where missing
The checkbashisms script reports errors like this one:

    script util/check-line-length.sh does not appear to have a #! interpreter line;
    you may get strange results

(cherry picked from commit 9e68997cbb)
2022-11-14 21:02:15 +01:00
Mark Andrews
1de9c05210 Have dns_zt_apply lock the zone table
There were a number of places where the zone table should have been
locked, but wasn't, when dns_zt_apply was called.

Added a isc_rwlocktype_t type parameter to dns_zt_apply and adjusted
all calls to using it.  Removed locks in callers.

(cherry picked from commit f053d5b414)
2022-11-11 15:57:52 +00:00
Ondřej Surý
9e5299db30 Update the HTTP headers test to check for 101 headers
When we bumped the number of allowed HTTP headers to 100, we forgot to
bump the number in the system test.  Bump the number in the system test
too.
2022-11-11 09:25:00 +01:00
Mark Andrews
bc26438979 Use file descriptor 3 to save file.prev
If 'set -x' is in effect file.prev gets populated with debugging output.
To prevent this open descriptor 3 and redirect stderr from the awk
command to descriptor 3. Debugging output will stay directed to stderr.

(cherry picked from commit 10f67938db)
2022-11-08 16:43:58 +00: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
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