add one shared templated agent policy and name each agent's bao entity after it
This commit is contained in:
parent
d893097ffe
commit
4cdf807afc
9 changed files with 777 additions and 13 deletions
|
|
@ -384,6 +384,20 @@ nothing else: `read` on the values there and `list` on their names.
|
|||
agent's at its own start, so a change to it reaches existing agents with the
|
||||
next controller restart.
|
||||
|
||||
The agent's cert-auth role attaches a second policy, `hive-agent`, shared by
|
||||
all agents. It states the same rule with `{{identity.entity.name}}` where the
|
||||
per-agent policy has the agent's name, so the rule is one document. For that
|
||||
the controller names each agent's identity entity after the agent: at agent
|
||||
creation, and for every agent at its own start, it reads the cert mount's
|
||||
accessor and creates the entity `<agent>` with the alias `hive-agent-<agent>`,
|
||||
or renames the entity a first login created under a generated name. When the alias
|
||||
sits on any other entity, the controller logs an error and changes nothing. It needs
|
||||
the `identity/` and `sys/auth/cert` grants in `swarm-bao.nix`'s
|
||||
`controllerPolicyText` for that. Without them it logs a warning and the agent
|
||||
keeps working through its own policy, which stays attached until every agent
|
||||
has its entity. An agent's role gains `hive-agent` at its next certificate
|
||||
mint.
|
||||
|
||||
### Per-principal identities
|
||||
|
||||
Bao matches a cert-auth role on the certificate's subject, so a certificate is an
|
||||
|
|
|
|||
Loading…
Reference in a new issue