Skip to content

Commit 06c52a8

Browse files
authored
Merge pull request kubernetes#4248 from palnabarun/3221/1.29-updates
3221: update KEP according to 1.29 requirements
2 parents 5d39748 + 90d1672 commit 06c52a8

File tree

1 file changed

+33
-29
lines changed
  • keps/sig-auth/3221-structured-authorization-configuration

1 file changed

+33
-29
lines changed

keps/sig-auth/3221-structured-authorization-configuration/README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
- [Future Alpha versions](#future-alpha-versions)
2828
- [Beta](#beta)
2929
- [GA](#ga)
30-
- [GA + 3 cycles](#ga--3-cycles)
3130
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
3231
- [Version Skew Strategy](#version-skew-strategy)
3332
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
@@ -120,6 +119,7 @@ authorizers:
120119
unauthorizedTTL: 30s
121120
timeout: 3s
122121
subjectAccessReviewVersion: v1
122+
matchConditionSubjectAccessReviewVersion: v1
123123
failurePolicy: Deny
124124
connectionInfo:
125125
type: KubeConfig
@@ -180,6 +180,7 @@ authorizers:
180180
unauthorizedTTL: 30s
181181
timeout: 3s
182182
subjectAccessReviewVersion: v1
183+
matchConditionSubjectAccessReviewVersion: v1
183184
failurePolicy: Deny
184185
connectionInfo:
185186
type: KubeConfig
@@ -214,12 +215,13 @@ The below example is only for demonstration purposes.
214215
apiVersion: apiserver.config.k8s.io/v1alpha1
215216
kind: AuthorizationConfiguration
216217
authorizers:
217-
- name: system-webhook
218+
- name: system-crd-protector
218219
type: Webhook
219220
webhook:
220221
unauthorizedTTL: 30s
221222
timeout: 3s
222223
subjectAccessReviewVersion: v1
224+
matchConditionSubjectAccessReviewVersion: v1
223225
failurePolicy: Deny
224226
connectionInfo:
225227
type: KubeConfig
@@ -239,6 +241,7 @@ authorizers:
239241
unauthorizedTTL: 30s
240242
timeout: 3s
241243
subjectAccessReviewVersion: v1
244+
matchConditionSubjectAccessReviewVersion: v1
242245
failurePolicy: Deny
243246
connectionInfo:
244247
type: KubeConfig
@@ -332,13 +335,13 @@ apiVersion: apiserver.config.k8s.io/v1alpha1
332335
kind: AuthorizationConfiguration
333336
authorizers:
334337
- type: Webhook
338+
# Name used to describe the authorizer
339+
# This is explicitly used in monitoring machinery for metrics
340+
# Note:
341+
# - Validation for this field is similar to how K8s labels are validated today.
342+
# Required, with no default
343+
name: webhook
335344
webhook:
336-
# Name used to describe the webhook
337-
# This is explicitly used in monitoring machinery for metrics
338-
# Note:
339-
# - Validation for this field is similar to how K8s labels are validated today.
340-
# Required, with no default
341-
name: super-important-kube-system-authorizer
342345
# The duration to cache 'authorized' responses from the webhook
343346
# authorizer.
344347
# Same as setting `--authorization-webhook-cache-authorized-ttl` flag
@@ -359,6 +362,11 @@ authorizers:
359362
# Required, with no default
360363
# Valid values: v1beta1, v1
361364
subjectAccessReviewVersion: v1
365+
# MatchConditionSubjectAccessReviewVersion specifies the SubjectAccessReview
366+
# version the CEL expressions are evaluated against
367+
# Valid values: v1
368+
# Required, no default value
369+
matchConditionSubjectAccessReviewVersion: v1
362370
# Controls the authorization decision when a webhook request fails to
363371
# complete or returns a malformed response or errors evaluating
364372
# matchConditions.
@@ -405,10 +413,12 @@ authorizers:
405413
# don't intercept requests from kube-system service accounts
406414
- expression: !('system:serviceaccounts:kube-system' in request.user.groups)
407415
- type: Node
416+
name: node
408417
- type: RBAC
418+
name: rbac
409419
- type: Webhook
420+
name: in-cluster-authorizer
410421
webhook:
411-
name: in-cluster-authorizer
412422
authorizedTTL: 5m
413423
unauthorizedTTL: 30s
414424
timeout: 3s
@@ -435,9 +445,11 @@ the version supported by a webhook has to be mentioned using a required field
435445

436446
The user can define a CEL expression to determine whether a request needs to dispatched
437447
to the authz webhook for which the expression has been defined. The user would have access
438-
to a `request` variable containing a `SubjectAccessReview` object in the `v1` version. If
439-
the version specified by `subjectAccessReviewVersion` in the request variable is `v1beta1`,
440-
the contents would be converted to the `v1` version before evaluating the CEL expression.
448+
to a `request` variable containing a `SubjectAccessReview` object in the version specified
449+
by the `matchConditionSubjectAccessReviewVersion` field. If the version specified by
450+
`subjectAccessReviewVersion` in the request variable is `v1beta1`, the contents would be
451+
converted to the version specified in `matchConditionSubjectAccessReviewVersion` before
452+
evaluating the CEL expression.
441453

442454
When no matchConditions are satisfied for a request, the webhook would be skipped. In such
443455
situations, the decision is logged in the audit log with the `authorization.k8s.io/webhook-skipped`
@@ -561,12 +573,6 @@ the scenarios.
561573
#### GA
562574

563575
- Feature flag removed
564-
- Existing command line flags will be marked as deprecated and config file will take
565-
precedence over the old flags
566-
567-
#### GA + 3 cycles
568-
569-
- Remove the existing command line flags
570576

571577
### Upgrade / Downgrade Strategy
572578

@@ -589,7 +595,7 @@ Not applicable.
589595
###### How can this feature be enabled / disabled in a live cluster?
590596

591597
- [x] Feature gate
592-
- Feature gate name: `StructuredAuthorizationConfig`
598+
- Feature gate name: `StructuredAuthorizationConfiguration`
593599
- Components depending on the feature gate:
594600
- kube-apiserver
595601

@@ -612,11 +618,10 @@ We will have extensive unit tests during feature implementation. There would be
612618
for the Authorizer chain in both the old and new configuration scenarios.
613619

614620
We will add integration tests to validate the enablement/disablement flow.
615-
- When the feature is disabled, only the existing command line flag `--authorization-webhook-*`
616-
based mode is allowed.
617-
- When the feature is enable, setting both `--authorization-config` and
618-
configuring an authorization webhook using the `--authorization-webhook-*`
621+
- When `--authorization-config` flags is defined, the feature flag must be turned on (when feature is in Alpha).
622+
- Setting `--authorization-config` along `--authorization-modes` and `--authorization-webhook-*`
619623
command line flags should return an error.
624+
- Configuring the authorizer using legacy flags will continue to be allowed
620625

621626
### Rollout, Upgrade and Rollback Planning
622627

@@ -643,9 +648,7 @@ TBD.
643648

644649
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
645650

646-
Existing command line flags will be marked as deprecated and config file will take
647-
precedence over the old flags once this feature graduates to GA. Then for GA + 3 releases,
648-
the existing command line flags will be removed.
651+
No.
649652

650653
### Monitoring Requirements
651654

@@ -814,9 +817,10 @@ For each of them, fill in the following information by copying the below templat
814817

815818
- [x] 2022-06-10 - Provisional KEP introduced
816819
- [x] 2023-05-08 - Provisional KEP re-introduced
817-
- [ ] KEP Accepted as implementable
818-
- [ ] Implementation started
819-
- [ ] First release (1.YY) when feature available
820+
- [x] 2023-06-15 - KEP Accepted as implementable
821+
- [x] 2023-07-05 - Implementation started
822+
- [x] 2023-09-27 - Update KEP according to actual state
823+
- [ ] 2023-12-DD First release (1.29) when feature available
820824

821825
## Drawbacks
822826

0 commit comments

Comments
 (0)