Service account issuance and revocation¶
A service account is a workspace-scoped identity for automation. Its tokens are issued against a record the control plane keeps, so they can be stopped before they expire. This page is the issuance path, the checks around it, and what revocation actually stops.
Issuance¶
flowchart LR
subgraph WS["WORKSPACE"]
direction TB
SA[("Service account<br/>enabled or disabled")]
IT[("Issued tokens<br/>jti, expiry, issuer")]
AU[("Audit")]
end
ISS{{"Issuance<br/>service_account.token.issue"}}
USE{{"Actor resolver<br/>on every request"}}
C["Automation<br/>presents the token"]
ISS -.->|"reads"| SA
ISS -->|"records"| IT
ISS --> AU
C --> USE
USE -.->|"checks jti is active"| IT
The issued-tokens record sits between issuance and every later use. Revoking a token changes that record, and the next request that presents it is checked against the change.
Two refusals come before any token exists:
An account that does not exist in the workspace is 404 service account not
found, and one that exists and is disabled is 409 service account is
disabled.
Disabling an account therefore stops new tokens immediately, which is a different control from revoking the tokens it already has.
What an issued token carries¶
The actor id is derived from the scope rather than chosen, so a service account token is identifiable as one from its subject alone:
actor_id service-account:<workspace_uuid>:<service_account_id>
token_kind service_account
jti the token id, recorded at issuance
workspace_uuid the scope it was issued in
service_account_id which account it belongs to
The lifetime is what the caller requested with a floor of 300 seconds, and the expiry is recorded alongside the token id.
Revocation works because issuance is recorded¶
Every issued token is recorded with its id, kind, actor, scope, the actor that issued it, and its expiry. On every request that presents a service account token, the resolver checks that record:
token_revoked_or_expired the token id is not active
token_validation_error the active check could not be completed
This is the difference between a service account token and an exchanged user token. A service account token can be stopped before its expiry, because the control plane holds a record it is checked against on each use.
A revocation request that names a token belonging to a different service
account is refused with 400 token does not belong to target service account,
so revoking is scoped to the account you named.
Issuance and revocation are both audited¶
Both append an audit record naming the actor, the action, the resource down to the token id, and the reason given. The record of who issued a credential is therefore as durable as the credential's own record.
See Request admission and scope resolution for where the token is checked on each request, and Service accounts for using them.