Skip to content

Commit 7b03fd4

Browse files
authored
service-accounts-admin.md: Explain invalidating short-lived tokens
1 parent a371603 commit 7b03fd4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

content/en/docs/reference/access-authn-authz/service-accounts-admin.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ time. Please refer to [auto-generated legacy ServiceAccount token clean up](#aut
506506

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

509+
### Delete/invalidate a long-lived/legacy ServiceAccount token {#delete-legacy-token}
510+
509511
If you know the name of the Secret that contains the token you want to remove:
510512

511513
```shell
@@ -544,6 +546,17 @@ Then, delete the Secret you now know the name of:
544546
kubectl -n examplens delete secret/example-automated-thing-token-zyxwv
545547
```
546548

549+
### Delete/invalidate a short-lived ServiceAccount token {#delete-short-lived}
550+
551+
Short lived ServiceAccount tokens automatically expire after the amount
552+
specified during their creation. There is no central record of tokens issued,
553+
so there is no way to revoke individual tokens.
554+
555+
If you absolutely have to revoke a short-lived token before its expiration, you
556+
can delete and re-create the ServiceAccount it is associated to. This will
557+
change its UID and hence invalidate **all** ServiceAccount tokens that were
558+
created for it.
559+
547560
## Clean up
548561

549562
If you created a namespace `examplens` to experiment with, you can remove it:

0 commit comments

Comments
 (0)