Skip to content

Commit 7e1c131

Browse files
authored
Merge pull request #4798 from vinayakankugoyal/kep4633
KEP-4633: Graduate to BETA.
2 parents 763256d + 4e51e03 commit 7e1c131

File tree

3 files changed

+117
-29
lines changed

3 files changed

+117
-29
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 4633
22
alpha:
33
approver: "@jpbetz"
4+
beta:
5+
approver: "@jpbetz"

keps/sig-auth/4633-anonymous-auth-configurable-endpoints/README.md

Lines changed: 112 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ tags, and then generate with `hack/update-toc.sh`.
9696
- [e2e tests](#e2e-tests)
9797
- [Graduation Criteria](#graduation-criteria)
9898
- [Alpha](#alpha)
99+
- [Beta](#beta)
100+
- [GA](#ga)
99101
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
100102
- [Version Skew Strategy](#version-skew-strategy)
101103
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
@@ -107,9 +109,9 @@ tags, and then generate with `hack/update-toc.sh`.
107109
- [Troubleshooting](#troubleshooting)
108110
- [Implementation History](#implementation-history)
109111
- [Drawbacks](#drawbacks)
110-
- [Open Questions for BETA](#open-questions-for-beta)
111112
- [Alternatives](#alternatives)
112113
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
114+
- [Possible Future Improvements](#possible-future-improvements)
113115
<!-- /toc -->
114116

115117
## Release Signoff Checklist
@@ -131,8 +133,8 @@ checklist items _must_ be updated for the enhancement to be released.
131133
Items marked with (R) are required *prior to targeting to a milestone / release*.
132134

133135
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
134-
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
135-
- [ ] (R) Design details are appropriately documented
136+
- [x] (R) KEP approvers have approved the KEP status as `implementable`
137+
- [x] (R) Design details are appropriately documented
136138
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
137139
- [ ] e2e Tests for all Beta API Operations (endpoints)
138140
- [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
@@ -477,6 +479,11 @@ We will add unit tests for the following scenarios:
477479
2. Making sure that the flag and the config are mutually exclusive.
478480
3. Behavior of the path restricted anonymous authenticator.
479481

482+
Unit tests were added to the following:
483+
484+
* pkg/kubeapiserver/options/authentication_test.go
485+
* staging/src/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous_test.go
486+
480487
##### Integration tests
481488

482489
<!--
@@ -502,6 +509,10 @@ based authentication scenarios:
502509
1. anonymous auth enabled and restricted to certain paths in the auth-config
503510
file.
504511

512+
The following integration tests were added:
513+
514+
test/integration/apiserver/anonymous/anonymous_test.go
515+
505516
##### e2e tests
506517

507518
<!--
@@ -587,6 +598,14 @@ in back-to-back releases.
587598
- Feature implemented behind a feature flag
588599
- Full unit and integration test coverage
589600

601+
#### Beta
602+
603+
- Feature gate set to true by default
604+
605+
#### GA
606+
607+
- Examples of real-world usage
608+
590609
### Upgrade / Downgrade Strategy
591610

592611
<!--
@@ -601,6 +620,10 @@ enhancement:
601620
cluster required to make on upgrade, in order to make use of the enhancement?
602621
-->
603622

623+
When the feature-gate is enabled none of the defaults or current settings
624+
regarding anonymous auth are changed. The feature-gate enables the ability for
625+
users to set the `anonymous` field using the `AuthenticationConfiguration` file.
626+
604627
### Version Skew Strategy
605628

606629
<!--
@@ -616,6 +639,11 @@ enhancement:
616639
CRI or CNI may require updating that component before the kubelet.
617640
-->
618641

642+
This feature only impacts kube-apiserver and does not introduce any changes that
643+
would be impacted by version skews. All changes are local to kube-apiserver and
644+
are controlled by the `AuthenticationConfiguration` file passed to
645+
kube-apiserver as a parameter.
646+
619647
## Production Readiness Review Questionnaire
620648

621649
<!--
@@ -747,13 +775,25 @@ rollout. Similarly, consider large clusters and how enablement/disablement
747775
will rollout across nodes.
748776
-->
749777

778+
Enabling the feature flag alone does not change kube-apiserver defaults. However
779+
if different API servers have different AuthenticationConfiguration for
780+
Anonymous then some requests that would be denied by one API server could be
781+
allowed by another.
782+
750783
###### What specific metrics should inform a rollback?
751784

752785
<!--
753786
What signals should users be paying attention to when the feature is young
754787
that might indicate a serious problem?
755788
-->
756789

790+
kube-apiserver fails to start when AuthenticationConfiguration file has
791+
`anonymous` field set.
792+
793+
If audit logs indicate that endpoints other than the ones configured in the
794+
AuthenticationConfiguration file using the `anonymous.conditions` field are
795+
reachable by anonymous users.
796+
757797
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
758798

759799
<!--
@@ -762,6 +802,8 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
762802
are missing a bunch of machinery and tooling and can't do that now.
763803
-->
764804

805+
N/A
806+
765807
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
766808

767809
<!--
@@ -785,6 +827,8 @@ checking if there are objects with field X set) may be a last resort. Avoid
785827
logs or events for this purpose.
786828
-->
787829

830+
N/A
831+
788832
###### How can someone using this feature know that it is working for their instance?
789833

790834
<!--
@@ -796,13 +840,18 @@ and operation of this feature.
796840
Recall that end users cannot usually observe component logs or access metrics.
797841
-->
798842

799-
- [ ] Events
800-
- Event Reason:
801-
- [ ] API .status
802-
- Condition name:
803-
- Other field:
804-
- [ ] Other (treat as last resort)
805-
- Details:
843+
If a user sets AuthenticationConfig file and sets the `anonymous.enabled` to
844+
`true` and sets `anonymous.conditions` to allow only certain endpoints. Then
845+
they can check if the feature is working by:
846+
847+
* making an anonymous request to an endpoint that is not in the list of
848+
endpoints they allowed. Such a request should fail with http status code 401.
849+
850+
* making an anoymous request to an endpoint that is in the list of endpoints
851+
they allowed. Such a request should either succeed with http status code 200 (if
852+
authz is configured to allow acees to that endpoint) or
853+
fail with http statis code 403 (if authz is not configured to allow access to
854+
that endpoint)
806855

807856
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
808857

@@ -821,6 +870,9 @@ These goals will help you determine what you need to measure (SLIs) in the next
821870
question.
822871
-->
823872

873+
SLOs for actual requests should not change in any way compared to the flag-based
874+
Anonymous configuration.
875+
824876
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
825877

826878
<!--
@@ -834,13 +886,17 @@ Pick one more of these and delete the rest.
834886
- [ ] Other (treat as last resort)
835887
- Details:
836888

889+
N/A
890+
837891
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
838892

839893
<!--
840894
Describe the metrics themselves and the reasons why they weren't added (e.g., cost,
841895
implementation difficulties, etc.).
842896
-->
843897

898+
N/A
899+
844900
### Dependencies
845901

846902
<!--
@@ -864,6 +920,8 @@ and creating new ones, as well as about cluster-level services (e.g. DNS):
864920
- Impact of its degraded performance or high-error rates on the feature:
865921
-->
866922

923+
No.
924+
867925
### Scalability
868926

869927
<!--
@@ -891,6 +949,8 @@ Focusing mostly on:
891949
heartbeats, leader election, etc.)
892950
-->
893951

952+
No.
953+
894954
###### Will enabling / using this feature result in introducing new API types?
895955

896956
<!--
@@ -900,6 +960,8 @@ Describe them, providing:
900960
- Supported number of objects per namespace (for namespace-scoped objects)
901961
-->
902962

963+
No.
964+
903965
###### Will enabling / using this feature result in any new calls to the cloud provider?
904966

905967
<!--
@@ -908,6 +970,8 @@ Describe them, providing:
908970
- Estimated increase:
909971
-->
910972

973+
No.
974+
911975
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
912976

913977
<!--
@@ -917,6 +981,8 @@ Describe them, providing:
917981
- Estimated amount of new objects: (e.g., new Object X for every existing Pod)
918982
-->
919983

984+
No.
985+
920986
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
921987

922988
<!--
@@ -928,6 +994,8 @@ Think about adding additional work or introducing new steps in between
928994
[existing SLIs/SLOs]: https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos
929995
-->
930996

997+
No.
998+
931999
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
9321000

9331001
<!--
@@ -940,6 +1008,8 @@ This through this both in small and large cases, again with respect to the
9401008
[supported limits]: https://git.k8s.io/community//sig-scalability/configs-and-limits/thresholds.md
9411009
-->
9421010

1011+
No.
1012+
9431013
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
9441014

9451015
<!--
@@ -952,6 +1022,8 @@ Are there any tests that were run/should be run to understand performance charac
9521022
and validate the declared limits?
9531023
-->
9541024

1025+
No.
1026+
9551027
### Troubleshooting
9561028

9571029
<!--
@@ -967,6 +1039,9 @@ details). For now, we leave it here.
9671039

9681040
###### How does this feature react if the API server and/or etcd is unavailable?
9691041

1042+
This feature is about for API Server handles Authentication for anonymous
1043+
requests. If API server is unavailable then this feature is also unavailable.
1044+
9701045
###### What are other known failure modes?
9711046

9721047
<!--
@@ -984,32 +1059,29 @@ For each of them, fill in the following information by copying the below templat
9841059

9851060
###### What steps should be taken if SLOs are not being met to determine the problem?
9861061

1062+
After observing an issue (e.g. uptick in denied authentication requests),
1063+
kube-apiserver logs from the authenticator may be used to debug.
1064+
1065+
Additionally, manually attempting to exercise the affected codepaths would
1066+
surface information that'd aid debugging. For example, attempting to issue an
1067+
anonymous request to an endpoint that is allowed or disallowed based on the
1068+
contraints set in the anonymous config in the AuthenticationConfiguration file.
1069+
9871070
## Implementation History
9881071

989-
<!--
990-
Major milestones in the lifecycle of a KEP should be tracked in this section.
991-
Major milestones might include:
992-
- the `Summary` and `Motivation` sections being merged, signaling SIG acceptance
993-
- the `Proposal` section being merged, signaling agreement on a proposed design
994-
- the date implementation started
995-
- the first Kubernetes release where an initial version of the KEP was available
996-
- the version of Kubernetes where the KEP graduated to general availability
997-
- when the KEP was retired or superseded
998-
-->
1072+
- [x] 2024-05-13 - KEP introduced
1073+
- [x] 2024-06-07 - KEP Accepted as implementable
1074+
- [x] 2024-06-27 - Alpha implementation merged https://github.com/kubernetes/kubernetes/pull/124917
1075+
- [x] 2024-07-15 - Integration tests merged https://github.com/kubernetes/kubernetes/pull/125967
1076+
- [x] 2024-08-13 - First release (1.31) when feature available
1077+
- [x] 2024-08-16 - Targeting beta in 1.32
9991078

10001079
## Drawbacks
10011080

10021081
<!--
10031082
Why should this KEP _not_ be implemented?
10041083
-->
10051084

1006-
## Open Questions for BETA
1007-
1008-
The following should be resolved before this goes to `beta`:
1009-
1010-
- Should we apply any restrictions here to anonymous `userInfo` that comes back
1011-
after all authenticators and impersonation have run
1012-
10131085
## Alternatives
10141086

10151087
<!--
@@ -1038,3 +1110,16 @@ Use this section if you need things from the project/SIG. Examples include a
10381110
new subproject, repos requested, or GitHub details. Listing these here allows a
10391111
SIG to get the process for these resources started right away.
10401112
-->
1113+
1114+
## Possible Future Improvements
1115+
1116+
We decided not to apply any restrictions here to anonymous `userInfo` that comes
1117+
back after all authenticators and impersonation have run because we think that
1118+
the scope of this KEP is to provide cluster admins with a way to restrict actual
1119+
anonymous requests. A request that was considered authenticated and as permitted
1120+
to impersonate `system:anonymous` is not actually anonymous.
1121+
1122+
If we want to allow cluster admins the ability to add such restrictions we
1123+
think its better to give them the capability to configure webhook authenticators
1124+
and add `userValidationRules` capabilities. But doing so would expand the scope
1125+
of this KEP and it should likely be a separate effort.

keps/sig-auth/4633-anonymous-auth-configurable-endpoints/kep.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ see-also:
1616
replaces:
1717

1818
# The target maturity stage in the current dev cycle for this KEP.
19-
stage: alpha
19+
stage: beta
2020

2121
# The most recent milestone for which work toward delivery of this KEP has been
2222
# done. This can be the current (upcoming) milestone, if it is being actively
2323
# worked on.
24-
latest-milestone: "v1.31"
24+
latest-milestone: "v1.32"
2525

2626
# The milestone at which this feature was, or is targeted to be, at each stage.
2727
milestone:
2828
alpha: "v1.31"
29+
beta: "v1.32"
2930

3031
# The following PRR answers are required at alpha release
3132
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)