Commit Graph

42048 Commits

Author SHA1 Message Date
Matthijs Mekking
9e46291211 fix: test: Fix CID 510858: Null ptr derefs in check_keys
Coverity Scan reported a new issue for the ksr system test. There is allegedly a null pointer dereference (FORWARD_NULL) in check_keys().

This popped up because previously we set 'retired' to 0 in case of unlimited lifetime, but we changed it to None.

It is actually a false positive, because if lifetime is unlimited there will be only one key in 'keys'.

However, the code would be better if we always initialized 'active' and if it is not the first key and retired is set, set the successor key's active time to the retire time of the predecessor key.

Closes #5004

Merge branch '5004-cid-510858-ksr-check-keys' into 'main'

See merge request isc-projects/bind9!9687
2024-10-25 11:20:03 +00:00
Matthijs Mekking
e777efb576 Fix CID 510858: Null ptr derefs in check_keys
Coverity Scan reported a new issue for the ksr system test. There
is allegedly a null pointer dereference (FORWARD_NULL) in check_keys().

This popped up because previously we set 'retired' to 0 in case of
unlimited lifetime, but we changed it to None.

It is actually a false positive, because if lifetime is unlimited
there will be only one key in 'keys'.

However, the code would be better if we always initialized 'active'
and if it is not the first key and retired is set, set the successor
key's active time to the retire time of the predecessor key.
2024-10-25 11:19:50 +00:00
Matthijs Mekking
81667b13c7 fix: test: Fix intermittent ksr test failure
A test may fail if the key id is shorter than 5 digits. Add a leading space to the expected strings which start with the key tag to avoid the issue.

Closes #5002

Merge branch '5002-unexpected-match-ksr-twotwone' into 'main'

See merge request isc-projects/bind9!9688
2024-10-25 07:43:28 +00:00
Matthijs Mekking
d5f32f6990 Fix intermittent ksr test failure
The test_ksr_twotwone may fail if the key id is shorter than 5 digits.
Add a leading space to the expected strings which start with the key
tag to avoid the issue.
2024-10-24 14:30:51 +02:00
Nicki Křížek
ac8db8041b fix: test: Make system tests compatible with pytest 8.0.0+
Make system tests symlinks and logged test names consistent across pytest versions.

Merge branch 'nicki/pytest-v8-compat' into 'main'

See merge request isc-projects/bind9!9071
2024-10-24 11:53:54 +00:00
Nicki Křížek
6262d002bf Add legacy.run.sh to .gitignore
While this file is no longer created / used in the main branch, it may
linger around when switching from maintenance branches.
2024-10-24 13:13:13 +02:00
Nicki Křížek
7118cbed98 Make system tests compatible with pytest 8.0.0+
The pytest collection mechanism has been overhauled in pytest 8.0.0,
resulting in a different node tree when collecting the tests. Ensure the
paths / names we're using that are derived from the node tree are
consistent across different pytest versions.

Particularly, this has affected the convenience symlink name (which is
supposed to be in the form of e.g. dns64_sh_dns64 for the dns64 module
and tests_sh_dns64.py module) and the test name that's logged at the
start of the test, which is supposed to include the system test
directory relative to the root system test directory as well as the
module name (e.g. dns64/tests_sh_dns64.py).

Related https://github.com/pytest-dev/pytest/issues/7777
2024-10-24 13:13:13 +02:00
Mark Andrews
4c882e4c0b fix: usr: Use TLS for notifies if configured to do so
Notifies configured to use TLS will now be sent over TLS, instead of plaintext UDP or TCP.
Also, failing to load the TLS configuration for notify now also results in an error.

Closes #4821

Merge branch '4821-notify-over-tls' into 'main'

See merge request isc-projects/bind9!9407
2024-10-24 03:10:38 +00:00
Timo Eisenmann
bbdc6b26aa Use correct certificates for TLS notify tests
Use tls-forward-secrecy instead of tls-expired for tls-x2 and regenerate
the expired certificate for tls-x6 to reflect the swap of ns2 and ns3.
2024-10-24 13:39:59 +11:00
Mark Andrews
87e287c984 swap ns2 and ns3 rolls in tls notify tests
Still need to regenerate the expired certificate as it has
the wrong IP address
2024-10-24 13:39:59 +11:00
Timo Eisenmann
e00beca8c5 Add system tests for notify over TLS
We use ns2 as the primary, and ns3 as the secondary server.
2024-10-24 12:55:01 +11:00
Timo Eisenmann
e9d54d798f Use TLS for notifies if configured to do so 2024-10-24 12:55:01 +11:00
Mark Andrews
a7df51b706 fix: dev: Transport needs to be a selector when looking for an existing dispatch
This allows for dispatch to use existing TCP/HTTPS/TLS etc. streams without accidentally using an unexpected transport.

