Skip to content

Commit 36fdc00

Browse files
committed
adding a new enhancement for fixing anonymous user access
1 parent 8857a99 commit 36fdc00

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: cleaning-up-unauthenticated-subjects-from-cluster-role-bindings
3+
authors:
4+
- "@vareti"
5+
reviewers:
6+
- "@marun"
7+
- "@sttts"
8+
- "@deads2k"
9+
approvers:
10+
- "@sttts"
11+
creation-date: 2020-05-07
12+
last-updated: 2020-05-07
13+
status: implementable
14+
see-also:
15+
replaces:
16+
superseded-by:
17+
---
18+
19+
# Cleaning Up Unauthenticated Subject from Cluster Role Bindings
20+
21+
## Release Signoff Checklist
22+
23+
- [x] Enhancement is `implementable`
24+
- [ ] Design details are appropriately documented from clear requirements
25+
- [ ] Test plan is defined
26+
- [ ] Graduation criteria for dev preview, tech preview, GA
27+
- [ ] User-facing documentation is created in [openshift-docs](https://github.com/openshift/openshift-docs/)
28+
29+
## Open Questions [optional]
30+
31+
## Summary
32+
33+
In earlier releases of OpenShift, the authorization module would allow anonymous users to access discovery endpoints. This enhancement proposes a way to remove unauthenticated subjects from cluster role bindings after an upgrade from this earlier release. It is possible that a customer is relying on anonymous user behavior in an implementation. This enhancement also proposes a way to opt-out of this reconciliation mechanism. Thus helping cases where changes are not desirable to customer implementations. Later releases of OpenShift removed this access for anonymous users. So, this enhancement would not affect the customers who install a fresh cluster using these later releases.
34+
35+
## Motivation
36+
37+
* In earlier releases of OpenShift, an anonymous user could access “/” endpoint. Later releases revoked this access by removing unauthenticated subjects from cluster role bindings. Because of the way default policy resources are reconciled, after an upgrade from the earlier release, an anonymous user could still access "/" endpoint.
38+
* Exposing unauthenticated endpoints to anonymous users can lead to information leakage. This is undesirable and needs prevention if possible. A user can see the list of available groups and endpoints on an API server using "/" endpoint. As this list could contain sensitive information, it is important to NOT allow anonymous users to access API Server discovery endpoints.
39+
40+
### Goals
41+
42+
> 1. In clusters upgraded from OCP 4.1, remove unauthenticated subjects from cluster role bindings with annotation "rbac.authorization.k8s.io/autoupdate=true".
43+
> 2. Users can opt-out of reconciliation if they set the annotation to "false".
44+
45+
### Non-Goals
46+
47+
## Proposal
48+
49+
* Background
50+
* A user who does not provide enough details for authentication with the kube-apiserver is considered anonymous and will be part of "system:unauthenticated" group.
51+
* Both kube-apiserver and openshift-apiserver create a set of cluster roles and cluster role bindings during bootstrap.
52+
* This [link](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings) has the list of default cluster roles and cluster role bindings in Kubernetes.
53+
* This [link](https://docs.openshift.com/container-platform/4.4/authentication/using-rbac.html#default-roles_using-rbac) has the list of default cluster roles in OpenShift
54+
* "rbac.authorization.k8s.io/autoupdate=true" annotation is also added to default policy resources.
55+
* On start-up both openshift-apiserver and kube-apiserver reconcile default policy resources. They do the following operations if the annotation is not modified.
56+
* create the missing policy resource
57+
* add the missing permissions to cluster roles or add the missing subjects to cluster role bindings.
58+
* reconciliation does not delete any existing permissions or subjects.
59+
* Resources with the annotation set to "false" skips above operations. This allows an admin to opt-out of reconciliation for specific resource.
60+
* Detailed behavior can be found at this [link](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#auto-reconciliation).
61+
62+
* Openshift-apiserver operator implements a new RBACController to reconcile following cluster role bindings created by openshift-apiserver.
63+
* cluster-status-binding
64+
* discovery
65+
* system:openshift:discovery
66+
* basic-users
67+
* If the annotation is not modified, controller removes the unauthenticated subject from the list of subjects and updates the resource in the API sserver.
68+
* Customers can opt-out of this reconciliation by setting the annoation to "false".
69+
70+
### User Stories [optional]
71+
72+
N/A
73+
74+
### Implementation Details/Notes/Constraints [optional]
75+
76+
N/A
77+
78+
### Risks and Mitigations
79+
80+
Because of the earlier releases of OpenShift allowing access to “/” endpoint, some customer implementations might be expecting this privileged access to anonymous users. Removing unauthenticated subject on an upgrade might break some of these implementations. Informing customers beforehand of this change would help the customer to decide better. Customers can either opt-out of reconciliation or change their implementation to match the new requirements. A customer can opt-out of reconciliation by setting the annotation to "false" before the upgrade.
81+
82+
## Design Details
83+
84+
### Test Plan
85+
86+
Existing e2e test can be re-used to validate the change.
87+
88+
### Graduation Criteria
89+
90+
As this enhancement fixes a bug, graduation criteria is not applicable.
91+
92+
##### Removing a deprecated feature
93+
94+
N/A
95+
96+
### Upgrade / Downgrade Strategy
97+
98+
N/A
99+
100+
### Version Skew Strategy
101+
102+
N/A
103+
104+
## Implementation History
105+
106+
N/A
107+
108+
## Drawbacks
109+
110+
N/A
111+
112+
## Alternatives
113+
114+
An alternate implementation is to add an alert to warn of potentially insecure bootstrap policy with instructions to fix. This would not break existing clusters and ensures that they could fix the problem.
115+
116+
## Infrastructure Needed [optional]

0 commit comments

Comments
 (0)