Give every view a TSIG key that selects it

Each view's match-clients starts with "key jarl-view-NAME" (after
"!key" for the views listed after it), so a query signed with a view's
key lands in that view from any address. The secrets are derived from a
random seed in Jarl's database. The delegation check signs its queries
to this server's own addresses with the key of the zone's view: before,
they got whichever view matched the server's address, usually internal.
jarl view key / GET /views/{id}/key show a key for dig -k (tsig:write,
audited). jarl-view- key names are reserved; the importer drops view
keys from a configuration Jarl wrote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-10-11 18:19:10 +01:00
1 parent c696d02513
commit 384f6b3060
26 files changed
+463 -16

No files matched your search

+11 -2
View File
@@ -95,6 +95,11 @@ type Checker struct {
// IsLocal reports whether an address belongs to this host (default:
// its interface addresses and loopback).
IsLocal func(netip.Addr) bool
// LocalKey, when set, signs the queries sent to this host's own
// addresses (when they are asked): with views, the key that selects
// the zone's view, so the answer comes from that view and not from
// whichever view matches this host's address.
LocalKey *Key
// Watch, if set, is told about each DNS query the checks send and
// its outcome as it happens (the web UI shows them while it waits).
// It is called from several goroutines at once.
@@ -465,13 +470,17 @@ func (c *Checker) Serials(ctx context.Context, zone string, ref *uint32, targets
}
// Reported here rather than by exchange: the end carries the
// server's status.
id := c.startEvent(digLine(r.Address, port, zone, "SOA", true, t.Key))
key := t.Key
if key == nil && c.LocalKey != nil && IsLocalAddr(ip) {
key = c.LocalKey
}
id := c.startEvent(digLine(r.Address, port, zone, "SOA", true, key))
go func(r Result, key *Key) {
defer wg.Done()
c.soa(ctx, zone, key, ref, &r)
c.endEvent(Event{ID: id, Result: &r, RTTMs: r.RTTMs})
add(r)
}(r, t.Key)
}(r, key)
}
}
wg.Wait()