Skip to content

service-accounts-admin.md: Explain invalidating short-lived tokens #48981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ time. Please refer to [auto-generated legacy ServiceAccount token clean up](#aut

## Delete/invalidate a ServiceAccount token {#delete-token}

### Delete/invalidate a long-lived/legacy ServiceAccount token {#delete-legacy-token}

If you know the name of the Secret that contains the token you want to remove:

```shell
Expand Down Expand Up @@ -615,6 +617,17 @@ Then, delete the Secret you now know the name of:
kubectl -n examplens delete secret/example-automated-thing-token-zyxwv
```

### Delete/invalidate a short-lived ServiceAccount token {#delete-short-lived}

Short lived ServiceAccount tokens automatically expire after the time-limit
specified during their creation. There is no central record of tokens issued,
so there is no way to revoke individual tokens.

If you have to revoke a short-lived token before its expiration, you
can delete and re-create the ServiceAccount it is associated to. This will
change its UID and hence invalidate **all** ServiceAccount tokens that were
created for it.

## External ServiceAccount token signing and key management

{{< feature-state feature_gate_name="ExternalServiceAccountTokenSigner" >}}
Expand Down