Closes #4989

Merge branch '4989-fix-transport-use-with-dispatch' into 'main'

See merge request isc-projects/bind9!9633
2024-10-24 01:20:51 +00:00
Mark Andrews
baab8a5d75 Fix TCP dispatches and transport
Dispatch needs to know the transport that is being used over the
TCP connection to correctly allow for it to be reused.  Add a
transport parameter to dns_dispatch_createtcp and dns_dispatch_gettcp
and use it when selecting a TCP socket for reuse.
2024-10-24 11:41:18 +11:00
Evan Hunt
e1588022c1 new: usr: Implement RFC 9567: EDNS Report-Channel option
Add new `send-report-channel` and `log-report-channel` options. `send-report-channel` specifies an agent domain, to which error reports can be sent by querying a specially constructed name within the agent domain. EDNS Report-Channel options will be added to outgoing authoritative responses, to inform clients where to send such queries in the event of a problem.

If a zone is configured which matches the agent domain and has `log-report-channel` set to `yes`, error-reporting queries will be logged at level `info` to the `dns-reporting-agent` logging channel.

Closes #3659

Merge branch '3659-implement-draft-ietf-dnsop-dns-error-reporting' into 'main'

See merge request isc-projects/bind9!7036
2024-10-23 21:29:55 +00:00
Evan Hunt
c6698322c6 suppress report-channel for zones above the agent-domain
RFC 9567 section 8.1 specifies that the agent domain cannot
be a subdomain of the domain it is reporting on. therefore,
in addition to making it illegal to configure that at the
zone level, we also need to disable send-report-channel for
any zone for which the global send-report-channel value is
a subdomain.

we also now warn if send-report-channel is configured
globally to a zone that we host, but that zone doesn't
have log-report-channel set.
2024-10-23 21:29:32 +00:00
Evan Hunt
5bcccf4754 expand validity checks for send-report-channel
when configured at the zone level, send-report-channel cannot be
a subdomain of the zone name.
2024-10-23 21:29:32 +00:00
Evan Hunt
1cd0d291d3 enforce '*._er' requirement for error-reporting zones
if "log-report-channel" is set to "yes", then the zone must
contain a wildcard name matching '*._er' with a TXT record.
2024-10-23 21:29:32 +00:00
Evan Hunt
d60324891c set up logging functionality using log-report-channel
the logging of error-report queries is no longer activated by
the view's "send-report-channel" option; that now only configures
the agent-domain value that is to be sent in authoritative
responses. the warning that was logged when "send-agent-domain"
was set to a value that is not a locally configured zone has
been removed.

error-report logging is now activated by the presence of an
authoritative zone with the "log-report-channel" option set to
"yes".  this is not permitted in the root zone.

NOTE: a zone with "log-report-channel yes;" should contain a
"*._er" wildcard, but that requirement is not yet enforced.
2024-10-23 21:29:32 +00:00
Evan Hunt
5519dd2669 add log-report-channel zone option
add a boolean "log-report-channel" option for primary and
secondary zones, which sets the DNS_ZONEOPT_LOGREPORTS zone
flag. this option is not yet functional.
2024-10-23 21:29:32 +00:00
Mark Andrews
c676fd2566 Allow send-report-channel to be set at the zone level
If send-report-channel is set at the zone level, it will
be stored in the zone object and used instead of the
view-level agent-domain when constructing the EDNS
Report-Channel option.
2024-10-23 21:29:32 +00:00
Mark Andrews
ac1c60d87e Add send-report-channel option
This commit adds support for the EDNS Report-Channel option,
which is returned in authoritative responses when EDNS is in use.

"send-report-channel" sets the Agent-Domain value that will be
included in EDNS Report-Channel options.  This is configurable at
the options/view level; the value is a DNS name. Setting the
Agent-Domain to the root zone (".") disables the option.

When this value has been set, incoming queries matchng the form
_er.<qtype>.<qname>.<extended-error-code>._er.<agent-domain>/TXT
will be logged to the dns-reporting-agent channel at INFO level.

