Watch
0
0
Fork
You've already forked hyperhive
0

a removed hive's OIDC client secret is deleted with its other store credentials

This commit is contained in:
maia 2026-11-19 08:02:22 +01:00 • committed by mara
commit 2eacb83b21
2 changed files with 104 additions and 39 deletions

View file

@ -539,6 +539,10 @@ let
capabilities = ["delete"]
}
path "${credentialMountPath}/metadata/swarm/hives/+/oidc/client" {
capabilities = ["delete"]
}
path "${credentialMountPath}/data/swarm/hives/+/squid-selfcheck" {
capabilities = ["create", "read"]
}

View file

@ -1912,12 +1912,16 @@ let
&& lib.hasInfix "path \"secret/data/swarm/hives/+/squid-selfcheck\" {\n capabilities = [\"create\", \"read\"]\n}" s
&& !(lib.hasInfix "secret/data/swarm/hives/*" s)
# The only metadata it reaches under hives is the archive grants (list
# and delete) and the forge token's delete.
# and delete) and the forge token's and the OIDC client's delete.
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/archive/\" {\n capabilities = [\"list\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/archive/+\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/forge/token\" {\n capabilities = [\"delete\"]\n}" s
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/oidc/client\" {\n capabilities = [\"delete\"]\n}" s
&& lib.all (
g: lib.hasInfix "/archive/" g.path || g.path == "secret/metadata/swarm/hives/+/forge/token"
g:
lib.hasInfix "/archive/" g.path
|| g.path == "secret/metadata/swarm/hives/+/forge/token"
|| g.path == "secret/metadata/swarm/hives/+/oidc/client"
) (lib.filter (g: lib.hasPrefix "secret/metadata/swarm/hives" g.path) (grantsIn s));
}
{
@ -2577,11 +2581,12 @@ let
# 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`
# squid credential or the archive keys, which carry their own stanzas.
# `forge::hive_cutoff` deletes the OIDC client secret the same way, under
# a stanza of its own for that one leaf. 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";
name = "the controller may delete a hive's forge token secret and OIDC client secret, and no other key of a hive's by that path";
ok =
let
s = baoGrantHere.systemd.services.swarm-bao-controller-policy.script;
@ -2592,7 +2597,8 @@ let
&& !(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);
&& lib.hasInfix "path \"secret/metadata/swarm/hives/+/oidc/client\" {\n capabilities = [\"delete\"]\n}" s
&& !(lib.hasInfix "secret/metadata/swarm/hives/+/oidc/*" s);
}
{
# The swarm appservice token is a homeserver-admin credential. The