2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

37043 Commits

Author SHA1 Message Date
Evan Hunt
66eaf6bb73 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.
2022-08-31 15:32:24 -07:00
Evan Hunt
aba940dd90 Merge branch '3501-dnstap-response' into 'main'
dnstap query_message field was erroneously set with responses

Closes #3501

See merge request isc-projects/bind9!6701
2022-08-31 22:22:44 +00:00
Evan Hunt
fea9751f13 CHANGES for [GL #3501] 2022-08-31 11:33:54 -07:00
Evan Hunt
3ccfff8ab6 dnstap query_message field was erroneously set with responses
The dnstap query_message field was in some cases being filled in
with response messages, along with the response_message field.
The query_message field should only be used when logging requests,
and the response_message field only when logging responses.
2022-08-31 11:33:25 -07:00
Arаm Sаrgsyаn
692975746f Merge branch '3410-rpz-extended-errors' into 'main'
RPZ Extended DNS Error Codes

Closes #3410

See merge request isc-projects/bind9!6700
2022-08-31 09:21:11 +00:00
Aram Sargsyan
0f9d645582 Add CHANGES note for [GL #3410] 2022-08-31 08:56:03 +00:00
Aram Sargsyan
7eda1aba76 Document RPZ Extended DNS Error (EDE) code configuration option
Add information about the 'ede' option for response policy zones.
2022-08-31 08:56:03 +00:00
Aram Sargsyan
5e4e303ffa Add system tests for RPZ EDE codes
Check the new configuration option's syntax using the 'checkconf' system
test.

Check if the new option works by parsing DiG's output in the 'rpz'
system test.
2022-08-31 08:56:03 +00:00
Aram Sargsyan
83395f4cfb Set the extended DNS error code for RPZ-modified queries
When enabled through a configuration option, set the configured EDE code
for the modified queries.
2022-08-31 08:56:03 +00:00
Aram Sargsyan
77f12ecba7 Add extended DNS error configuration option for RPZ zones
Implement the configuration option with its checking and parsing parts.

The option should be later used by BIND to set an extended error
code (EDE) for the queries modified in the result of RPZ processing.
2022-08-31 08:56:03 +00:00
Arаm Sаrgsyаn
77024e6ad6 Merge branch 'aram/rpz-doc-update' into 'main'
Update RPZ documentation in ARM

See merge request isc-projects/bind9!6705
2022-08-31 08:52:35 +00:00
Aram Sargsyan
0fbd07ac22 Update RPZ documentation
The RPZ documentation section with response policy rules and actions
is incomplete.

Add information about the 'RPZ-CLIENT-IP' rule, and 'TCP-Only' and
'DROP' actions.
2022-08-29 14:04:03 +00:00
Ondřej Surý
7bf8a7ab1b Merge branch 'ondrej-add-isc-loopmgr' into 'main'
Separate the event loop handling into a separate layer

Closes #3508

See merge request isc-projects/bind9!6040
2022-08-26 08:08:42 +00:00
Evan Hunt
92526facb1 CHANGES and release note for [GL #3508] 2022-08-26 09:09:25 +02:00
Ondřej Surý
718e92c31a Clear the callbacks when isc_nm_stoplistening() is called
When we are closing the listening sockets, there's a time window in
which the TCP connection could be accepted although the respective
stoplistening function has already returned to control to the caller.
Clear the accept callback function early, so it doesn't get called when
we are not interested in the incoming connections anymore.
2022-08-26 09:09:25 +02:00
Ondřej Surý
4d07768a09 Remove the isc_app API
The isc_app API is no longer used and has been removed.
2022-08-26 09:09:25 +02:00
Ondřej Surý
37a1be5acc Split netmgr_test into separate per-transport unit tests
The netmgr_test unit test has been subdivided into tcp_test,
tcpdns_test, tls_test, tlsdns_test, and udp_test components.
These have been updated to use the new loopmgr.
2022-08-26 09:09:25 +02:00
Ondřej Surý
b69e783164 Update netmgr, tasks, and applications to use isc_loopmgr
Previously:

* applications were using isc_app as the base unit for running the
  application and signal handling.

* networking was handled in the netmgr layer, which would start a
  number of threads, each with a uv_loop event loop.

* task/event handling was done in the isc_task unit, which used
  netmgr event loops to run the isc_event calls.

In this refactoring:

* the network manager now uses isc_loop instead of maintaining its
  own worker threads and event loops.

* the taskmgr that manages isc_task instances now also uses isc_loopmgr,
  and every isc_task runs on a specific isc_loop bound to the specific
  thread.

* applications have been updated as necessary to use the new API.

* new ISC_LOOP_TEST macros have been added to enable unit tests to
  run isc_loop event loops. unit tests have been updated to use this
  where needed.
2022-08-26 09:09:24 +02:00
Ondřej Surý
49b149f5fd Update isc_timer to use isc_loopmgr
* isc_timer was rewritten using the uv_timer, and isc_timermgr_t was
  completely removed; isc_timer objects are now directly created on the
  isc_loop event loops.

* the isc_timer API has been simplified. the "inactive" timer type has
  been removed; timers are now stopped by calling isc_timer_stop()
  instead of resetting to inactive.

* isc_manager now creates a loop manager rather than a timer manager.

* modules and applications using isc_timer have been updated to use the
  new API.
2022-08-25 17:17:07 +02:00
Ondřej Surý
84c90e223f New event loop handling API
This commit introduces new APIs for applications and signal handling,
intended to replace isc_app for applications built on top of libisc.

* isc_app will be replaced with isc_loopmgr, which handles the
  starting and stopping of applications. In isc_loopmgr, the main
  thread is not blocked, but is part of the working thread set.
  The loop manager will start a number of threads, each with a
  uv_loop event loop running. Setup and teardown functions can be
  assigned which will run when the loop starts and stops, and
  jobs can be scheduled to run in the meantime. When
  isc_loopmgr_shutdown() is run from any the loops, all loops
  will shut down and the application can terminate.

* signal handling will now be handled with a separate isc_signal unit.
  isc_loopmgr only handles SIGTERM and SIGINT for application
  termination, but the application may install additional signal
  handlers, such as SIGHUP as a signal to reload configuration.

* new job running primitives, isc_job and isc_async, have been added.
  Both units schedule callbacks (specifying a callback function and
  argument) on an event loop. The difference is that isc_job unit is
  unlocked and not thread-safe, so it can be used to efficiently
  run jobs in the same thread, while isc_async is thread-safe and
  uses locking, so it can be used to pass jobs from one thread to
  another.

* isc_tid will be used to track the thread ID in isc_loop worker
  threads.

* unit tests have been added for the new APIs.
2022-08-25 12:24:29 +02:00
Ondřej Surý
a26862e653 Simplify the isc_event API
The ev_tag field was never used, and has now been removed.
2022-08-25 12:24:25 +02:00
Mark Andrews
87a6dac92e Merge branch '3505-missing-isc_mutex_destroy' into 'main'
Resolve "missing isc_mutex_destroy"

Closes #3505

See merge request isc-projects/bind9!6696
2022-08-24 07:00:17 +00:00
Mark Andrews
9b7af9d85c Call isc_mutex_destroy(&lasttime_mx); 2022-08-24 16:41:55 +10:00
Matthijs Mekking
29ae5e82ff Merge branch '3500-nsec3-missing-detach-node' into 'main'
nsec3.c: Add a missing dns_db_detachnode() call

Closes #3500

See merge request isc-projects/bind9!6692
2022-08-23 10:03:28 +00:00
Matthijs Mekking
a98f993da8 Add CHANGES entry for #3500
There is no need for a release because this case was nearly impossible
to trigger (except for when 'sig-signing-type' was set to 0).
2022-08-23 11:04:00 +02:00
Matthijs Mekking
e633398010 nsec3.c: Add a missing dns_db_detachnode() call
There is one case in 'dns_nsec3_activex()' where it returns but forgets
to detach the db node. Add the missing 'dns_db_detachnode()' call.

This case only triggers if 'sig-signing-type' (privatetype) is set to 0
(which by default is not), or if the function is called with 'complete'
is set to 'true' (which at this moment do not exist).
2022-08-23 11:01:31 +02:00
Matthijs Mekking
ae14334083 Merge branch '3486-checkconf-dnssec-policy-nsec3-incompatible-algorithm' into 'main'
Graceful dnssec-policy transition from NSEC only to NSEC3

Closes #3486

See merge request isc-projects/bind9!6647
2022-08-22 14:37:07 +00:00
Matthijs Mekking
1c5bbac508 Fix nsec3 system test issues
The wait_for_zone_is_signed function was never called, which could lead
to test failures due to timing issues (where a zone was not fully signed
yet, but the test was trying to verify the zone).

Also add two missing set_nsec3param calls to ensure the ITERATIONS
value is set for these test cases.
2022-08-22 16:36:17 +02:00
Matthijs Mekking
4f2a15b52a Add change entry and release note for #3486
News worthy.
2022-08-22 15:55:47 +02:00
Matthijs Mekking
6e534c1cd1 Add test case for #3486
Add two scenarios where we change the dnssec-policy from using RSASHA1
to something with NSEC3.

The first case should work, as the DS is still in hidden state and we
can basically do anything with DNSSEC.

The second case should fail, because the DS of the predecessor is
published and we can't immediately remove the predecessor DNSKEY. So
in this case we should keep the NSEC chain for a bit longer.

Add two more scenarios where we change the dnssec-policy from using
NSEC3 to something NSEC only. Both should work because there are no
restrictions on using NSEC when it comes to algorithms, but in the
cases where the DS is published we can't bluntly remove the predecessor.

Extend the nsec3 system test by also checking the DNSKEY RRset for the
expected DNSKEY records. This requires some "kasp system"-style setup
for each test (setting key properties and key states). Also move the
dnssec-verify check inside the check_nsec/check_nsec3 functions because
we will have to do that every time.
2022-08-22 15:55:47 +02:00
Matthijs Mekking
501dc87d75 Wait with NSEC3 during a DNSSEC policy change
When doing a dnssec-policy reconfiguration from a zone with NSEC only
keys to a zone that uses NSEC3, figure out to wait with building the
NSEC3 chain.

Previously, BIND 9 would attempt to sign such a zone, but failed to
do so because the NSEC3 chain conflicted with existing DNSKEY records
in the zone that were not compatible with NSEC3.

There exists logic for detecting such a case in the functions
dnskey_sane() (in lib/dns/zone.c) and check_dnssec() (in
lib/ns/update.c). Both functions look very similar so refactor them
to use the same code and call the new function (called
dns_zone_check_dnskey_nsec3()).

Also update the dns_nsec_nseconly() function to take an additional
parameter 'diff' that, if provided, will be checked whether an
offending NSEC only DNSKEY will be deleted from the zone. If so,
this key will not be considered when checking the zone for NSEC only
DNSKEYs. This is needed to allow a transition from an NSEC zone with
NSEC only DNSKEYs to an NSEC3 zone.
2022-08-22 15:55:46 +02:00
Matthijs Mekking
856c0e78a9 Test checkconf NSEC3 and incompatible algorithm
The check code for this already exists, but was untested.
2022-08-19 17:00:10 +02:00
Arаm Sаrgsyаn
a308418d4a Merge branch '3463-httpd.c-non-empty-post-requests-bugfix' into 'main'
Fix statistics channel multiple request processing with non-empty HTTP bodies

Closes #3463

See merge request isc-projects/bind9!6597
2022-08-19 08:32:41 +00:00
Aram Sargsyan
dc9b0ea6a6 Add pipelined POST requests check in the statschannel system test
Use `nc` to check that multiple POST requests with non-empty HTTP
body are serviced normally by the statistics channel.
2022-08-19 08:11:44 +00:00
Aram Sargsyan
3e28d364f6 Replace expr commands with $((expression)) shell constucts
Update the "statschannel" system test to use the $((expression))
shell constucts instead of executing the `expr` program.
2022-08-19 08:11:44 +00:00
Aram Sargsyan
9885306d9a Add CHANGES not for [GL #3463] 2022-08-19 08:11:42 +00:00
Aram Sargsyan
8c4cdd9b21 Fix statistics channel multiple request processing with non-empty bodies
When the HTTP request has a body part after the HTTP headers, it is
not getting processed and is being prepended to the next request's data,
which results in an error when trying to parse it.

Improve the httpd.c:process_request() function with the following
additions:

1. Require that HTTP POST requests must have Content-Length header.
2. When Content-Length header is set, extract its value, and make sure
   that it is valid and that the whole request's body is received before
   processing the request.
3. Discard the request's body by consuming Content-Length worth of data
   in the buffer.
2022-08-19 08:10:54 +00:00
Aram Sargsyan
86b8e62106 Enhance the have_header() function to find the HTTP header's value
Add a new `const char **fvalue` parameter to the httpd.c:have_header()
function which, when set, will point to the found header's value.
2022-08-19 08:10:54 +00:00
Mark Andrews
1c19a6aae8 Merge branch 'bug/main/delv-cfg_parser_reset' into 'main'
Reset bind.keys parser after error on file

See merge request isc-projects/bind9!6468
2022-08-19 05:15:14 +00:00
Mark Andrews
dc8fcbf013 Add CHANGES entry for [GL !6468] 2022-08-19 14:55:26 +10:00
Petr Menšík
65d7427b17 Reset parser before parsing of internal trust anchor
It might be reused if /etc/bind.keys exists, but failed correct parsing.
Release traces of previous parsing attempt of different data.
2022-08-19 14:36:47 +10:00
Mark Andrews
866664d79c Merge branch '3499-duration-c-66-6-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Resolve "duration.c:66:6: warning: array subscript is of type 'char' on NetBSD 9"

Closes #3499

See merge request isc-projects/bind9!6685
2022-08-19 02:28:45 +00:00
Mark Andrews
ea13820023 Silence negative array index warning with toupper
Cast to (unsigned char).
2022-08-19 11:16:00 +10:00
Michal Nowak
ee72d4f2f0 Merge branch 'mnowak/freebsd-13.1' into 'main'
Add FreeBSD 13.1

See merge request isc-projects/bind9!6656
2022-08-18 15:28:21 +00:00
Michal Nowak
cfee4ce4f6 Add FreeBSD 13.1 2022-08-18 17:11:14 +02:00
Artem Boldariev
0c8dee7ec3 Merge branch 'artem-dig-http-plain-get-post-support-fix' into 'main'
DIG: fix handling of +http-plain-get and +http-plain-post options

See merge request isc-projects/bind9!6672
2022-08-18 11:22:25 +00:00
Artem Boldariev
26a66d095c Modify CHANGES (+http-plain-{get, post} support fix in dig)
This commit modifies the CHANGES file to mention that +http-plain-get
and +http-plain-post options support in dig was fixed.
2022-08-18 13:43:00 +03:00
Artem Boldariev
0c6b1f8e8f Modify the doth system test to verify HTTP method usage
Before the commit some checks in the system test would try to verify
that different HTTP methods can be used and are functional. However,
until recently, it was not possible to tell from the output which
method was in fact used, so it turned out that +http-plain-get option
is broken.

This commit add the additional checks to prevent that from happening
in the future.
2022-08-18 13:34:22 +03:00
Artem Boldariev
bd29705a9f DIG: mark HTTP GET method in output
This commit makes dig mark the usage of HTTP(S) GET protocol usage in
its output.
2022-08-18 13:34:22 +03:00
Artem Boldariev
b2f2fed65b DIG: fix handling of +http-plain-{get, post} options
Support for parsing +http-plain-get and +http-plain-post options was
broken. This commit fixes that.
2022-08-18 13:34:21 +03:00