-
Notifications
You must be signed in to change notification settings - Fork 117
https://issues.redhat.com/browse/ACM-23588 validate spec for cluster permissions #8350
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
Changes from 4 commits
20a3c8f
3e0bbbd
a2407b2
05967d8
3ecd5ac
d1e98b6
0fc6517
c276e38
561f164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| [#enable-cluster-val] | ||
|
||
| = Enabling validation for cluster permissions | ||
|
|
||
| Enable the `validate` specification within your `ClusterPermission` resources to check the accuracy of your `Role` and `ClusterRole` resources. | ||
|
||
|
|
||
| *Required access:* Cluster administrator | ||
|
|
||
| Complete the following steps: | ||
|
|
||
| . Create a `ClusterPermission` resource where you set the `validate` specification to `true`.Define the `roleBindings` and `clusterRoleBinding` that you want to validate. | ||
| + | ||
| Your YAML file might resemble the following example where you configure the `ClusteerRole` to validate the `edit` `ClusterRole` for the `sa-sample-existing` `ServiceAccount`, and the `view` `ClusterRole` for `Group1`: | ||
|
|
||
| + | ||
| [source,yaml] | ||
| ---- | ||
| apiVersion: rbac.open-cluster-management.io/v1alpha1 | ||
| kind: ClusterPermission | ||
| metadata: | ||
| name: clusterpermission-validate-sample | ||
| spec: | ||
| validate: true | ||
| roleBindings: | ||
| - name: default-existing | ||
| namespace: default | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: edit | ||
| subject: | ||
| namespace: openshift-gitops | ||
| kind: ServiceAccount | ||
| name: sa-sample-existing | ||
| clusterRoleBinding: | ||
| name: crb-cluster1-argo-app-con-3-existing | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: view | ||
| subject: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Group | ||
| name: group1 | ||
| ---- | ||
|
|
||
| . Apply your `clusterpermission-validate-sample` `ClusterPermission` by running the following command: | ||
|
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| oc apply clusterpermission-validate-sample.yaml | ||
| ---- | ||
Uh oh!
There was an error while loading. Please reload this page.