이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 18. Impersonating the system:admin user


18.1. API impersonation

You can configure a request to the OpenShift Container Platform API to act as though it originated from another user. For more information, see User impersonation in the Kubernetes documentation.

18.2. Impersonating the system:admin user

You can use the OpenShift web console to impersonate a user and select multiple group memberships at the same time to reproduce that user’s effective permissions.

Procedure

  • To grant a user permission to impersonate system:admin, run the following command:

    $ oc create clusterrolebinding <any_valid_name> --clusterrole=sudoer --user=<username>
    Copy to Clipboard Toggle word wrap
    Tip

    You can alternatively apply the following YAML to grant permission to impersonate system:admin:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: <any_valid_name>
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: sudoer
    subjects:
    - apiGroup: rbac.authorization.k8s.io
      kind: User
      name: <username>
    Copy to Clipboard Toggle word wrap

18.3. Impersonating the system:admin group

When a system:admin user is granted cluster administration permissions through a group, you must include the --as=<user> --as-group=<group1> --as-group=<group2> parameters in the command to impersonate the associated groups.

Procedure

  • To grant a user permission to impersonate a system:admin by impersonating the associated cluster administration groups, run the following command:

    $ oc create clusterrolebinding <any_valid_name> --clusterrole=sudoer --as=<user> \
    --as-group=<group1> --as-group=<group2>
    Copy to Clipboard Toggle word wrap

18.4. Impersonating a user with multiple group memberships in the web console

You can start user impersonation from multiple locations in the OpenShift Container Platform Console. Depending on where you start, you can impersonate a single user, a single group, or a user with one or more group memberships.

Prerequisites

  • You must be logged in to the OpenShift Container Platform web console as a user with permission to impersonate other users.
  • The user or group that you want to impersonate must already exist.
Note

The impersonated user can belong to zero or more groups.

Procedure

  1. From the Overview page in the OpenShift Container Platform console, click your user name and select Impersonate User.
  2. In the Username field in the Impersonate dialog, enter the name of the user you want to impersonate.
  3. Optional: In the Groups field, choose one or more groups that are associated with the user.

    The dialog displays a warning message explaining that impersonation applies the effective permissions of the specified user and any selected groups.

  4. Click Impersonate to impersonate your selected user, groups, or both.
Note

Selecting one group uses the existing single-group impersonation behavior. Selecting no groups uses regular single-user impersonation.

18.5. Starting impersonation from the Users or Groups pages

You can start impersonation for users or groups from the Users or Groups pages in the OpenShift Container Platform Console.

Procedure

  1. From the Overview page in the OpenShift Container Platform console, click User Management Users.
  2. Open the menu for the user you want to impersonate and select Impersonate User.
  3. Optional: To impersonate a group, click User Management Groups, click the menu for that group, and select Impersonate Group.

18.6. Stopping impersonation

You can stop impersonating a user or group at any time from the OpenShift Container Platform Console.

Procedure

  1. On any page in the OpenShift Container Platform console, click Stop impersonating at the top of the page.
  2. Alternatively, click your user name and select Stop impersonating.

18.7. Adding unauthenticated groups to cluster roles

As a cluster administrator, you can add unauthenticated users to the following cluster roles in OpenShift Container Platform by creating a cluster role binding. Unauthenticated users do not have access to non-public cluster roles. This should only be done in specific use cases when necessary.

You can add unauthenticated users to the following cluster roles:

  • system:scope-impersonation
  • system:webhook
  • system:oauth-token-deleter
  • self-access-reviewer
Important

Always verify compliance with your organization’s security standards when modifying unauthenticated access.

Prerequisites

  • You have access to the cluster as a user with the cluster-admin role.
  • You have installed the OpenShift CLI (oc).

Procedure

  1. Create a YAML file named add-<cluster_role>-unauth.yaml and add the following content:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
     annotations:
       rbac.authorization.kubernetes.io/autoupdate: "true"
     name: <cluster_role>access-unauthenticated
    roleRef:
     apiGroup: rbac.authorization.k8s.io
     kind: ClusterRole
     name: <cluster_role>
    subjects:
     - apiGroup: rbac.authorization.k8s.io
       kind: Group
       name: system:unauthenticated
    Copy to Clipboard Toggle word wrap
  2. Apply the configuration by running the following command:

    $ oc apply -f add-<cluster_role>.yaml
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동