1
1
---
2
2
layout : blog
3
- title : ' Multi-Webhook and Modular Authorization Made Easy '
4
- date : 2024-04-nn
5
- slug : multi-webhook-and-modular-authorization-made-easy
3
+ title : ' Kubernetes 1.30: Multi-Webhook and Modular Authorization Made Much Easier '
4
+ date : 2024-04-25
5
+ slug : multi-webhook-and-modular-authorization-made-much-easier
6
6
---
7
7
8
8
** Authors:** [ Rita Zhang] ( https://github.com/ritazh ) (Microsoft), [ Jordan
9
9
Liggitt] ( https://github.com/liggitt ) (Google), [ Nabarun
10
10
Pal] ( https://github.com/palnabarun ) (VMware), [ Leigh
11
11
Capili] ( https://github.com/stealthybox ) (VMware)
12
12
13
- # Enhancing Kubernetes Authorization with Multiple Webhooks and Structured Configuration
14
-
15
13
## Introduction
16
14
Kubernetes continues to evolve to meet the intricate requirements of system
17
15
administrators and developers alike. A critical aspect of Kubernetes that
@@ -33,23 +31,22 @@ detailed behavior like timeout and failure policy for each webhook. This need
33
31
arises from the desire to create layered security policies, where requests can
34
32
be validated against multiple criteria or sets of rules in a specific order. The
35
33
previous limitations also made it difficult to dynamically configure the
36
- authorizer chain, leaving no room to efficiently manage complex authorization
37
- scenarios .
34
+ authorizer chain, leaving no room to manage complex authorization scenarios
35
+ efficiently .
38
36
39
37
The [ Structured Authorization Configuration
40
38
feature] ( /docs/reference/access-authn-authz/authorization/#configuring-the-api-server-using-an-authorization-config-file )
41
39
addresses these limitations by introducing a configuration file format to
42
- configure Kubernetes API Server Authorization chain. This format allows
40
+ configure the Kubernetes API Server Authorization chain. This format allows
43
41
specifying multiple webhooks in the authorization chain (all other authorization
44
- types are specified no more than once). Each webhook authorizer comes with its
45
- well-defined parameters, including timeout settings, failure policies, and
46
- conditions for invocation with [ CEL] ( /docs/reference/using-api/cel/ ) rules to
47
- pre-filter requests before they are dispatched to webhooks, helping you to
48
- prevent unnecessary invocations. The configuration also supports automatic
49
- reloading, ensuring changes can be applied dynamically without restarting the
50
- kube-apiserver. This feature not only addresses current limitations, but also
51
- opens up new possibilities for securing and managing Kubernetes clusters more
52
- effectively.
42
+ types are specified no more than once). Each webhook authorizer has well-defined
43
+ parameters, including timeout settings, failure policies, and conditions for
44
+ invocation with [ CEL] ( /docs/reference/using-api/cel/ ) rules to pre-filter
45
+ requests before they are dispatched to webhooks, helping you prevent unnecessary
46
+ invocations. The configuration also supports automatic reloading, ensuring
47
+ changes can be applied dynamically without restarting the kube-apiserver. This
48
+ feature addresses current limitations and opens up new possibilities for
49
+ securing and managing Kubernetes clusters more effectively.
53
50
54
51
## Sample Configurations
55
52
Here is a sample structured authorization configuration along with descriptions
@@ -153,24 +150,24 @@ authorizers:
153
150
type : InClusterConfig
154
151
` ` `
155
152
156
- The following configuration examples illustrate real world scenarios that need
153
+ The following configuration examples illustrate real- world scenarios that need
157
154
the ability to specify multiple webhooks with distinct settings, precedence
158
155
order, and failure modes.
159
156
160
157
### Protecting Installed CRDs
161
- Ensuring the availability of Custom Resource Definitions (CRDs) at cluster
162
- startup has been a key demand. One of the blockers for having a controller
163
- reconciling those CRDs is to have a protection mechanism for them, which can be
164
- achieved through multiple authorization webhooks. This was not possible before
165
- as specifying multiple authorization webhooks in the Kubernetes API Server
166
- authorization chain was simply not possible. Now with the Structured
158
+ Ensuring of Custom Resource Definitions (CRDs) availability at cluster startup
159
+ has been a key demand. One of the blockers of having a controller reconcile
160
+ those CRDs is having a protection mechanism for them, which can be achieved
161
+ through multiple authorization webhooks. This was not possible before as
162
+ specifying multiple authorization webhooks in the Kubernetes API Server
163
+ authorization chain was simply not possible. Now, with the Structured
167
164
Authorization Configuration feature, administrators can specify multiple
168
- webhooks offering a solution where RBAC falls short, especially in denying
165
+ webhooks, offering a solution where RBAC falls short, especially when denying
169
166
permissions to 'non-system' users for certain CRDs.
170
167
171
168
Assuming the following for this scenario:
172
169
- The "protected" CRDs are installed.
173
- - They can only be modified by users in the group ` admin`
170
+ - They can only be modified by users in the group ` admin`.
174
171
175
172
` ` ` yaml
176
173
apiVersion: apiserver.config.k8s.io/v1beta1
@@ -201,7 +198,7 @@ authorizers:
201
198
202
199
# ## Preventing unnecessarily nested webhooks
203
200
A system administrator wants to apply specific validations to requests before
204
- handling them off to webhooks using frameworks like Open Policy Agent. In the
201
+ handing them off to webhooks using frameworks like Open Policy Agent. In the
205
202
past, this would require running nested webhooks within the one added to the
206
203
authorization chain to achieve the desired result. The Structured Authorization
207
204
Configuration feature simplifies this process, offering a structured API to
@@ -255,20 +252,21 @@ authorizers:
255
252
` ` `
256
253
257
254
# # What's next?
258
- For Kubernetes v1.31, we expect the feature to stay in beta while we get more
259
- feedback. Then once the feature is ready for GA, the feature flag will be
260
- removed and the configuration file version will be promoted to v1.
255
+ From Kubernetes 1.30, the feature is in beta and enabled by default. For
256
+ Kubernetes v1.31, we expect the feature to stay in beta while we get more
257
+ feedback from users. Once it is ready for GA, the feature flag will be removed,
258
+ and the configuration file version will be promoted to v1.
261
259
262
- You can learn more about this feature on the [structured authorization
260
+ Learn more about this feature on the [structured authorization
263
261
configuration](/docs/reference/access-authn-authz/authorization/#configuring-the-api-server-using-an-authorization-config-file)
264
- Kubernetes doc website. You can also follow along on the
265
- [KEP-3221](https://kep.k8s.io/3221) to track progress across the coming
266
- Kubernetes releases.
262
+ Kubernetes doc website. You can also follow along with
263
+ [KEP-3221](https://kep.k8s.io/3221) to track progress in coming Kubernetes
264
+ releases.
267
265
268
266
# # Call to action
269
- In this post, we have covered the benefits the Structured Authorization
270
- Configuration feature brings in Kubernetes v1.30 and few sample configurations
271
- for real world scenarios. To use this feature, you must specify the path to the
267
+ In this post, we have covered the benefits of the Structured Authorization
268
+ Configuration feature in Kubernetes v1.30 and a few sample configurations for
269
+ real- world scenarios. To use this feature, you must specify the path to the
272
270
authorization configuration using the `--authorization-config` command line
273
271
argument. From Kubernetes 1.30, the feature is in beta and enabled by default.
274
272
If you want to keep using command line flags instead of a configuration file,
@@ -307,22 +305,22 @@ nodes:
307
305
308
306
We would love to hear your feedback on this feature. In particular, we would
309
307
like feedback from Kubernetes cluster administrators and authorization webhook
310
- implementors as they go through the process of building their integrations with
311
- this new API. Please reach out to us on the
308
+ implementors as they build their integrations with this new API. Please reach
309
+ out to us on the
312
310
[#sig-auth-authorizers-dev](https://kubernetes.slack.com/archives/C05EZFX1Z2L)
313
311
channel on Kubernetes Slack.
314
312
315
313
# # How to get involved
316
- If you are interested in getting involved in the development of this feature,
317
- share feedback, or participate in any other ongoing SIG Auth projects, please
314
+ If you are interested in helping develop this feature,
315
+ sharing feedback, or participating in any other ongoing SIG Auth projects, please
318
316
reach out on the [#sig-auth](https://kubernetes.slack.com/archives/C0EN96KUY)
319
317
channel on Kubernetes Slack.
320
318
321
319
You are also welcome to join the bi-weekly [SIG Auth
322
320
meetings](https://github.com/kubernetes/community/blob/master/sig-auth/README.md#meetings)
323
- held every- other Wednesday.
321
+ held every other Wednesday.
324
322
325
- # # Acknowledgements
326
- This feature has been an effort driven by contributors from several different
327
- companies. We would like to extend a huge thank you to everyone that contributed
328
- their time and effort to help make this possible.
323
+ # # Acknowledgments
324
+ This feature was driven by contributors from several different
325
+ companies. We would like to extend a huge thank you to everyone who contributed
326
+ their time and effort to make this possible.
0 commit comments