@@ -88,12 +88,13 @@ is unreachable.
88
88
- Define a configuration file format for configuring Kubernetes API Server
89
89
Authorization chain.
90
90
- Allow ordered definition of authorization modes.
91
- - Allow definition of multiple webhooks in the authorization chain.
91
+ - Allow definition of multiple webhooks in the authorization chain while all
92
+ other types of authorizers should only be specified once.
92
93
- Allow resource/user based pre-filtering of webhooks using CEL to prevent unnecessary
93
94
invocations.
94
95
- Enable user to define the policy when a webhook can't be reached due to
95
96
network errors etc.
96
- - Enable hot reload of the configuration.
97
+ - Enable automatic reload of the configuration.
97
98
98
99
### Non-Goals
99
100
@@ -187,11 +188,9 @@ authorizers:
187
188
# only intercept requests to kube-system (assumption i)
188
189
- expression: request.resourceAttributes.namespace == 'kube-system'
189
190
# don't intercept requests from kube-system service accounts
190
- - expression: !('system:serviceaccounts:kube-kube-superuser' in request.user.groups)
191
- # only intercept update, delete and deletecollection requests
192
- - expression: request.resourceAttributes.verb == 'update'
193
- - expression: request.resourceAttributes.verb == 'delete'
194
- - expression: request.resourceAttributes.verb == 'deletecollection'
191
+ - expression: !('system:serviceaccounts:kube-system' in request.user.groups)
192
+ # only intercept update, delete or deletecollection requests
193
+ - expression: request.resourceAttributes.verb in ['update', 'delete','deletecollection']
195
194
- type: Node
196
195
- type: RBAC
197
196
` ` `
@@ -252,7 +251,7 @@ authorizers:
252
251
# ### Story 3: Denying requests on certain scenarios
253
252
254
253
The authorizer chain should be powerful enough to deny anyone making a request
255
- if certain conditions are satisfied.
254
+ if certain conditions are satisfied, except for the `system:masters` user group .
256
255
257
256
# ### Story 4: Controlling access of a privileged RBAC role
258
257
@@ -298,7 +297,8 @@ The configuration would be validated at startup and the API server will fail to
298
297
start if the configuration is invalid.
299
298
300
299
The API server will periodically reload the configuration at a specific time
301
- interval. If it changes, the new configuration will be used for the Authorizer
300
+ interval. If it or any of referenced files change, and the new configuration
301
+ passes validation, then the new configuration will be used for the Authorizer
302
302
chain. The reloader will also check if the webhook is healthy, thereby
303
303
preventing any typo/misconfiguration with the Webhook resulting in bad
304
304
Authorizer config. If healthcheck on the webhook failed, the last known good
@@ -322,10 +322,10 @@ authorizers:
322
322
# Name used to describe the webhook
323
323
# This is explicitly used in monitoring machinery for metrics
324
324
# Note:
325
- # - Do exercise caution when setting the value
326
325
# - If not specified, the default would be set to ""
327
326
# - If there are multiple webhooks in the authorizer chain,
328
327
# this field is required
328
+ # - Validation for this field is similar to how K8s labels are validated today.
329
329
name: super-important-kube-system-authorizer
330
330
# The duration to cache 'authorized' responses from the webhook
331
331
# authorizer.
@@ -373,11 +373,11 @@ authorizers:
373
373
# There are a maximum of 64 match conditions allowed.
374
374
#
375
375
# The exact matching logic is (in order):
376
- # 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped.
377
- # 2. If ALL matchConditions evaluate to TRUE, the webhook is called.
378
- # 3. If any matchCondition evaluates to an error (but none are FALSE):
379
- # - If failurePolicy=Deny, reject the request
380
- # - If failurePolicy=NoOpinion, the error is ignored and the webhook is skipped
376
+ # 1. If at least one matchCondition evaluates to FALSE, then the webhook is skipped.
377
+ # 2. If ALL matchConditions evaluate to TRUE, then the webhook is called.
378
+ # 3. If at least one matchCondition evaluates to an error (but none are FALSE):
379
+ # - If failurePolicy=Deny, then the webhook rejects the request
380
+ # - If failurePolicy=NoOpinion, then the error is ignored and the webhook is skipped
381
381
matchConditions :
382
382
# expression represents the expression which will be evaluated by CEL. Must evaluate to bool.
383
383
# CEL expressions have access to the contents of the SubjectAccessReview
@@ -405,7 +405,7 @@ authorizers:
405
405
` ` `
406
406
407
407
Validation will allow multiple authorizers of type "Webhook" to be added to the
408
- config, but one authorizer each for other types. The ordering of this chain will
408
+ config, but at most one authorizer each for other types. The ordering of this chain will
409
409
be decided by the order specified in the file.
410
410
411
411
The keys ` kubeConfigFile`, `authorizedTTL`, `unauthorizedTTL` and
@@ -425,11 +425,11 @@ to a `request` variable containing a `SubjectAccessReview` object in the version
425
425
by `subjectAccessReviewVersion`.
426
426
427
427
When no matchConditions are satisfied for a request, the webhook would be skipped. In such
428
- situations, the decision is logged in the audit log with the `webhook_skipped ` annotation.
428
+ situations, the decision is logged in the audit log with the `webhookskipped.k8s.io ` annotation.
429
429
Benefit of this is that resource and user info will also be logged.
430
430
431
- The code path for enabling the above will only be triggered if the feature flag is enabled until
432
- the feature flag is removed and this feature graduates to GA .
431
+ The code path for enabling the above will only be triggered if the feature flag is enabled
432
+ while the feature is in alpha and beta .
433
433
434
434
# ## Monitoring
435
435
@@ -445,7 +445,9 @@ Labels {along with possible values}:
445
445
- ` decision` {Allow, Deny}
446
446
447
447
**Note:** Some examples of <authorizer_name>: `RBAC`, `Node`, `ABAC`, `webhook{,_<name>}`.
448
- If there is only one webhook, there would be no `_<name>` suffix.
448
+ If there is only one webhook and no name specified, there would be no `_<name>` suffix.
449
+ If the webhook has a named specified, even if there is only one webhook, then the name
450
+ should be in the metrics and exposed via the metrics endpoint.
449
451
450
452
2. `apiserver_authorization_webhook_evaluations_total`
451
453
@@ -515,6 +517,9 @@ authorization configuration file (feature flag turned on)
515
517
- with a webhook - successful request
516
518
- with a webhook - error on request with `failurePolicy : Deny`
517
519
- with a webhook - error on request with `failurePolicy : NoOpinion`
520
+ - Automatic reload periodically checks for changes in the configuration
521
+ and validates the new configuration and ensures the webhook is healthy
522
+ before the new config can be used.
518
523
519
524
There will be a mix and match of various authorization mechanisms to ensure all
520
525
desired functionality works.
@@ -610,6 +615,9 @@ command line flags should return an error.
610
615
A rollout can fail when the authorization configuration file being passed doesn't
611
616
exist or is invalid.
612
617
618
+ A rollback can fail if the admins failed to set the existing command line flag
619
+ ` --authorization-webhook-*` .
620
+
613
621
Already running workloads won't be impacted but cluster users won't be able to
614
622
access the control plane if the cluster is single-node.
615
623
0 commit comments