Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 17. Impersonating the system:admin user
17.1. API impersonation Copier lienLien copié sur presse-papiers!
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.
17.2. Impersonating the system:admin user Copier lienLien copié sur presse-papiers!
				You can grant a user permission to impersonate system:admin, which grants them cluster administrator 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>
$ oc create clusterrolebinding <any_valid_name> --clusterrole=sudoer --user=<username>Copy to Clipboard Copied! Toggle word wrap Toggle overflow TipYou can alternatively apply the following YAML to grant permission to impersonate
system:admin:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
17.3. Impersonating the system:admin group Copier lienLien copié sur presse-papiers!
				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:adminby 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>
$ oc create clusterrolebinding <any_valid_name> --clusterrole=sudoer --as=<user> \ --as-group=<group1> --as-group=<group2>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
17.4. Adding unauthenticated groups to cluster roles Copier lienLien copié sur presse-papiers!
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 
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-adminrole. - 
						You have installed the OpenShift CLI (
oc). 
Procedure
Create a YAML file named
add-<cluster_role>-unauth.yamland add the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the configuration by running the following command:
oc apply -f add-<cluster_role>.yaml
$ oc apply -f add-<cluster_role>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow