Skip to content

Commit 5031a37

Browse files
committed
review feedback
Signed-off-by: Anish Ramasekar <[email protected]>
1 parent dffa687 commit 5031a37

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

content/en/blog/_posts/2024-04-29-structured-authentication-configuration-beta.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date: 2024-04-29
55
slug: structured-authentication-moves-to-beta
66
---
77

8-
**Authors:** [Anish Ramasekar](https://github.com/aramase) (Microsoft)
8+
**Author:** [Anish Ramasekar](https://github.com/aramase) (Microsoft)
99

1010
With Kubernetes 1.30, we (SIG Auth) are moving Structured Authentication Configuration to beta.
1111

@@ -19,22 +19,22 @@ Structured Authentication Configuration feature is the first step towards
1919
addressing these limitations and providing a more flexible and extensible way
2020
to configure authentication in Kubernetes.
2121

22-
## What is Structured Authentication Configuration?
23-
24-
The Structured Authentication Configuration feature is a new way to configure
25-
authentication in Kubernetes. It currently only supports configuring JWT
22+
## What is structured authentication configuration?
23+
Kubernetes v1.30 builds on the experimental support for configurating authentication based on
24+
a file, that was added as alpha in Kubernetes v1.30. At this beta stage, Kubernetes only supports configuring JWT
2625
authenticators, which serve as the next iteration of the existing OIDC
2726
authenticator. JWT authenticator is an authenticator to
2827
authenticate Kubernetes users using JWT compliant tokens. The authenticator
2928
will attempt to parse a raw ID token, verify it's been signed by the configured
3029
issuer.
3130

32-
The feature is designed to be more flexible and extensible than the existing
33-
flag-based approach for configuring the JWT authenticator.
31+
The Kubernetes project added configuration from a file so that it can provide more
32+
flexibility than using command line options (which continue to work, and are still supported).
33+
Supporting a configuration file also makes it easy to deliver further improvements in upcoming
34+
releases.
3435

35-
### Benefits of Structured Authentication Configuration
36-
The Structured Authentication Configuration feature brings several benefits to
37-
Kubernetes:
36+
### Benefits of structured authentication configuration
37+
Here's why using a configuration file to configure cluster authentication is a benefit:
3838
1. **Multiple JWT authenticators**: You can configure multiple JWT authenticators
3939
simultaneously. This allows you to use multiple identity providers (e.g.,
4040
Okta, Keycloak, GitLab) without needing to use an intermediary like Dex
@@ -45,23 +45,24 @@ Kubernetes:
4545
3. **Any JWT-compliant token**: You can use any JWT-compliant token for
4646
authentication. This allows you to use tokens from any identity provider that
4747
supports JWT. The minimum valid JWT payload must contain the claims documented
48-
[here](https://github.com/kubernetes/kubernetes/blob/121607e80963370c1838f9f620c2b8552041abfc/staging/src/k8s.io/apiserver/pkg/apis/apiserver/v1beta1/types.go#L152-L157).
48+
in [structured authentication configuration](/docs/reference/access-authn-authz/authentication/#using-authentication-configuration)
49+
page in the Kubernetes documentation.
4950
4. **CEL (Common Expression Language) support**: You can use [CEL](/docs/reference/using-api/cel/)
5051
to determine whether the token's claims match the user's attributes in Kubernetes (e.g.,
5152
username, group). This allows you to use complex logic to determine whether a
5253
token is valid.
5354
5. **Multiple audiences**: You can configure multiple audiences for a single
5455
authenticator. This allows you to use the same authenticator for multiple
5556
audiences, such as using a different OAuth client for `kubectl` and dashboard.
56-
6. **Using Identity providers that don't support OpenID connect discovery**: You
57+
6. **Using identity providers that don't support OpenID connect discovery**: You
5758
can use identity providers that don't support [OpenID Connect
5859
discovery](https://openid.net/specs/openid-connect-discovery-1_0.html). The only
5960
requirement is to host the discovery document at a different location than the
6061
issuer (such as locally in the cluster) and specify the `issuer.discoveryURL` in
6162
the configuration file.
6263

6364
## How to use Structured Authentication Configuration
64-
To use the Structured Authentication Configuration feature, you must specify
65+
To use structured authentication configuration, you specify
6566
the path to the authentication configuration using the `--authentication-config`
6667
command line argument in the API server. The configuration file is a YAML file
6768
that specifies the authenticators and their configuration. Here is an example
@@ -70,6 +71,8 @@ configuration file that configures two JWT authenticators:
7071
```yaml
7172
apiVersion: apiserver.config.k8s.io/v1beta1
7273
kind: AuthenticationConfiguration
74+
# Someone with a valid token from either of these issuers could authenticate
75+
# against this cluster.
7376
jwt:
7477
- issuer:
7578
url: https://issuer1.example.com
@@ -79,7 +82,7 @@ jwt:
7982
audienceMatchPolicy: MatchAny
8083
claimValidationRules:
8184
expression: 'claims.hd == "example.com"'
82-
message: "the hd claim must be example.com"
85+
message: "the hosted domain name must be example.com"
8386
claimMappings:
8487
username:
8588
expression: 'claims.username'
@@ -104,7 +107,7 @@ jwt:
104107
audienceMatchPolicy: MatchAny
105108
claimValidationRules:
106109
expression: 'claims.hd == "example.com"'
107-
message: "the hd claim must be example.com"
110+
message: "the hosted domain name must be example.com"
108111
claimMappings:
109112
username:
110113
expression: 'claims.username'
@@ -120,12 +123,12 @@ jwt:
120123
message: "username cannot use reserved system: prefix"
121124
```
122125
123-
## Migration from command line flags to configuration file
126+
## Migration from command line arguments to configuration file
124127
The Structured Authentication Configuration feature is designed to be
125-
backwards-compatible with the existing flag-based approach for configuring the
126-
JWT authenticator. This means that you can continue to use the existing
127-
command-line flags to configure the JWT authenticator. However, we recommend
128-
migrating to the new configuration file-based approach, as it provides more
128+
backwards-compatible with the existing approach, based on command line options, for
129+
configuring the JWT authenticator. This means that you can continue to use the existing
130+
command-line options to configure the JWT authenticator. However, we (Kubernetes SIG Auth)
131+
recommend migrating to the new configuration file-based approach, as it provides more
129132
flexibility and extensibility.
130133
131134
{{% alert title="Note" color="primary" %}}
@@ -139,7 +142,7 @@ command line arguments, and use the configuration file instead.
139142
Here is an example of how to migrate from the command-line flags to the
140143
configuration file:
141144

142-
### Command-line flags
145+
### Command-line arguments
143146
```bash
144147
--oidc-issuer-url=https://issuer.example.com
145148
--oidc-client-id=example-client-id
@@ -152,9 +155,9 @@ configuration file:
152155
--oidc-ca-file=/path/to/ca.pem
153156
```
154157

155-
> There is no equivalent in the configuration file for the `--oidc-signing-algs`.
156-
> The authenticator will support all asymmetric algorithms listed
157-
> [here](https://github.com/kubernetes/kubernetes/blob/b4935d910dcf256288694391ef675acfbdb8e7a3/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go#L222-L233).
158+
There is no equivalent in the configuration file for the `--oidc-signing-algs`.
159+
For Kubernetes v1.30, the authenticator supports all the asymmetric algorithms listed in
160+
[`oidc.go`](https://github.com/kubernetes/kubernetes/blob/b4935d910dcf256288694391ef675acfbdb8e7a3/staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go#L222-L233).
158161

159162
### Configuration file
160163
```yaml
@@ -189,21 +192,21 @@ feedback. In the coming releases, we want to investigate:
189192

190193
You can learn more about this feature on the [structured authentication
191194
configuration](/docs/reference/access-authn-authz/authentication/#using-authentication-configuration)
192-
Kubernetes doc website. You can also follow along on the
195+
page in the Kubernetes documentation. You can also follow along on the
193196
[KEP-3331](https://kep.k8s.io/3331) to track progress across the coming
194197
Kubernetes releases.
195198

196-
## Call to action
197-
In this post, we have covered the benefits the Structured Authentication
199+
## Try it out
200+
In this post, I have covered the benefits the Structured Authentication
198201
Configuration feature brings in Kubernetes v1.30. To use this feature, you must specify the path to the
199202
authentication configuration using the `--authentication-config` command line
200203
argument. From Kubernetes v1.30, the feature is in beta and enabled by default.
201-
If you want to keep using command line flags instead of a configuration file,
204+
If you want to keep using command line arguments instead of a configuration file,
202205
those will continue to work as-is.
203206

204207
We would love to hear your feedback on this feature. Please reach out to us on the
205208
[#sig-auth-authenticators-dev](https://kubernetes.slack.com/archives/C04UMAUC4UA)
206-
channel on Kubernetes Slack.
209+
channel on Kubernetes Slack (for an invitation, visit [https://slack.k8s.io/](https://slack.k8s.io/)).
207210

208211
## How to get involved
209212
If you are interested in getting involved in the development of this feature,

0 commit comments

Comments
 (0)