Skip to content

Commit 1ded674

Browse files
committed
add links to integration tests & upgrade/downgrade explanation
1 parent 3a9799e commit 1ded674

File tree

1 file changed

+52
-1
lines changed
  • keps/sig-auth/4193-bound-service-account-token-improvements

1 file changed

+52
-1
lines changed

keps/sig-auth/4193-bound-service-account-token-improvements/README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ For Beta and GA, add links to added tests together with links to k8s-triage for
303303
https://storage.googleapis.com/k8s-triage/index.html
304304
-->
305305

306-
- <test>: <link to test coverage>
306+
`k8s.io/test/integration/sig-auth/svcacct_test.go`
307+
- [TestServiceAccountTokenCreate_bound to a service account and pod](https://github.com/kubernetes/kubernetes/blob/release-1.29/test/integration/auth/svcaccttoken_test.go#L247)
308+
- [TestServiceAccountTokenCreate_bound to service account and a pod with an assigned nodeName that does not exist](https://github.com/kubernetes/kubernetes/blob/release-1.29/test/integration/auth/svcaccttoken_test.go#L415)
309+
- [TestServiceAccountTokenCreate_bound to service account and a pod with an assigned nodeName](https://github.com/kubernetes/kubernetes/blob/release-1.29/test/integration/auth/svcaccttoken_test.go#L416)
310+
- [TestServiceAccountTokenCreate_fails to bind to a Node if the feature gate is disabled](https://github.com/kubernetes/kubernetes/blob/release-1.29/test/integration/auth/svcaccttoken_test.go#L418)
311+
- [TestServiceAccountTokenCreate_bound to service account and node](https://github.com/kubernetes/kubernetes/blob/release-1.29/test/integration/auth/svcaccttoken_test.go#L448)
307312

308313
##### e2e tests
309314

@@ -484,6 +489,52 @@ New metrics that can be used to identify if the feature is in use:
484489

485490
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
486491

492+
**For `ServiceAccountTokenJTI` feature (alpha v1.29, beta v1.30):**
493+
494+
*Without* the feature gate enabled, issued service account tokens *will not* have their `jti` field set to a random UUID,
495+
and the audit log will not persist the issued credential identifier when issuing a token.
496+
497+
*With* the feature gate enabled, issued service accounts will set the `jti` field to a random UUID.
498+
Additionally, the audit event recorded when issuing a new token will have a new annotation added (`authentication.k8s.io/issued-credential-id`).
499+
As a service account's JTI field is used to infer the credential identifier, which forms part of a users `ExtraInfo`,
500+
audit events generated using this newly issued token will also include this JTI (persisted as `authentication.k8s.io/credential-id`).
501+
502+
If the feature is *disabled* and a token is presented that includes a credential identifier, **it will still be persisted into the audit log**
503+
as part of the UserInfo in the audit event.
504+
505+
As none of these fields are actually used for validating/verifying a token is valid, enabling & disabling the feature
506+
does not cause any adverse side effects.
507+
508+
**For `ServiceAccountTokenNodeBinding` (alpha v1.29, beta v1.31) and `ServiceAccountTokenNodeBindingValidation` (alpha v1.29, beta v1.30) feature:**
509+
510+
*Without* the feature gate enabled, service account tokens that have been bound to Node objects will not have their
511+
node reference claims validated (to ensure the referenced node exists).
512+
513+
*With* the feature gate enabled, if a token has a `node` claim contained within it, it'll be validated to ensure the
514+
corresponding Node object actually exists.
515+
516+
Disabling this feature will therefore *relax* the security posture of the cluster in an unexpected way, as tokens that
517+
may have been previously invalid (because their corresponding Node does not exist) may become valid again.
518+
519+
Node bound tokens may only be issued if the `ServiceAccountTokenNodeBinding` feature is enabled, and it is not possible
520+
to enable `ServiceAccountTokenNodeBinding` without `ServiceAccountTokenNodeBindingValidation` being enabled too.
521+
522+
This is further mitigated by graduating the `ServiceAccountTokenNodeBindingValidation` feature one release **earlier**
523+
than `ServiceAccountTokenNodeBinding`.
524+
525+
Tokens that are bound to objects other than Nodes are unaffected.
526+
527+
**For `ServiceAccountTokenPodNodeInfo` feature (alpha v1.29, beta v1.30):**
528+
529+
*Without* the feature gate enabled, tokens that are bound to Pod objects will not include information about the Node
530+
that the pod is scheduled/assigned to.
531+
532+
*With* the feature enabled, newly minted tokens that are bound to Pod objects will include metadata about the Node, namely
533+
the Node's name and UID.
534+
535+
These fields are **not validated** and therefore disabling the feature after enabling it will not cause any adverse side-effects.
536+
537+
``
487538
<!--
488539
Describe manual testing that was done and the outcomes.
489540
Longer term, we may want to require automated upgrade/rollback tests, but we

0 commit comments

Comments
 (0)