Skip to content

Commit a77fcc7

Browse files
authored
Merge pull request #46988 from vinayakankugoyal/kep4633
KEP-4633: Add documentation for Configurable Endpoints for Anonymous Auth.
2 parents 22b1bd0 + 4b2940e commit a77fcc7

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

content/en/docs/reference/access-authn-authz/authentication.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,41 @@ Starting in 1.6, the ABAC and RBAC authorizers require explicit authorization of
10821082
`system:anonymous` user or the `system:unauthenticated` group, so legacy policy rules
10831083
that grant access to the `*` user or `*` group do not include anonymous users.
10841084

1085+
### Anonymous Authenticator Configuration
1086+
1087+
{{< feature-state feature_gate_name="AnonymousAuthConfigurableEndpoints" >}}
1088+
1089+
The `AuthenticationConfiguration` can be used to configure the anonymous
1090+
authenticator. To enable configuring anonymous auth via the config file you need
1091+
enable the `AnonymousAuthConfigurableEndpoints` feature gate. When this feature
1092+
gate is enabled you cannot set the `--anonymous-auth` flag.
1093+
1094+
The main advantage of configuring anonymous authenticator using the authentication
1095+
configuration file is that in addition to enabling and disabling anonymous authentication
1096+
you can also configure which endpoints support anonymous authentication.
1097+
1098+
A sample authentication configuration file is below:
1099+
1100+
```yaml
1101+
---
1102+
#
1103+
# CAUTION: this is an example configuration.
1104+
# Do not use this for your own cluster!
1105+
#
1106+
apiVersion: apiserver.config.k8s.io/v1beta1
1107+
kind: AuthenticationConfiguration
1108+
anonymous:
1109+
enabled: true
1110+
conditions:
1111+
- path: /livez
1112+
- path: /readyz
1113+
- path: /healthz
1114+
```
1115+
1116+
In the configuration above only the `/livez`, `/readyz` and `/healthz` endpoints
1117+
are reachable by anonymous requests. Any other endpoints will not be reachable
1118+
even if it is allowed by RBAC configuration.
1119+
10851120
## User impersonation
10861121

10871122
A user can act as another user through impersonation headers. These let requests
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: AnonymousAuthConfigurableEndpoints
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.31"
12+
---
13+
Enable [configurable endpoints for anonymous auth](/docs/reference/access-authn-authz/authentication/#anonymous-authenticator-onfiguration)
14+
for the API server.

0 commit comments

Comments
 (0)