Skip to content

Commit

Permalink
UPSTREAM: <carry>: bootstrap-rbac-policy: move over .well-known rules
Browse files Browse the repository at this point in the history
OpenShift-Rebase-Source: 439ec41
  • Loading branch information
sttts authored and soltysh committed Nov 3, 2023
1 parent eec4cd4 commit 24277b3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go
Expand Up @@ -236,6 +236,15 @@ func clusterRoles() []rbacv1.ClusterRole {
}

roles = append(roles, []rbacv1.ClusterRole{
{
// a role which provides unauthenticated access.
ObjectMeta: metav1.ObjectMeta{Name: "system:openshift:public-info-viewer"},
Rules: []rbacv1.PolicyRule{
rbacv1helpers.NewRule("get").URLs(
"/.well-known", "/.well-known/*",
).RuleOrDie(),
},
},
{
// a role which provides minimal resource access to allow a "normal" user to learn information about themselves
ObjectMeta: metav1.ObjectMeta{Name: "system:basic-user"},
Expand Down Expand Up @@ -608,6 +617,7 @@ func clusterRoleBindings() []rbacv1.ClusterRoleBinding {
rbacv1helpers.NewClusterBinding("system:discovery").Groups(user.AllAuthenticated).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:basic-user").Groups(user.AllAuthenticated).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:public-info-viewer").Groups(user.AllAuthenticated, user.AllUnauthenticated).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:openshift:public-info-viewer").Groups(user.AllAuthenticated, user.AllUnauthenticated).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:node-proxier").Users(user.KubeProxy).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:kube-controller-manager").Users(user.KubeControllerManager).BindingOrDie(),
rbacv1helpers.NewClusterBinding("system:kube-dns").SAs("kube-system", "kube-dns").BindingOrDie(),
Expand Down
Expand Up @@ -149,6 +149,26 @@ items:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: system:kube-proxy
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
creationTimestamp: null
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: system:openshift:public-info-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:openshift:public-info-viewer
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:authenticated
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:unauthenticated
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
Expand Up @@ -1183,6 +1183,21 @@ items:
verbs:
- list
- watch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
creationTimestamp: null
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: system:openshift:public-info-viewer
rules:
- nonResourceURLs:
- /.well-known
- /.well-known/*
verbs:
- get
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down

0 comments on commit 24277b3

Please sign in to comment.