Watch
0
0
Fork
You've already forked hyperhive
0

disable a destroyed agent's identity entity and delete its login role

This commit is contained in:
atlas 2026-11-16 16:50:53 +01:00
commit 299b922039

View file

@ -507,3 +507,26 @@ pass mints one for it (also when only the certificate exists and its cert-auth
role is missing) as long as the agent isn't `Destroyed`. A mint that runs after
a hive declares the agent `Destroyed` logs `identity mint skipped` and writes
nothing.
## Cutting a destroyed agent off from the store
Destroying an agent ends its store identity within one five-minute credential
pass. The pass finds each agent that has a cert-auth role (`hive-agent-<agent>`)
and that a hive declares `Destroyed` while no hive declares it in another state.
For each, it turns the agent's identity entity off
(`identity/entity/name/<agent>` with `disabled=true`) and then deletes the role.
The store refuses a turned-off entity's tokens at once, tokens already issued
included, and the deleted role stops the agent's current certificate from
logging in again. A leaked agent key stops working without waiting for the
certificate's seven days to run out. Each cut-off logs one line,
`destroyed agent cut off from the store`, naming the agent. An agent declared on
no hive stays out of it, so an emptied declaration doesn't read as every agent
destroyed.
The role marks that work remains. The entity goes first, so a role delete that
fails leaves the role in place and the next pass runs both steps again. A
failure logs `cutting this destroyed agent off from the store failed` with the
error.
An agent created under the same name gets its entity turned on and its role
written again by the identity mint, in that order, so it logs in as before.