このコンテンツは選択した言語では利用できません。
Chapter 15. Manage identities and authorizations
Manage identities and authorizations for Red Hat OpenShift Dev Spaces, including cluster roles, advanced authorization policies, and GDPR-compliant user data removal.
15.1. Configure cluster roles for OpenShift Dev Spaces users リンクのコピーリンクがクリップボードにコピーされました!
Grant OpenShift Dev Spaces users additional cluster permissions by adding cluster roles, enabling them to perform actions beyond the default workspace operations.
Prerequisites
-
You have an active
ocsession with administrative permissions to the destination OpenShift cluster. See Getting started with the CLI.
Procedure
Define the user roles name:
$ USER_ROLES=<name>where:
- name
- Unique resource name.
Determine the namespace where the OpenShift Dev Spaces Operator is deployed:
$ OPERATOR_NAMESPACE=$(oc get pods -l app.kubernetes.io/component=devspaces-operator -o jsonpath={".items[0].metadata.namespace"} --all-namespaces)Create needed roles:
$ kubectl apply -f - <<EOF kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: ${USER_ROLES} labels: app.kubernetes.io/part-of: che.eclipse.org rules: - verbs: - <verbs> apiGroups: - <apiGroups> resources: - <resources> EOFwhere:
- verbs
-
List all Verbs that apply to all ResourceKinds and AttributeRestrictions contained in this rule. You can use
*to represent all verbs. - apiGroups
- Name the APIGroups that contain the resources.
- resources
-
List all resources that this rule applies to. You can use
*to represent all verbs.
Delegate the roles to the OpenShift Dev Spaces Operator:
$ kubectl apply -f - <<EOF kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: ${USER_ROLES} labels: app.kubernetes.io/part-of: che.eclipse.org subjects: - kind: ServiceAccount name: devspaces-operator namespace: ${OPERATOR_NAMESPACE} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: ${USER_ROLES} EOFConfigure the OpenShift Dev Spaces Operator to delegate the roles to the
cheservice account:$ kubectl patch checluster devspaces \ --patch '{"spec": {"components": {"cheServer": {"clusterRoles": ["'${USER_ROLES}'"]}}}}' \ --type=merge -n openshift-devspacesConfigure the OpenShift Dev Spaces server to delegate the roles to a user:
$ kubectl patch checluster devspaces \ --patch '{"spec": {"devEnvironments": {"user": {"clusterRoles": ["'${USER_ROLES}'"]}}}}' \ --type=merge -n openshift-devspaces- Wait for the rollout of the OpenShift Dev Spaces server components to complete.
- Ask the user to log out and log in to have the new roles applied.
Verification
Verify that the ClusterRole exists:
$ kubectl get clusterrole ${USER_ROLES}
15.2. Configure advanced authorization リンクのコピーリンクがクリップボードにコピーされました!
Determine which users and groups are allowed to access OpenShift Dev Spaces to enforce access control policies and meet organizational compliance requirements.
Prerequisites
-
You have an active
ocsession with administrative permissions to the destination OpenShift cluster. See Getting started with the CLI.
Procedure
Configure the
CheClusterCustom Resource. See Section 5.3, “Use the CLI to configure the CheCluster Custom Resource”.spec: networking: auth: advancedAuthorization: allowUsers: - <allow_users> allowGroups: - <allow_groups> denyUsers: - <deny_users> denyGroups: - <deny_groups>where:
- allowUsers
- List of users allowed to access Red Hat OpenShift Dev Spaces.
- allowGroups
- List of groups of users allowed to access Red Hat OpenShift Dev Spaces (for OpenShift Container Platform only).
- denyUsers
- List of users denied access to Red Hat OpenShift Dev Spaces.
- denyGroups
List of groups of users denied access to Red Hat OpenShift Dev Spaces (for OpenShift Container Platform only).
If a user is on both
allowanddenylists, access is denied. IfallowUsersandallowGroupsare empty, all users are allowed except the ones on thedenylists. IfdenyUsersanddenyGroupsare empty, only the users fromallowlists are allowed. If bothallowanddenylists are empty, all users are allowed.
- Wait for the rollout of the OpenShift Dev Spaces server components to complete.
Verification
-
Log in to the OpenShift Dev Spaces dashboard as a user on the
allowUserslist and verify access to the dashboard. -
Log in as a user on the
denyUserslist and verify that OpenShift Dev Spaces returns a403 Forbiddenresponse.
15.3. Remove user data in compliance with the GDPR リンクのコピーリンクがクリップボードにコピーされました!
Remove a user’s data on OpenShift Container Platform in compliance with the General Data Protection Regulation (GDPR). The process for other Kubernetes infrastructures might vary.
Removing user data as follows is irreversible. All removed data is deleted and unrecoverable.
Prerequisites
-
You have an active
ocsession with administrative permissions for the OpenShift Container Platform cluster. See Getting started with the OpenShift CLI.
Procedure
List all the users in the OpenShift cluster using the following command:
$ oc get usersDelete the user entry:
ImportantIf the user has any associated resources (such as projects, roles, or service accounts), you must delete those first before deleting the user.
$ oc delete user <username>