(Note: error reporting queries will only be accepted if sent via
TCP or with a good server cookie.  If neither is present, named
returns BADCOOKIE to complete the DNS COOKIE handshake, or TC=1
to switch the client to TCP.)
2024-10-23 21:29:32 +00:00
Mark Andrews
80f611afe6 new: usr: Add detailed debugging of update-policy rule matching
This logs how named determines if an update request is granted or denied when using update-policy.

Closes #4751

Merge branch '4751-provide-debug-level-logging-of-update-policy' into 'main'

See merge request isc-projects/bind9!9074
2024-10-23 20:29:11 +00:00
Mark Andrews
0d65af8bf2 Check update-policy logs 2024-10-23 10:48:43 +11:00
Mark Andrews
b7a13cf2c1 Add per rule logging of dns_ssutable_checkrules processing
These are logged to the update category at debug level 99 and
have the following form.

    update-policy: using: signer=ddns-key.example.nil, name=updated.example.nil, addr=10.53.0.1, tcp=0, type=A, target=
    update-policy: trying: grant zonesub-key.example.nil zonesub TXT
    update-policy: next rule: signer does not match identity
    update-policy: trying: grant ddns-key.example.nil zonesub ANY
    update-policy: matched: grant ddns-key.example.nil zonesub ANY

or

    update-policy: using: signer=restricted.example.nil, name=example.nil, addr=10.53.0.1, tcp=0, type=TXT, target=
    update-policy: trying: grant zonesub-key.example.nil zonesub TXT
    update-policy: next rule: signer does not match identity
    update-policy: trying: grant ddns-key.example.nil zonesub ANY
    update-policy: next rule: signer does not match identity
    update-policy: trying: grant restricted.example.nil zonesub ANY
    update-policy: next rule: name/subdomain mismatch
    update-policy: no match found

where 'using:' is the calling parameters of dns_ssutable_checkrules,
'trying:' in the rule bing evaluated, "next rule:" is the reason
the rule does not match, "matched:" repeats the matched rule, and
no match found is reported when te set of rules is exhausted.
2024-10-23 08:35:08 +11:00
Mark Andrews
d282e5a66e Add log category update-policy 2024-10-23 08:30:59 +11:00
Nicki Křížek
de8d94f938 fix: test: Use UTC timezone when handling keys in kasp test library
When working with key timestamps, ensure we correctly set the UTC
timezone in order for the tests to work consistently regardless of the
local time setting.

Closes #4999

Merge branch '4999-pytest-kasp-use-utc-timezone' into 'main'

See merge request isc-projects/bind9!9673
2024-10-22 08:20:25 +00:00
Nicki Křížek
46810be809 Set TZ to Australia/Sydney for bookworm CI job
Use a different timezone via the TZ variable in at least one of the
system test jobs in order to detect possible issues with timezone
handling in python.
2024-10-22 09:17:19 +02:00
Nicki Křížek
f840deba33 Use UTC timezone when handling keys in kasp test library
When working with key timestamps, ensure we correctly set the UTC
timezone in order for the tests to work consistently regardless of the
local time setting.
2024-10-22 09:17:19 +02:00
Mark Andrews
6ea2ac5f94 fix: usr: Parsing of hostnames in rndc.conf was broken
When DSCP support was removed, parsing of hostnames in rndc.conf was accidentally broken, resulting in an assertion failure.  This has been fixed.

Closes #4991

Merge branch '4991-rndc-fix-parsing-hostnames' into 'main'

