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
You can also use any custom method that issues [client X.509 certificates](#x509-client-certificates) to clients,
241
+
provided that the API server will trust the valid certificates.
242
+
Read [X.509 client certificates](#x509-client-certificates) to learn about how to generate a
243
+
certificate.
244
+
245
+
If you do issue certificates to clients, it is up to you (as a cloud platform administrator)
246
+
to make sure that the certicate validity period, and other design choices you make, provide a
247
+
suitable level of security.
248
+
249
+
### OpenID Connect tokens
250
250
251
251
[OpenID Connect](https://openid.net/connect/) is a flavor of OAuth2 supported by
252
252
some OAuth2 providers, notably Microsoft Entra ID, Salesforce, and Google.
@@ -290,7 +290,7 @@ sequenceDiagram
290
290
291
291
1. Log in to your identity provider
292
292
1. Your identity provider will provide you with an `access_token`, `id_token` and a `refresh_token`
293
-
1. When using `kubectl`, use your `id_token` with the `--token` flag or add it directly to your `kubeconfig`
293
+
1. When using `kubectl`, use your `id_token` with the `--token` command line argument or add it directly to your `kubeconfig`
294
294
1. `kubectl` sends your `id_token` in a header called Authorization to the API server
295
295
1. The API server will make sure the JWT signature is valid
296
296
1. Check to make sure the `id_token` hasn't expired
@@ -323,10 +323,10 @@ To enable the plugin, configure the following flags on the API server:
323
323
| `--oidc-issuer-url` | URL of the provider that allows the API server to discover public signing keys. Only URLs that use the `https://` scheme are accepted. This is typically the provider's discovery URL, changed to have an empty path. | If the issuer's OIDC discovery URL is `https://accounts.provider.example/.well-known/openid-configuration`, the value should be `https://accounts.provider.example` | Yes |
324
324
| `--oidc-client-id` | A client id that all tokens must be issued for. | kubernetes | Yes |
325
325
| `--oidc-username-claim` | JWT claim to use as the user name. By default `sub`, which is expected to be a unique identifier of the end user. Admins can choose other claims, such as `email` or `name`, depending on their provider. However, claims other than `email` will be prefixed with the issuer URL to prevent naming clashes with other plugins. | sub | No |
326
-
| `--oidc-username-prefix` | Prefix prepended to username claims to prevent clashes with existing names (such as `system:` users). For example, the value `oidc:` will create usernames like `oidc:jane.doe`. If this flag isn't provided and `--oidc-username-claim` is a value other than `email` the prefix defaults to `( Issuer URL )#` where `( Issuer URL )` is the value of `--oidc-issuer-url`. The value `-` can be used to disable all prefixing. | `oidc:` | No |
326
+
| `--oidc-username-prefix` | Prefix prepended to username claims to prevent clashes with existing names (such as `system:` users). For example, the value `oidc:` will create usernames like `oidc:jane.doe`. If this argument isn't provided and `--oidc-username-claim` is a value other than `email` the prefix defaults to `( Issuer URL )#` where `( Issuer URL )` is the value of `--oidc-issuer-url`. The value `-` can be used to disable all prefixing. | `oidc:` | No |
327
327
| `--oidc-groups-claim` | JWT claim to use as the user's group. If the claim is present it must be an array of strings. | groups | No |
328
328
| `--oidc-groups-prefix` | Prefix prepended to group claims to prevent clashes with existing names (such as `system:` groups). For example, the value `oidc:` will create group names like `oidc:engineering` and `oidc:infra`. | `oidc:` | No |
329
-
| `--oidc-required-claim` | A key=value pair that describes a required claim in the ID Token. If set, the claim is verified to be present in the ID Token with a matching value. Repeat this flag to specify multiple claims. | `claim=value` | No |
329
+
| `--oidc-required-claim` | A key=value pair that describes a required claim in the ID Token. If set, the claim is verified to be present in the ID Token with a matching value. Repeat this argument to specify multiple claims. | `claim=value` | No |
330
330
| `--oidc-ca-file` | The path to the certificate for the CA that signed your identity provider's web certificate. Defaults to the host's root CAs. | `/etc/kubernetes/ssl/kc-ca.pem` | No |
331
331
| `--oidc-signing-algs` | The signing algorithms accepted. Default is RS256. Allowed values are: RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512. Values are defined by RFC 7518 https://tools.ietf.org/html/rfc7518#section-3.1. | `RS512` | No |
332
332
@@ -356,8 +356,7 @@ The API server also automatically reloads the authenticators when the configurat
356
356
You can use `apiserver_authentication_config_controller_automatic_reload_last_timestamp_seconds` metric
357
357
to monitor the last time the configuration was reloaded by the API server.
358
358
359
-
You must specify the path to the authentication configuration using the `--authentication-config` flag
360
-
on the API server. If you want to use command line flags instead of the configuration file, those will
359
+
You must specify the path to the authentication configuration using the `--authentication-config` command line argument to the API server. If you want to use command line arguments instead of the configuration file, those will
361
360
continue to work as-is. To access the new capabilities like configuring multiple authenticators,
362
361
setting multiple audiences for an issuer, switch to using the configuration file.
363
362
@@ -375,13 +374,7 @@ If you want to switch to using structured authentication configuration, you have
375
374
command line arguments, and use the configuration file instead.
The _egressSelectorType_ field in the JWT issuer configuration allows you to specify which egress selector
710
+
should be used for sending all traffic related to the issuer (discovery, JWKS, distributed claims, etc).
711
+
This feature requires the `StructuredAuthenticationConfigurationEgressSelector` feature gate to be enabled.
712
+
713
+
##### Limitations {#oidc-limitations}
711
714
712
715
1. Distributed claims do not work via [CEL](/docs/reference/using-api/cel/) expressions.
713
716
@@ -736,14 +739,14 @@ standard certificate generation tools.
736
739
737
740
#### Using kubectl
738
741
739
-
##### Option 1 - OIDC Authenticator
742
+
##### Option 1 - OIDC authenticator
740
743
741
744
The first option is to use the kubectl `oidc` authenticator, which sets the `id_token` as a bearer token
742
745
for all requests and refreshes the token once it expires. After you've logged into your provider, use
743
746
kubectl to add your `id_token`, `refresh_token`, `client_id`, and `client_secret` to configure the plugin.
744
747
745
748
Providers that don't return an `id_token` as part of their refresh token response aren't supported
746
-
by this plugin and should use "Option 2" below.
749
+
by this plugin and should use [Option 2](#option-2-use-the-token-option) (specifying `--token`).
747
750
748
751
```bash
749
752
kubectl config set-credentials USER_NAME \
@@ -789,18 +792,21 @@ users:
789
792
Once your `id_token` expires, `kubectl` will attempt to refresh your `id_token` using your `refresh_token`
790
793
and `client_secret` storing the new values for the `refresh_token` and `id_token` in your `.kube/config`.
791
794
792
-
##### Option 2 - Use the `--token` Option
795
+
##### Option 2 - Use the `--token` command line argument {#option-2-use-the-token-option}
793
796
794
-
The `kubectl` command lets you pass in a token using the `--token` option.
797
+
The `kubectl` command lets you pass in a token using the `--token` command line argument.
795
798
Copy and paste the `id_token` into this option:
796
799
797
800
```bash
798
801
kubectl --token=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL21sYi50cmVtb2xvLmxhbjo4MDQzL2F1dGgvaWRwL29pZGMiLCJhdWQiOiJrdWJlcm5ldGVzIiwiZXhwIjoxNDc0NTk2NjY5LCJqdGkiOiI2RDUzNXoxUEpFNjJOR3QxaWVyYm9RIiwiaWF0IjoxNDc0NTk2MzY5LCJuYmYiOjE0NzQ1OTYyNDksInN1YiI6Im13aW5kdSIsInVzZXJfcm9sZSI6WyJ1c2VycyIsIm5ldy1uYW1lc3BhY2Utdmlld2VyIl0sImVtYWlsIjoibXdpbmR1QG5vbW9yZWplZGkuY29tIn0.f2As579n9VNoaKzoF-dOQGmXkFKf1FMyNV0-va_B63jn-_n9LGSCca_6IVMP8pO-Zb4KvRqGyTP0r3HkHxYy5c81AnIh8ijarruczl-TK_yF5akjSTHFZD-0gRzlevBDiH8Q79NAr-ky0P4iIXS8lY9Vnjch5MF74Zx0c3alKJHJUnnpjIACByfF2SCaYzbWFMUNat-K1PaUk5-ujMBG7yYnr95xD-63n8CO8teGUAAEMx6zRjzfhnhbzX-ajwZLGwGUBT4WqjMs70-6a7_8gZmLZb2az1cZynkFRj2BaCkVT3A2RrjeEwZEtGXlMqKJ1_I2ulrOVsYx01_yD35-rw get nodes
799
802
```
800
803
801
-
### Webhook Token Authentication
802
804
803
-
Webhook authentication is a hook for verifying bearer tokens.
805
+
### Webhook token authentication
806
+
807
+
Kubernetes _webhook authentication_ is a mechanism to make an HTTP callout for verifying bearer tokens.
808
+
809
+
In terms of how you configure the API server:
804
810
805
811
* `--authentication-token-webhook-config-file` a configuration file describing how to access the remote webhook service.
806
812
* `--authentication-token-webhook-cache-ttl` how long to cache authentication decisions. Defaults to two minutes.
@@ -1002,25 +1008,53 @@ An unsuccessful request would return:
0 commit comments