cut off hives that left the roster: forge token, team seat, token secret, login role
This commit is contained in:
parent
f8a0388457
commit
11fec06a50
2 changed files with 830 additions and 21 deletions
|
|
@ -533,6 +533,10 @@ let
|
|||
capabilities = ["create", "read", "update"]
|
||||
}
|
||||
|
||||
path "${credentialMountPath}/metadata/swarm/hives/+/forge/token" {
|
||||
capabilities = ["delete"]
|
||||
}
|
||||
|
||||
path "${credentialMountPath}/data/swarm/hives/+/squid-selfcheck" {
|
||||
capabilities = ["create", "read"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue