Commit Graph

5629 Commits

Author SHA1 Message Date
Aram Sargsyan
5ce2ed0688 Add nsupdate timeout tests
* nsupdate should take 12 seconds (one try and three retries with
  3 second timeout for each), UDP mode
* nsupdate -u 4 -r 1 should take 8 seconds (one try and one retry with
  4 second timeout for each), UDP mode
* nsupdate -u 0 -t 8 -r 1 should also take 8 seconds, UDP mode
* nsupdate -u 4 -t 30 -r 1 should also take 8 seconds, as -u takes
  precedence over -t, UDP mode
* nsupdate -t 8 -v should also take 8 seconds, TCP mode
2023-04-03 15:21:43 +00:00
Matthijs Mekking
3551afe361 Make checkds system test more resilient
The checkds system test could fail if some parent secondary servers did
not yet loaded all the zones before ns9 started sending DS queries. This
leads to SERVFAIL responses, while the test case expects good DS
responses. In order to mitigate against this issue, call 'rndc loadkeys'
to quickly restart the checkds procedure again.

Also refactor the checkds system test, to get rid of the many zone
name duplications. Update the functions 'zone_check' and
'keystate_check' to make the zone name an FQDN so we can just pass
the 'zone' variable into the function.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
03f9e40d1b Determine checkds default from config
If the 'checkds' option is not explicitly set, check if there are
'parental-agents' for the zone configured. If so, default to "explicit",
otherwise default to "yes".
2023-04-03 14:01:22 +00:00
Matthijs Mekking
92577eaf7e Make checkds yes the default
This seems to be the more common case.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
47f7cb0a36 Add two checkds test servers
Add two new checkds test servers, that are hidden secondaries (hidden
as in not published in the NS RRset), that can be used specifically
for testing explicitly configured parental-agents.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
a921cabb8c Remove obsoleted checkds test name servers
These resolver based parental-agents have been replaced by ns3.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
e72b0df50b Implement auto parental-agents (checkds yes)
Implement the new feature, automatic parental-agents. This is enabled
with 'checkds yes'.

When set to 'yes', instead of querying the explicit configured
parental agents, look up the parental agents by resolving the parent
NS records. The found parent NS RRset is considered to be the list
of parental agents that should be queried during a KSK rollover,
looking up the DS RRset corresponding to the key signing keys.

For each NS record, look up the addresses in the ADB. These addresses
will be used to send the DS requests. Count the number of servers and
keep track of how many good DS responses were seen.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
dc651cbf3f Add test case with no empty non-terminals
The previous test cases already test the more complex case where there
are empty non-terminals between the child apex and the parent domain.

Add a test case where this is not the case, to execute the other code
path.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
a2735810d9 Add test cases for 'checkds no'
Add test cases for when checkds is disabled. Copy the test cases that
would have resulted in a DSPublish or DSRemoved and make sure that
with 'checkds no' the metadata is not set.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
6bb862d10f Add test cases for 'checkds yes'
Add the test cases for automatic parental-agents, i.e. when 'checkds'
is set to 'yes'. Split out the special cases that use a reference
or a resolver as parental-agent so that the common use cases can be
tested with the same function.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
226b6e385e Update checkds system test
Make the checkds system test more structured with the many more test
cases to come. Add a README for clarity.

Update the 'has_signed_apex_nsec' helper function so it can take any
domain name regardless of the number of labels.

Change the DNS tree structure such that we have different TLD names
for the various test scenarios, because we need servers that respond
differently to DS queries. Note that this isn't applicable to the
existing "checkds explicit" test cases, but is preparation work for
testing "checkds yes" (automatic parental agents).

Add a trust-anchor to the server that will be querying for parent
NS records.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
06cd8b52db Add new 'checkds' configuration option
Add a new configuration option to set how the checkds method should
work. Acceptable values are 'yes', 'no', and 'explicit'.

When set to 'yes', the checkds method is to lookup the parental agents
by querying the NS records of the parent zone.

When set to 'no', no checkds method is enabled. Users should run
the 'rndc checkds' command to signal that DS records are published and
withdrawn.