See merge request isc-projects/bind9!9669
2024-10-22 00:11:39 +00:00
Mark Andrews
5a78f6b21b Add regression test for [GL #4991] 2024-10-22 10:34:12 +11:00
Mark Andrews
6c095f89f5 Fix parsing of hostnames in rndc.conf
When DSCP was removed the parsing of hostnames was accidentally
broken resulting in an assertion failure.  Call cfg_parse_tuple
rather than using custom code in parse_sockaddrnameport.
2024-10-22 10:30:07 +11:00
Michal Nowak
7c2aafe03f chg: test: Rewrite verify system test to pytest
Merge branch 'mnowak/pytest_rewrite_verify' into 'main'

See merge request isc-projects/bind9!9249
2024-10-21 11:59:00 +00:00
Michal Nowak
091968f5fa Rewrite verify system test to pytest 2024-10-21 11:58:35 +00:00
Nicki Křížek
b8aa6e7c54 chg: doc: Review BIND ARM (9.20 updates)
Forward-port of !9508

Closes #4945

Merge branch '4945-bind-arm-review-9.20-updates' into 'main'

See merge request isc-projects/bind9!9668
2024-10-21 11:50:39 +00:00
Suzanne Goldlust
d645014232 Review and update ARM documentation
Minor edits and fixes for the documentation added from 9.18.28 through
9.20.0.

(cherry picked from commit 998c61c1cf)
2024-10-21 12:55:14 +02:00
Michal Nowak
e122d9428c chg: test: xfail upforwd system test if DNSTAP is enabled
See isc-projects/bind9#4996

Merge branch 'mnowak/mark-upforwd-xfail' into 'main'

See merge request isc-projects/bind9!9662
2024-10-21 10:52:26 +00:00
Michal Nowak
0579e0a429 xfail upforwd system test if DNSTAP is enabled 2024-10-21 12:04:56 +02:00
Michal Nowak
a8b70abca1 Add with_dnstap mark 2024-10-21 12:04:56 +02:00
Michal Nowak
64fafba6b9 fix: doc: All footnotes need to have unique name and be referenced
With Sphinx 8.1.0, footnotes can't stand on their own and have to be
referenced from somewhere, otherwise build fails, e.g.:

    doc/dnssec-guide/signing.rst:1470: WARNING: Footnote [#] is not referenced. [ref.footnote]

Merge branch 'mnowak/fix-dnssec-guide-footnote' into 'main'

See merge request isc-projects/bind9!9663
2024-10-21 07:23:10 +00:00
Michal Nowak
bdf8859e2d All footnotes need to have unique name and be referenced
With Sphinx 8.1.0, footnotes can't stand on their own and have to be
referenced from somewhere, otherwise build fails, e.g.:

    doc/dnssec-guide/signing.rst:1470: WARNING: Footnote [#] is not referenced. [ref.footnote]
2024-10-21 07:22:36 +00:00
Evan Hunt
923b915797 fix: nil: corrected code style errors
- add missing brackets around one-line statements
- add paretheses around return values

Merge branch 'each-style-corrections' into 'main'

See merge request isc-projects/bind9!9664
2024-10-18 19:31:40 +00:00
Evan Hunt
5ea1f6390d corrected code style errors
- add missing brackets around one-line statements
- add paretheses around return values
2024-10-18 19:31:27 +00:00
Mark Andrews
8467449407 fix: usr: Restore values when dig prints command line
Options of the form `[+-]option=<value>` failed to display the value on the printed command line. This has been fixed.

Closes #4993

Merge branch '4993-dig-restore-command-line-values' into 'main'

See merge request isc-projects/bind9!9653
2024-10-18 02:09:38 +00:00
Mark Andrews
df5b4ba894 Correctly get final token 2024-10-18 01:24:32 +00:00
Mark Andrews
609d96aa12 Restore seperator values
strtok_r is destructive.  Restore the seperators so that the command
line can be properly displayed.
2024-10-18 01:24:32 +00:00
Aydın Mercan
54c5a8e962 fix: import missing definitions for fips builds
FIPS build of libisc failed from some missing definitions.

Closes #4994

Merge branch '4994-crypto-c-174-7-error-implicit-declaration-of-function-isc_fips_mode' into 'main'

See merge request isc-projects/bind9!9655
2024-10-17 14:54:52 +00:00
Aydın Mercan
0b0f05215c include missing definitions for fips builds 2024-10-17 15:28:31 +03:00
Michal Nowak
84316dcf47 chg: doc: Read the Docs should always source requirements.txt from "main"
HTTP URI of doc/arm/requirements.txt on the "main" branch is the source
of PyPI packages in CI base image. To make it consistent in all
maintained CI branches on RTD, use the HTTP URI as well.

This change is non-material on the "main" branch, but ensures the right
packages on stable branches where for RTD we currently leverage outdated
packages because we failed to update doc/arm/requirements.txt there.

Merge branch 'mnowak/rtd-always-resource-requirements-txt-from-main' into 'main'

See merge request isc-projects/bind9!9630
2024-10-17 10:47:11 +00:00
Michal Nowak
8fb6115492 Read the Docs should always source requirements.txt from "main"
HTTP URI of doc/arm/requirements.txt on the "main" branch is the source
of PyPI packages in CI base image. To make it consistent in all
maintained CI branches on RTD, use the HTTP URI as well.

This change is non-material on the "main" branch, but ensures the right
packages on stable branches where for RTD we currently leverage outdated
packages because we failed to update doc/arm/requirements.txt there.
2024-10-17 12:11:08 +02:00