You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -125,16 +125,22 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
125
125
126
126
## Summary
127
127
128
-
This enhancement proposal covers implementing the structured configuration for the OIDC authenticator.
129
-
OIDC authentication is important part of Kubernetes, yet it has limitations in its current state.
130
-
Bellow we will discuss that limitation and propose solutions.
128
+
This enhancement proposal covers adding structured authentication configuration to the Kubernetes API server.
129
+
Initially, only a `jwt` configuration will be supported, which will serve as the next interation of the existing
130
+
OIDC authenticator. OIDC authentication is important part of Kubernetes, yet it has limitations in its current state.
131
+
Below we will discuss that limitation and propose solutions.
131
132
132
133
# Motivation
133
134
134
135
Structured config for OIDC authentication: noted in various contexts over the past few years. We want to migrate
135
136
away from a flag-based config that is growing without bounds to a proper versioned config format. This would allow us to
136
137
better support various features that have been requested.
137
138
139
+
-[Support multiple OIDC ClientIDs on API server](https://github.com/kubernetes/kubernetes/issues/71162)
140
+
- OpenID Connect: Identify user by more JWT claims than just a single one kubernetes/kubernetes#71715
141
+
- OIDC: Allow any claim from an ID token to be mapped to userinfo extra attributes kubernetes/kubernetes#82236
142
+
- Required claims does not support arrays and failing kubernetes auth with oidc - EKS kubernetes/kubernetes#101291
143
+
138
144
### Goals
139
145
140
146
There are features users want to tune. We need to provide customization of the following:
@@ -143,14 +149,20 @@ There are features users want to tune. We need to provide customization of the f
143
149
-*Claim mappings*: it is only possible to pick a single value from a single claim and prefix groups.
144
150
-*Use more than one OIDC provider*: the only option, for now, is to use an external OIDC provider that handles multiplexing support for multiple providers.
145
151
- Change authenticator settings without restarting kube-apiserver.
152
+
- SPIFFE JWTs
153
+
- TODO other issues from the PR
154
+
- Validations for infra providers
155
+
- Easy migration from existing OIDC flags
146
156
147
157
### Non-Goals
148
158
149
-
- Monitoring
159
+
- Supporting configuration of authenticaiton mechnisims other than `jwt`
160
+
- Supporting other methods for keys discovery other than standart OIDC discovery mechanism
161
+
- No support for `x5c`
150
162
151
163
## Proposal
152
164
153
-
1. Add new `authentication` API object to parse a structured config file `OIDCConfiguration`.
165
+
1. Add new `apiserver.config.k8s.io` API object to parse a structured config file `AuthenticaitonConfiguration`.
154
166
2. Add a single flag for kube-apiserver to point to the structured config file, automatically reload it on changes.
155
167
3. Use an expression language to let users write their own logic for mappings and validation rules
156
168
(expressions should be simple for common cases, yet powerful to cover most user stories).
@@ -164,8 +176,44 @@ we should provide examples of migrating from a flag-based config to a new struct
164
176
165
177
### Configuration file
166
178
179
+
TODO:
180
+
181
+
- we need to define the minimum valid payload
182
+
-> iss, exp, iat, and some other field that is the username
2. `ClaimValidationRules` - additional authentication policies. These policies are applied after generic OIDC validations, e.g., checking the token signature, issuer URL, etc. Rules are applicable to distributed claims.
1. `ClaimValidationRules` - additional authentication policies. These policies are applied after generic OIDC validations, e.g., checking the token signature, issuer URL, etc. Rules are applicable to distributed claims.
228
287
```go
229
288
type ClaimValidationRule struct {
230
289
// Rule is a logical expression that is written in CEL https://github.com/google/cel-go.
@@ -252,27 +311,32 @@ type Provider struct {
252
311
message: total token lifetime must not exceed 24 hours
253
312
```
254
313
255
-
3. `ClaimMappings` - rules to map claims from a token to Kubernetes user attributes.
314
+
2. `ClaimMappings` - rules to map claims from a token to Kubernetes user attributes.
256
315
```go
257
316
type UserAttributes struct {
258
317
// Username represents an option for the username attribute.
259
-
Username string `json:"username"`
318
+
Username KeyOrExpression `json:"username"`
260
319
// Groups represents an option for the groups attribute.
261
320
// +optional
262
-
Groups string `json:"groups,omitempty"`
321
+
Groups KeyOrExpression `json:"groups,omitempty"`
263
322
// UID represents an option for the uid attribute.
264
323
// +optional
265
-
UID string `json:"uid,omitempty"`
324
+
UID KeyOrExpression `json:"uid,omitempty"`
266
325
// Extra represents an option for the extra attribute.
267
326
// +optional
268
327
Extra []ExtraMapping `json:"extra,omitempty"`
269
328
}
270
329
271
330
type ExtraMapping struct {
272
331
// Key is a CEL expression to extract extra attribute key.
273
-
Key string `json:"key"`
332
+
Key KeyOrExpression `json:"key"`
274
333
// Value is a CEL expression to extract extra attribute value.
275
-
Value string `json:"value"`
334
+
Value KeyOrExpression `json:"value"`
335
+
}
336
+
337
+
type KeyOrExpression struct {
338
+
Key string `json:"key"`
339
+
Expression string `json:"value"`
276
340
}
277
341
```
278
342
@@ -310,7 +374,7 @@ type Provider struct {
310
374
extra:
311
375
client_name: kubernetes
312
376
```
313
-
4. `ClaimsFilter` - list of claim names that should be passed to CEL expressions. The assumption is that administrators
377
+
3. `ClaimsFilter` - list of claim names that should be passed to CEL expressions. The assumption is that administrators
314
378
know the structure of the token and the exact claims they will use in CEL expressions.
315
379
This option helps to reduce system load and operate only with required claims.
316
380
@@ -503,7 +567,7 @@ Yes. It works.
503
567
504
568
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
505
569
506
-
Yes, the `--oidc-configuration-path` flag should be removed from the kube-apiserver manifest.
570
+
Yes, the `--authentication-config` flag should be removed from the kube-apiserver manifest.
507
571
508
572
### Monitoring Requirements
509
573
@@ -532,13 +596,10 @@ and operation of this feature.
532
596
Recall that end users cannot usually observe component logs or access metrics.
533
597
-->
534
598
535
-
-[ ] Events
536
-
- Event Reason:
537
-
-[ ] API .status
538
-
- Condition name:
539
-
- Other field:
540
-
-[ ] Other (treat as last resort)
541
-
- Details:
599
+
Metrics
600
+
601
+
- Last successful load of the file
602
+
- Last time keys were fetched (would be per issuer)
542
603
543
604
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
0 commit comments