When set to 'explicit', the parental agents are explicitly configured
with the 'parental-agents' configuration option.
2023-04-03 14:01:22 +00:00
Mark Andrews
da999a7a1b Define and use DLOPEN_LIBS 2023-04-03 13:31:56 +00:00
Mark Andrews
30b9ebfa2c Handle old <arpa/nameser.h> with old API
Define the types and classes we use from the new API.
2023-04-03 13:31:56 +00:00
Ondřej Surý
4ec9c4a1db Cleanup the last Windows / MSC ifdefs and comments
Cleanup the remnants of MS Compiler bits from <isc/refcount.h>, printing
the information in named/main.c, and cleanup some comments about Windows
that no longer apply.

The bits in picohttpparser.{h,c} were left out, because it's not our
code.
2023-04-03 09:06:20 +00:00
Mark Andrews
f138a1447a forward: Check if TLS is working in FIPS mode
Skip test that depend on TLS working in FIPS mode
2023-04-03 12:44:27 +10:00
Mark Andrews
ffebd217f5 make feature-test --md5 --with-fips aware 2023-04-03 12:44:27 +10:00
Mark Andrews
4e7dadd205 get_algorithms.py: use FIPS compatible bit size
The minimum RSA key size that can be used in FIPS mode is 2048 bits.
2023-04-03 12:44:27 +10:00
Mark Andrews
c80ccf5a25 nsupdate: tls does not work in FIPS mode prior to OpenSSL 3.0.0 2023-04-03 12:44:27 +10:00
Mark Andrews
b82811d0b5 check that 'dnssec-signzone -F' fails for rsasha1 2023-04-03 12:44:27 +10:00
Mark Andrews
826e2563b3 wildcard: Require hypothesis 4.41.2 or greater for FIPS compliance
hypothesis prior to 4.41.2 uses hashlib.md5 which is not FIPS
compliant causing the wildcard system test to fail.  Check if
we are running if FIPS mode and if so make the minimum version
of hypothesis we will accept to be 4.41.2.
2023-04-03 12:44:27 +10:00
Mark Andrews
5da1fb25b1 upforwd: use FIPS compatible key size
Don't override the default key size.
2023-04-03 12:44:27 +10:00
Mark Andrews
56d2bf1141 tsiggss: regenerate kerberos credentials
The existing set of kerberos credential used deprecated algorithms
which are not supported by some implementations in FIPS mode.
Regenerate the saved credentials using more modern algorithms.

Added tsiggss/krb/setup.sh which sets up a test KDC with the required
principals for the system test to work.  The tsiggss system test
needs to be run once with this active and KRB5_CONFIG appropriately.
set.  See tsiggss/tests.sh for an example of how to do this.
2023-04-03 12:44:27 +10:00
Mark Andrews
c3ba38f89f tsiggss: skip test in FIPS mode when DH is broken
'tsiggss' depends on a working DH implementation.  This is not
properly supported in all FIPS implementations.
2023-04-03 12:44:27 +10:00
Mark Andrews
e8177ac605 tsig: only use FIPS compatible HMAC in FIPS mode
HMACMD5 is not permitted in FIPS mode.  Only test HMACMD5 when not
in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
175d0c6d85 tkey: skip TKEY system test in FIPS mode
TKEY uses MD5 which is incompatible with FIPS.
2023-04-03 12:44:27 +10:00
Mark Andrews
0ed16a561e rndc: don't test hmac-md5 in FIPS mode
HMACMD5 is not permitted in FIPS mode.  Only test HMACMD5 when not
in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
ff7e73db6a nsupdate: use FIPS compatible algorithms
HMACMD5 is not permitted in FIPS mode, use HMACSHA256 instead.
2023-04-03 12:44:27 +10:00
Mark Andrews
bcb3846603 nsec3: use fips configuration if rsasha1 is not supported 2023-04-03 12:44:27 +10:00
Mark Andrews
1362360e8f nsec3: skip tests that depend on RSASHA1 in FIPS mode 2023-04-03 12:44:27 +10:00
Mark Andrews
2e997e2248 doth: skip 'doth' test if FIPS mode when DH is broken
'doth' depends on a working DH implementation.
2023-04-03 12:44:27 +10:00
Mark Andrews
530142b2a1 dnssec: check that dnssec-signzone -F work with allowed algorithm 2023-04-03 12:44:27 +10:00
Mark Andrews
78764f99ca dnssec: test dnssec-keygen -F switches to FIPS mode 2023-04-03 12:44:27 +10:00
Mark Andrews
ba6ee5af50 dnssec: check if RSASHA1 is supported by the OS
If not skip RSASHA1 based system tests which are supposed to succeed
even in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
333693ddf5 dnssec: Check validation with short RSA key size FIPS mode
use a pregenerated zone signed with RSASHA1 keys at 1024 bits.
2023-04-03 12:44:27 +10:00
Mark Andrews
ed7750be56 dnssec: Check that RSASHA1 still validates in FIPS mode
Add a pregenerated RSASHA1 signed zone and verify that
answers still validate.
2023-04-03 12:44:27 +10:00
Mark Andrews
ae1109f321 dnssec: use FIPS compatible algorithms and key sizes
RSASHA1 is verify only in FIPS mode.  Use RSASHA256 instead with
key of at least 2048 bits (minimum RSA FIPS size).
2023-04-03 12:44:27 +10:00
Mark Andrews
701ffb2daa Only pass OPENSSL_CONF in the environment if it set
OPENSSL_CONF="" is treated differently to no OPENSSL_CONF in
the environment by OpenSSL.  OPENSSL_CONF="" lead to crypto
failure being reported in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
d42b636d5a named-checkconf needs to know if named will be running in FIPS mode
Call dst_lib_init to set FIPS mode if it was turned on at configure
time.

