Watch
0
0
Fork
You've already forked hyperhive
0

cut off hives that left the roster: forge token, team seat, token secret, login role

This commit is contained in:
atlas 2026-11-16 21:48:41 +01:00 • committed by mara
commit 11fec06a50

View file

@ -2570,6 +2570,28 @@ let
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/github-token\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/agents/+/backend-env\" {\n capabilities = [\"delete\"]\n}" s;
}
{
# `forge::hive_cutoff` deletes the token secret of a hive that left the
# roster through `delete_all_versions`, which addresses the metadata
# path. `+` is one segment, so the stanza reaches the `forge/token` leaf
# of every hive and no other key under `hives/`: not the attic facts, the
# squid credential, the OIDC client or the archive keys, which carry
# their own stanzas. Pinned as the whole stanza, so a `read` or `list`
# that would expose version history fails. The control is the archive
# revocation's metadata stanza, which the same search must find.
name = "the controller may delete a hive's forge token secret, and no other key of a hive's by that path";
ok =
let
s = baoGrantHere.systemd.services.swarm-bao-controller-policy.script;
in
lib.hasInfix "path \"secret/metadata/swarm/hives/+/forge/token\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/archive/+\" {\n capabilities = [\"delete\"]\n}" s
&& !(lib.hasInfix "secret/metadata/swarm/hives/*" s)
&& !(lib.hasInfix "secret/metadata/swarm/hives/+/forge/*" s)
&& !(lib.hasInfix "secret/metadata/swarm/hives/+/attic" s)
&& !(lib.hasInfix "secret/metadata/swarm/hives/+/squid-selfcheck" s)
&& !(lib.hasInfix "secret/metadata/swarm/hives/+/oidc" s);
}
{
# The swarm appservice token is a homeserver-admin credential. The
# controller mints agents' accounts with it and has no business replacing