Vladimír Čunát [Wed, 4 Jun 2025 07:32:14 +0000 (09:32 +0200)]
lib/dnssec: drop incorrect `requirement` and comment
I don't think this can happen on correct records,
due to the way that the root zone is. But we've seen
this assertion happen in real life, and attackers
might be able to misuse it to cause crashes.
Vladimír Čunát [Mon, 7 Jul 2025 12:00:27 +0000 (14:00 +0200)]
lib/cache: simplify logic for qry->flags.CACHE_TRIED
As a side effect, this solves an issue which could be seen
during resolver startup where the trust anchor update would fail.
[taupd ] active refresh failed for . with rcode: 2
The cause is that for queries started with .flags.NO_CACHE,
we'd skip the section setting .flags.CACHE_TRIED, and consequently
kr_rule_local_data_answer() would get run more often than expected.
The new logic should be also much simpler to follow.
We always apply cache (and policy) just once per kr_query.
Vladimír Čunát [Mon, 14 Jul 2025 13:40:48 +0000 (15:40 +0200)]
daemon: add configurability for low source port check
In commit c0482d5a8a this check was added. Now one can e.g. disable by
> require('ffi').C.the_network.min_udp_source_port = 0
(typically used inside YAML config at /lua/script or /lua/script-file)
In particular with ACLs this could have prevented resolver starting
even if the permissions were OK. os.access() should be accurate
at least when running from manager (not from kresctl).
Vladimír Čunát [Thu, 19 Jun 2025 13:38:44 +0000 (15:38 +0200)]
lib/rules: update/more precise default answers for special names
The diff probably shows as messy, but the set of names
doesn't change much. _EMPTY changes to _NXDOMAIN in many cases.
Every name has some text defining the behavior;
it's not very unified, unfortunately.
Now I tried to refer to particular RFC section(s) for each name.
Vladimír Čunát [Wed, 11 Jun 2025 17:22:11 +0000 (19:22 +0200)]
modules/prefill: fix moving across filesystems
I somehow thought thought that `os.rename()` behaves
like the `mv` command, and unfortunately in the way I tested this,
everything was inside a single mount-point.
Official docs is one line that doesn't explain anything really :-/
Brad Cowie [Fri, 30 May 2025 01:57:25 +0000 (13:57 +1200)]
datamodel/templates: fix kr_rule_local_* macros
commit a782e9c3 broke the jinja2 generation of the
kr_rule_local_* macro functions. C.KR_RULE_OPTS_DEFAULT
was provided as an argument to the assert() function call
instead of the call to the corresponding C.kr_rule_local_* function
Vladimír Čunát [Wed, 28 May 2025 12:35:46 +0000 (14:35 +0200)]
datamodel: hide /local-data/rpz/*/dry-run for now
While this can be practical, let's not promise this approach to
configuration until it's more clear how the more general score
will appear in the config.
Vladimír Čunát [Sun, 25 May 2025 08:17:44 +0000 (10:17 +0200)]
prefill: download through a temporary file
File rename is an atomic operation, so that's a plus.
We had a practical issue with the canary process,
as (for me) it exits somewhere during the download; example log:
kresd0[912938]: [prefil] downloading root zone to file root.zone ...
kresd0[912942]: [prefil] root zone file valid for 11 hours 59 minutes, reusing data from disk
kresd0[912942]: [prefil] empty zone file
kresd0[912942]: [prefil] error parsing zone file `root.zone`
kresd0[912942]: [prefil] root zone import failed, retry in 01 seconds
kresd0[912942]: [prefil] downloading root zone to file root.zone ...
kresd0[912942]: [prefil] import started for zone file `root.zone`
kresd0[912942]: [prefil] performance: parsing took 0.832 s, hashing took nan s
kresd0[912942]: [prefil] zone successfully parsed, import started
kresd0[912942]: [prefil] root zone refresh in 11 hours 59 minutes
kresd0[912942]: [prefil] performance: validating and caching took 0.736 s
Also avoid the unnecessary pcall+error. Why throw and immediately catch?
Vladimír Čunát [Sun, 25 May 2025 08:17:44 +0000 (10:17 +0200)]
prefill nit: better error messages
Avoid the ugly cdata<const char *>: 0x7fe6202c7f80
Moreover the return code is -1 in my test case,
but that does not imply EPERM: Operation not permitted.
It was all unnecessary mess, including the pcall+error() pair.
Also avoid some double-wrapping by '[prefil]'.
Vladimír Čunát [Thu, 3 Apr 2025 12:13:28 +0000 (14:13 +0200)]
doc: better build parallelism
`auto` isn't perfect because of nested parallelism,
but I don't see another simple way here,
and I hope the potential slight overload will be OK for docs.