Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind Emergency and Manual Groups same as PowerUser #2358

Merged
merged 2 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cluster/manifests/roles/poweruser-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ subjects:
- kind: Group
name: PowerUser
apiGroup: rbac.authorization.k8s.io
- kind: Group
name: Manual
apiGroup: rbac.authorization.k8s.io
- kind: Group
name: Emergency
apiGroup: rbac.authorization.k8s.io
2 changes: 1 addition & 1 deletion cluster/node-pools/master-default/userdata.clc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ storage:
- mountPath: /etc/kubernetes/ssl
name: ssl-certs-kubernetes
readOnly: true
- image: registry.opensource.zalan.do/teapot/k8s-authnz-webhook:v0.5.6
- image: registry.opensource.zalan.do/teapot/k8s-authnz-webhook:v0.5.7
name: webhook
ports:
- containerPort: 8081
Expand Down
2 changes: 1 addition & 1 deletion cluster/node-pools/master-ubuntu-default/userdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ write_files:
- mountPath: /etc/kubernetes/ssl
name: ssl-certs-kubernetes
readOnly: true
- image: registry.opensource.zalan.do/teapot/k8s-authnz-webhook:v0.5.6
- image: registry.opensource.zalan.do/teapot/k8s-authnz-webhook:v0.5.7
name: webhook
ports:
- containerPort: 8081
Expand Down
28 changes: 28 additions & 0 deletions test/e2e/authorisation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2156,6 +2156,34 @@ var _ = framework.KubeDescribe("Authorization tests", func() {
}}`,
},
},
{
msg: "cdp service account can't escalate permissions",
reqBody: `{
"apiVersion": "authorization.k8s.io/v1beta1",
"kind": "SubjectAccessReview",
"spec": {
"resourceAttributes": {
"namespace": "",
"verb": "escalate",
"group": "*",
"resource": "clusterroles"
},
"user": "system:serviceaccount:default:cdp",
"group": []
}
}`,
expect: expect{
status: http.StatusCreated,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious: why are we using 201, when the request was rejected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how the AccessReview API works. You "create" a review request 201 and then the response is whether the user would have access to perform that action or not.

body: `{
"apiVersion": "authorization.k8s.io/v1beta1",
"kind": "SubjectAccessReview",
"status": {
"denied": true,
"reason": "no one is allowed to escalate"
}
}}`,
},
},
{
msg: "operator service account cannot create namespaces",
reqBody: `{
Expand Down