Configuring group management access
You can grant access to a user group to:
To do this, assign roles for the group. To choose the ones you need, learn about the service's roles.
Assigning a role
- Log in to Yandex Identity Hub
using an administrator or organization owner account. - In the left-hand panel, select
Groups and click the row with the name of the group you need. - Navigate to the Group access rights tab.
- Click Assign roles.
- Select the group, user, or service account you need to grant access to the group. Use search, if required.
- Click
Add role and select the roles that you need to assign to the group. - Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To grant access permissions for a user group:
-
View the description of the CLI command for assigning roles:
yc organization-manager group add-access-binding --help -
Get a list of user groups with their IDs:
yc organization-manager group list \ --organization-id <organization_ID> -
Get the ID of the user, service account, or user group you need to grant access to the group.
-
Use the
yc organization-manager group add-access-bindingcommand to assign the following role:yc organization-manager group add-access-binding \ --id <group_ID> \ --role <role> \ --subject <subject_type>:<subject_ID>Where:
-
--id: ID of the user group to grant access to. -
--role: Role ID. -
--subject: Subject getting the role.Subject designations
To indicate a subject, use the
--subjectparameter in<subject_type>:<ID>format. For some subject types, the Yandex Cloud CLI provides separate parameters instead of--subject, where you only need to specify the subject name or ID without the type. Possible subject designations and the corresponding CLI parameters:Subject type
Subject designation
Yandex Cloud CLI parameter
userAccountuserAccount:<user_ID>--user-account-idor--user-yandex-loginserviceAccountserviceAccount:<service_account_ID>--service-account-idor--service-account-namefederatedUserfederatedUser:<user_ID>--user-account-idgroupgroup:<group_ID>--group-memberssystemsystem:allAuthenticatedUsers(
All authenticated usersgroup)--all-authenticated-userssystem:allUsers(
All usersgroup)—
system:group:organization:<organization_ID>:users(
All users in organization Xgroup)--organization-userssystem:group:federation:<federation_ID>:users(
All users in federation Ngroup)--federation-userssystem:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)—
-
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
-
Get the ID of the user, service account, or user group you need to grant access to the group.
-
Describe the parameters of the roles you assign in the configuration file:
resource "yandex_organizationmanager_group_iam_member" "editor" { group_id = "<group_ID>" role = "<role_ID>" member = "<subject>" }Where:
-
group_id: User group ID. -
role: Role. This is a required setting. -
member: Subject getting the role. This is a required setting.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
For more on the properties of the
yandex_organizationmanager_group_iam_memberresource, see this provider guide. -
-
Create the resources:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
With this done, the specified subjects will get their roles for the user group. You can check the role assignment using the Cloud Center UI
To assign a role for a user group to a subject, use the updateAccessBindings REST API method for the Group resource or the GroupService/UpdateAccessBindings gRPC API call and provide the following in the request:
-
ADDvalue in theaccessBindingDeltas[].actionparameter to add a role. -
Role in the
accessBindingDeltas[].accessBinding.roleIdparameter. -
ID of the subject getting the role in the
accessBindingDeltas[].accessBinding.subject.idparameter. -
Type of the subject getting the role in the
accessBindingDeltas[].accessBinding.subject.typeparameter.Subject designations
To indicate a subject, use a combination of its type and unique ID in the
subject.typeandsubject.idfields of the request. Possible combinations:subject.type
subject.id
userAccount<user_ID>serviceAccount<service_account_ID>federatedUser<user_ID>group<group_ID>systemallAuthenticatedUsers(
All authenticated usersgroup)allUsers(
All usersgroup)group:organization:<organization_ID>:users(
All users in organization Xgroup)group:federation:<federation_ID>:users(
All users in federation Ngroup)group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
Assigning multiple roles
- Log in to Yandex Identity Hub
as the organization administrator or owner. - In the left-hand panel, select
Groups and click the line with the group name. - Navigate to the Group access rights tab.
- Click Assign roles.
- Select the user, group, or service account you need to grant access to the group. Use search, if required.
- Click
Add role and select the roles that you need to assign to the group. - Click Save.
Alert
The set-access-bindings command for assigning multiple roles completely rewrites access permissions for the resource. All current resource roles will be deleted.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To assign multiple roles for a user group:
-
Make sure the resource has no important roles assigned before proceeding:
yc organization-manager group list-access-bindings \ --id <group_ID> -
View the description of the CLI command for assigning roles:
yc organization-manager group set-access-bindings --help -
Get a list of user groups with their IDs:
yc organization-manager group list -
Get the ID of the user, service account, or user group you need to grant access to the group.
-
Use the
yc organization-manager group set-access-bindingscommand to assign the following roles:yc organization-manager group set-access-bindings \ --id <group_ID> \ --access-binding role=<role>,subject=<subject_type>:<subject_ID>Where:
-
--id: ID of the user group to grant access to. -
role: ID of the role you need to assign. -
subject: Subject getting the role.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
Provide a separate
--access-bindingparameter for each role. Here is an example:yc organization-manager group set-access-bindings \ --id ins672qpemb4******** \ --access-binding role=<role1>,subject=serviceAccount:<service_account_ID> \ --access-binding role=<role2>,subject=serviceAccount:<service_account_ID> \ --access-binding role=<role3>,subject=serviceAccount:<service_account_ID> -
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
To assign multiple roles for a user group:
-
Describe the parameters of the roles you assign in the configuration file:
resource "yandex_organizationmanager_group_iam_member" "role1" { group_id = "<group_ID>" role = "<role1>" member = "<subject_type>:<subject_ID>" } resource "yandex_organizationmanager_group_iam_member" "role2" { group_id = "<group_ID>" role = "<role2>" member = "<subject_type>:<subject_ID>" } resource "yandex_organizationmanager_group_iam_member" "role3" { group_id = "<group_ID>" role = "<role3>" member = "<subject_type>:<subject_ID>" }Where:
-
group_id: User group ID. -
role: Role you want to assign. -
member: Subject getting the role.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
For more on the properties of the
yandex_organizationmanager_group_iam_memberresource, see this provider guide. -
-
Create the resources:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
With this done, the specified subject will get several roles for the user group. You can check role assignments using the Cloud Center UI
Alert
The setAccessBindings method for assigning multiple roles completely rewrites access permissions for the resource. All current resource roles will be deleted.
To assign several roles for a user group to a subject, use the setAccessBindings REST API method for the Group resource or the GroupService/SetAccessBindings gRPC API call. In your request, provide an array of objects, each one matching a particular role and containing the following data:
-
Role in the
accessBindings[].roleIdparameter. -
ID of the subject getting the roles in the
accessBindings[].subject.idparameter. -
Type of the subject getting the roles in the
accessBindings[].subject.typeparameter.Subject designations
To indicate a subject, use a combination of its type and unique ID in the
subject.typeandsubject.idfields of the request. Possible combinations:subject.type
subject.id
userAccount<user_ID>serviceAccount<service_account_ID>federatedUser<user_ID>group<group_ID>systemallAuthenticatedUsers(
All authenticated usersgroup)allUsers(
All usersgroup)group:organization:<organization_ID>:users(
All users in organization Xgroup)group:federation:<federation_ID>:users(
All users in federation Ngroup)group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
Revoking a role
-
Log in to Yandex Identity Hub
as the organization administrator or owner. -
In the left-hand panel, select
Groups and click the line with the group name. -
Navigate to the Group access rights tab.
-
To revoke roles:
- In the row with the user, service account, or group, click
and select Configure access. - Click
next to the roles you want to revoke. - Click Save.
- In the row with the user, service account, or group, click
-
To revoke all roles, in the row with the user, service account, or group, click
and select Revoke access. Confirm the action.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
See the description of the CLI command to revoke a role:
yc organization-manager group remove-access-binding --help -
Get a list of user groups with their IDs:
yc organization-manager group list \ --organization-id <organization_ID> -
Get the ID of the user, service account, or user group you are revoking a role from.
-
Use the
yc organization-manager group remove-access-bindingcommand to revoke the role from the subject:yc organization-manager group remove-access-binding \ --id <group_ID> \ --role <role> \ --subject <subject_type>:<subject_ID>Where:
-
--id: ID of the user group to which access was granted. -
--role: ID of the role you want to revoke. -
--subject: Subject to revoke the role from.Subject designations
To indicate a subject, use the
--subjectparameter in<subject_type>:<ID>format. For some subject types, the Yandex Cloud CLI provides separate parameters instead of--subject, where you only need to specify the subject name or ID without the type. Possible subject designations and the corresponding CLI parameters:Subject type
Subject designation
Yandex Cloud CLI parameter
userAccountuserAccount:<user_ID>--user-account-idor--user-yandex-loginserviceAccountserviceAccount:<service_account_ID>--service-account-idor--service-account-namefederatedUserfederatedUser:<user_ID>--user-account-idgroupgroup:<group_ID>--group-memberssystemsystem:allAuthenticatedUsers(
All authenticated usersgroup)--all-authenticated-userssystem:allUsers(
All usersgroup)—
system:group:organization:<organization_ID>:users(
All users in organization Xgroup)--organization-userssystem:group:federation:<federation_ID>:users(
All users in federation Ngroup)--federation-userssystem:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)—
-
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
To revoke a role from a user, service account, or user group:
-
Open the Terraform configuration file and remove the part containing the
yandex_organizationmanager_group_iam_memberresource for the role you want to revoke.resource "yandex_organizationmanager_group_iam_member" "editor" { group_id = "<group_ID>" role = "<role_ID>" member = "<subject_type>:<subject_ID>" }Where:
-
group_id: User group ID. -
role: Role being revoked. This is a required setting. -
member: Subject to revoke the role from. This is a required setting.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
-
-
Apply the changes:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
The role will be revoked from the subject you indicated. You can check the role is no longer assigned using the Cloud Center UI
To revoke a role for a user group from a subject, use the updateAccessBindings REST API method for the Group resource or the GroupService/UpdateAccessBindings gRPC API call and provide the following in the request:
-
REMOVEin theaccessBindingDeltas[].actionparameter to revoke the role. -
Role in the
accessBindingDeltas[].accessBinding.roleIdparameter. -
ID of the subject to revoke the role from in the
accessBindingDeltas[].accessBinding.subject.idparameter. -
Type of the subject to revoke the role from in the
accessBindingDeltas[].accessBinding.subject.typeparameter.Subject designations
To indicate a subject, use a combination of its type and unique ID in the
subject.typeandsubject.idfields of the request. Possible combinations:subject.type
subject.id
userAccount<user_ID>serviceAccount<service_account_ID>federatedUser<user_ID>group<group_ID>systemallAuthenticatedUsers(
All authenticated usersgroup)allUsers(
All usersgroup)group:organization:<organization_ID>:users(
All users in organization Xgroup)group:federation:<federation_ID>:users(
All users in federation Ngroup)group:userpool:<pool_ID>:users(
All users in userpool Pgroup)