Check that named-checkconf report that dnssec policies that wont
work in FIPS mode are reported if named would be running in FIPS
mode.
2023-04-03 12:06:04 +10:00
Mark Andrews
d7cc90c032 Add --fips-provider to feature-test
Check that an FIPS provider is available.  This only works with
OpenSSL 3
2023-04-03 12:06:04 +10:00
Mark Andrews
d6d85a6a2d Add --rsasha1 to feature-test 2023-04-03 12:06:04 +10:00
Mark Andrews
6be00b3042 Add --have-fips-dh to feature-test
Diffie-Hellman key echange doesn't appear to work in FIPS mode for
OpenSSL 1.x.x.  Add feature test (--have-fips-dh) to identify builds
where DH key exchanges work (non FIPS builds and OpenSSL 3.0.0+) and
exclude test that would otherwise fail.
2023-04-03 12:06:04 +10:00
Michal Nowak
fe8b41286f Add FIPS-detecting option to feature-test helper
The '--have-fips' option of feature-test detects FIPS mode.
2023-04-03 12:06:04 +10:00
Mark Andrews
805da5bf8f make cfg_kaspkey_fromconfig FIPS aware
- RSASHA1 (5) and NSEC3RSASHA1 (7) are not accepted in FIPS mode
- minimum RSA key size is set to 2048 bit

adjust kasp and checkconf system tests to ensure non FIPS
compliant configurations are not used in FIPS mode
2023-04-03 12:06:04 +10:00
Matthijs Mekking
106497b011 Fix kasp system test bug
This test was succeeding for the wrong reason (policy not found, rather
than bad key length).
2023-03-31 08:33:01 +00:00
Ondřej Surý
2c0a9575d7 Replace __attribute__((unused)) with ISC_ATTR_UNUSED attribute macro
Instead of marking the unused entities with UNUSED(x) macro in the
function body, use a `ISC_ATTR_UNUSED` attribute macro that expans to
C23 [[maybe_unused]] or __attribute__((__unused__)) as fallback.
2023-03-30 23:29:25 +02:00
Evan Hunt
f43de96460 update the rpz tests to use the dummyrpz library
when testing the DNSRPS API, instead of linking to an installed
librpz.so from fastrpz, we now link to the test library. code that
ran dnsrpzd and checked the fastrpz license is now unnecessary and
has been removed.

two dnsrps-specific test cases in rpz (qname_as_ns and ip_as_ns) have
been removed, because they were only supported by fastrpz and do not
work in the test library. in rpzrecurse, nsip-wait-recurse and
nsdname-wait-recurse are now only tested in native mode, due to those
tests being specific to the native implementation.
2023-03-28 18:41:17 -07:00
Mark Andrews
b8b6b10ad2 clean up library
address style issues, unfreed memory, etc.
2023-03-28 18:41:17 -07:00
Evan Hunt
bed8f85ff2 import libdummyrpz test library for DNSRPS
libdummyrpz is a limited version of the fastrpz library for use in
testing the dnsrps API.
2023-03-28 15:44:31 -07:00
Evan Hunt
8806abcaaa test "delv +ns"
add tests for "delv +ns", with and without +qmin and with and without
validation.
2023-03-28 12:41:32 -07:00