Vladimír Čunát [Mon, 14 Mar 2022 14:27:54 +0000 (15:27 +0100)]
predict docs: be more explicit about recommended use
We're still run into people who thought that the example config
is a suitable default. Example where it caused practical issues:
https://lists.nic.cz/hyperkitty/list/knot-resolver-users@lists.nic.cz/thread/WQDJJ3LLEIZ5U3VVSCITW6DZPICW4L7U/
CI rp:fwd-tls6.udp-asan now repeatedly shows use-after-free.
That could be a serious issue, and this commit's feature
seems less important than the risk. Let's revert until the issue
gets deeper investigation.
Vladimír Čunát [Mon, 7 Mar 2022 17:04:05 +0000 (18:04 +0100)]
lib/selection: fix interaction of timeouts with reboots
We use "monotonic" time-stamps for the dead_since field;
that breaks on system reboots, in which case we reset the stats.
(if the server was categorized as dead)
If the server times out afterwards, we'd fail the condition
`cur_state.consecutive_timeouts == old_state.consecutive_timeouts`
so its stats would not update. Therefore we'd get stuck forever
in a state where the unusable server has high priority (no_rtt_info).
This commit changes a bit more than was necessary to fix this,
including precision of the stats (in some cases).
Vladimír Čunát [Fri, 4 Mar 2022 11:55:55 +0000 (12:55 +0100)]
lib/selection: improve randomness of ties
The approach was dubious: random shuffle, qsort() and choose the first.
The main functional problem was that qsort() isn't a stable sort,
so the effect of pre-shuffling is not reliable, even though I don't have
any evidence of this causing issues in practice.
The new code should also be a bit more efficient in terms of CPU and
consumed randomness, but that probably won't be noticeable.
The arrays passed into select_transport() are now const (no sorting),
which could make the code easier to "understand".
Vladimír Čunát [Tue, 8 Feb 2022 11:46:55 +0000 (12:46 +0100)]
modules/dnstap: don't do anything on loading the module
Usually in configuration the module is loaded in a separate command
from passing configuration to it. For dnstap this loading would
immediately lead to opening the default socket path, even if the
configuration actually specifies (a different) path later.
Users can still force using the default by passing an empty table:
`dnstap.config({})` or `modules = { dnstap = {}}`
(though I doubt the utility of the default /tmp/dnstap.sock anyway)
Vladimír Čunát [Thu, 20 Jan 2022 18:43:40 +0000 (19:43 +0100)]
lib/dnssec: conditionally ignore SHA1 DS, as SHOULD by RFC4509
We're a bit late with this ad-hoc rule; I think it was most useful
when SHA256 support in DS algorithms wasn't wide-spread yet.
(Note that DNSKEY algos have standardized no similar rule.)
Usage of SHA1 as DS algorithm is highly discouraged, but even at this
point it does *not* seem unsafe, in the sense of anyone publishing an
attack that would come anywhere close to breaking *this* usage of SHA1.
Tomas Krizek [Tue, 21 Dec 2021 15:38:45 +0000 (16:38 +0100)]
pytests: migrate to LXC runner
Due to missing support on some of the regular runners, let's migrate
these tests to our special LXC runners. This should hopefully make the
results more reliable and stable.
The downside is that we have to keep an additional image (and recipe)
for LXC, since it' slightly different. However, it's probably worth it,
since we'll likely migrate some other tests there in the future (for
better stability).
Vladimír Čunát [Mon, 10 Jan 2022 18:23:26 +0000 (19:23 +0100)]
doc: fix links to our mailing lists
Their implementation was changed.
Fortunately I was able to find the message in Google's cache
and thus discover easily which one it is in the new archive.
Vladimír Čunát [Fri, 3 Dec 2021 10:02:01 +0000 (11:02 +0100)]
daemon/zimport: rewrite, support ZONEMD
The approach of the code was rather hacky, simulating some packets
arriving from upstream and making the module stack CONSUME that.
Instead we take a direct approach now: use the simplified validator API
and then insert into cache directly.
One effect is improved performance, and consequently roughly halving
the lag which happens when prefill module invokes this.
(With root zone the lag goes down to 0.1 s from over 0.2 s,
on my relatively fast CPU. Fortunately it's just once a day.)
Tomas Krizek [Wed, 15 Dec 2021 15:11:46 +0000 (16:11 +0100)]
policy: log selected actions
The following actions will now be logged in debug level (or request
tracing): ANSWER, DENY, DENY_MSG, DROP, REFUSE, TC
This can be useful for RPZ and other policy debugging.
Purposefully ommitted actions:
PASS - since it's the same as normal processing
REROUTE - the action itself comes from renumber module
STUB,FORWARD,TLS_FORWARD - this could be more confusing than useful
(e.g. when response comes from cache)