このコンテンツは選択した言語では利用できません。

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

Procedure

  1. Define the user roles name:

    $ USER_ROLES=<name>

    where:

    name
    Unique resource name.
  2. 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)
  3. 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>
    EOF

    where:

    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.
  4. 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}
    EOF
  5. Configure the OpenShift Dev Spaces Operator to delegate the roles to the che service account:

    $ kubectl patch checluster devspaces \
      --patch '{"spec": {"components": {"cheServer": {"clusterRoles": ["'${USER_ROLES}'"]}}}}' \
      --type=merge -n openshift-devspaces
  6. Configure 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
  7. Wait for the rollout of the OpenShift Dev Spaces server components to complete.
  8. 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

Procedure

  1. Configure the CheCluster Custom 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 allow and deny lists, access is denied. If allowUsers and allowGroups are empty, all users are allowed except the ones on the deny lists. If denyUsers and denyGroups are empty, only the users from allow lists are allowed. If both allow and deny lists are empty, all users are allowed.

  2. 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 allowUsers list and verify access to the dashboard.
  • Log in as a user on the denyUsers list and verify that OpenShift Dev Spaces returns a 403 Forbidden response.

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.

Warning

Removing user data as follows is irreversible. All removed data is deleted and unrecoverable.

Prerequisites

Procedure

  1. List all the users in the OpenShift cluster using the following command:

    $ oc get users
  2. Delete the user entry:

    Important

    If 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>
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る