Access control for user groups with different roles in Yandex Identity Hub
This guide describes an example solution of working with user groups to control access to resources in a Yandex Identity Hub organization.
Solution overview
In this tutorial, you will create a test organization with two clouds, production and testing, together with the respective development environments. Three user groups created in the organization will use these clouds: a group of information security engineers (security), a group of DevOps engineers (devops), and a group of developers (developers).
To each user group, you will assign its own set of roles based on the tasks users in these groups perform. For example, information security engineers will have permissions to get information about all resources, set up collection and storage of any resource audit logs, and configure and scan Docker images in registries created in Yandex Container Registry. These permissions will apply to the entire organization.
Additionally, in the production environment, you will create a separate security folder for the group of information security engineers. They will have administrator privileges in this folder to manage any of its resources and control access to them.
The group of DevOps engineers will have permissions to manage registries from Container Registry, Yandex Managed Service for Kubernetes clusters, managed database clusters, VMs, and Yandex Monitoring resources. They will also be able to manage Yandex Cloud Logging log groups and access to them.
The group of developers will get the following access permissions:
- In the production environment, to download Docker images from registries in Container Registry, view information about Kubernetes clusters, connect to Compute Cloud VMs via OS Login, and view information about Monitoring resources and metrics.
- In the testing environment, to download and upload Docker images to registries in Container Registry, manage Kubernetes clusters, connect to Compute Cloud VMs via OS Login as superusers, and manage Monitoring resources.
To configure access control for organization's resources with the help of user groups:
- Prepare Yandex Cloud.
- Create an organization.
- Create clouds.
- Create a folder for the group of information security engineers.
- Create user groups.
- Configure access permissions.
- Add users and split them into groups.
- Create a production infrastructure.
If you no longer need the test organization you created, delete it.
Prepare Yandex Cloud
Sign up for Yandex Cloud and create a billing account:
- Go to the management console
and log in to Yandex Cloud or create a new account. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and its status isACTIVEorTRIAL_ACTIVE. If you do not have a billing account yet, create one.
Create an organization
Organization is a workspace that combines different types of Yandex Cloud resources and users. Any Yandex user can create an organization in Yandex Identity Hub.
To create an organization, follow these steps:
-
Go
to Yandex Identity Hub.Your next steps will depend on whether you are a member of an exsiting Yandex Identity Hub.
-
Create an organization:
If you are not a member of any organizationIf you are a member of an organizationIf you are currently not a member of any Yandex Identity Hub, when you open the link, you will see a form for creating a new organization:
- Enter your organization name, e.g.,
Example organization. - Click Create a new organization.
If you are currently a member of a Yandex Identity Hub, when you open the link, you will see the Yandex Identity Hub
interface in Cloud Center.To complete this guide, let’s create a new organization so as not to interfere with the existing organizations’ infrastructure:
- In the top-left corner, next to the current organization name, click
and select Create organization. - In the window that opens, enter a name for the organization:
Example organization. - Click Create a new organization.
- Enter your organization name, e.g.,
Once the organization is created, you become its owner and can manage its settings.
Create clouds
In your new organization, create two clouds, testing and production, to host the infrastructure of the independent testing and production environments.
-
Create two clouds in your
Example organization:Management console-
Go to the management console
and click your account picture in the left-hand panel. -
Select
Example organization. This opens a window with the form for creating your first cloud:- Make sure you selected
Example organizationin the Organization field. - In the Cloud name field, specify
testing. - Click Create.
As a result,
Example organizationwill have its first cloud namedtesting, and the browser will open thedefaultfolder created in this new cloud. - Make sure you selected
-
On the left side of the screen, in the line with
Example organization, click and select Create cloud. In the window that opens, do the following:- In the Name field, specify
production. - Click Create.
This will create the second cloud named
productionin yourExample organization. - In the Name field, specify
-
-
Make sure the clouds are linked to a billing account:
Cloud Center UI-
Go to Yandex Cloud Billing
. -
Select your billing account.
-
Make sure you can see both clouds,
productionandtesting, under Linked clouds and services on the account information page. -
If either of the clouds is missing, link them:
- Under Linked clouds and services, click
Link cloud. - In the window that opens, select the cloud to link and click Bind.
- Under Linked clouds and services, click
-
Create a folder for the group of information security engineers
Create a separate folder named security for the group of information security engineers in the production cloud.
-
In the management console
, select theproductioncloud from the list of organizations, clouds, and folders on the left of the screen. -
In the line with the
productioncloud name, click and select Create folder. In the window that opens, do the following:- In the Name field, enter the folder name,
security. - Optionally, in the Description field, enter a description for the new folder.
- In the Advanced field, disable Create a default network. You will be able to create a cloud network with the parameters you need later, at any point when creating the infrastructure.
- Click Create.
- In the Name field, enter the folder name,
Create user groups
Create three user groups: security for information security engineers, devops for DevOps engineers, and developers for developers.
-
Log in to Yandex Identity Hub
. -
In the left-hand panel, select
Groups. -
In the top-right corner, click
Create group and in the window that opens:- Enter a name for the group:
security. - Optionally, enter the group description.
- Click Create group.
- Enter a name for the group:
-
Similarly, create the other two user groups,
devopsanddevelopers.
Configure access permissions
In this tutorial, you will assign multiple roles to the user groups based on the activity profiles of the employees in these groups.
Note
All users in a user group will automatically inherit the roles assigned to the group. Moreover, you can assign roles to each user individually, even if they belong to a user group.
Assign roles to the group of information security engineers
Users from the group of information security engineers (security) will need permissions to do the following:
- Get information about all resources in all organization clouds (
auditorrole for the organization). - Configue collection and storage of audit logs for all resources in all the organization’s clouds (
audit-trails.adminrole for the organization). - Configure and scan Docker images in the Yandex Container Registry registries of all the organization’s clouds (
container-registry.images.scannerrole for the organization). - Manage all resources and access to them in the dedicated
securityfolder of theproductioncloud (adminrole for the folder).
To grant the required access permissions to the security user group:
-
Assign roles for an organization:
Cloud Center UI- Log in to Yandex Identity Hub
using an administrator or organization owner account. - In the left-hand panel, select
Access bindings. - At the top right, click Assign bindings.
- Go to the Groups tab and select the
securitygroup. - Click
Add role, enter and select theauditorrole in the search bar. - Repeat the previous step to add the
audit-trails.adminandcontainer-registry.images.scannerroles. - Click Save.
- Log in to Yandex Identity Hub
-
Assign the
adminrole for thesecurityfolder:Management console-
In the management console
, select thesecurityfolder in theproductioncloud. -
At the top of the screen, go to the Access bindings tab and click Configure access. In the window that opens, do the following:
- Go to the Groups tab and select the
securitygroup. - Click
Add role, enter and select theadminrole in the search bar. - Click Save.
- Go to the Groups tab and select the
-
Assign roles to the group of DevOps engineers
Users from the group of DevOps engineers (devops) will need to be able to do the following in both clouds:
- Manage registries in Container Registry (
container-registry.editorrole for both clouds). - Manage Yandex Managed Service for Kubernetes clusters (
k8s.editorrole for both clouds). - Manage database clusters (
mdb.adminrole for both clouds). - Manage Yandex Compute Cloud VMs (
compute.editorrole for both clouds). - Manage Yandex Monitoring resources (
monitoring.adminrole for both clouds). - Manage Yandex Cloud Logging log groups and access to them (
logging.adminrole for both clouds).
Assign roles for the clouds to the devops user group:
-
In the management console
, select theproductioncloud. -
At the top of the screen, go to the Access bindings tab and click Configure access. In the window that opens, do the following:
- Go to the Groups tab and select the
devopsgroup. - Click
Add role, find and select thecontainer-registry.editor,k8s.editor,mdb.admin,compute.editor,monitoring.admin, andlogging.adminroles. - Click Save.
- Go to the Groups tab and select the
-
In the same way, assign the same roles for the
testingcloud to thedevopsuser group.
Assign roles to the group of developers
Users from the group of developers (developers) will need permissions to do the following:
- Download Docker images from registries in Container Registry in the production environment (
container-registry.images.pullerrole for theproductioncloud). - Download and upload Docker images to registries in Container Registry in the testing environment (
container-registry.images.pusherrole for thetestingcloud). - View information about Kubernetes clusters in the testing environment (
k8s.viewerrole for theproductioncloud). - Manage Kubernetes clusters in the testing environment (
k8s.editorrole andk8s.cluster-api.editorrole for thetestingcloud). - Connect to Compute Cloud VMs via OS Login in the production environment (
compute.osLoginrole for theproductioncloud). - Connect to Compute Cloud VMs via OS Login as superusers in the testing environment (
compute.osAdminLoginrole for thetestingcloud). - View information about Monitoring resources and metrics in production environment (
monitoring.viewerrole for theproductioncloud). - Manage Monitoring resources in the testing environment (
monitoring.editorrole for thetestingcloud).
Assign roles for the clouds to the developers user group:
-
In the management console
, select theproductioncloud. -
At the top of the screen, go to the Access bindings tab and click Configure access. In the window that opens, do the following:
- Go to the Groups tab and select the
developersgroup. - Click
Add role, find and select thecontainer-registry.images.puller,k8s.viewer,compute.osLogin, andmonitoring.viewerroles. - Click Save.
- Go to the Groups tab and select the
-
In the same way, assign the
developersuser group thecontainer-registry.images.pusher,k8s.editor,k8s.cluster-api.editor,compute.osAdminLogin, andmonitoring.editorroles for thetestingcloud.
Add users and split them into groups
To enable your employees to use Yandex Cloud resources, add them to the Yandex Identity Hub you created. Then distribute the employees among the previously created user groups.
-
Invite users to an organization:
Cloud Center UI-
Go to Yandex Identity Hub
. -
In the left-hand panel, select
Users. -
In the top-right corner, click Invite users with a Yandex account.
-
Enter the email addresses of the users you want to invite to the organization, separated by commas.
You can send invitations to any email address. Invited users will be able to select the appropriate Yandex account once they accept the invitation.
-
Click Send invitation.
Once the users accept the invitation by clicking the invitation link in the email, they will become organization members and will be listed in the Users section
in your organization.Note
To access the services enabled for the organization, the users you invited simply need to log in to their Yandex account.
-
-
Distribute users you added among the previously created groups:
Cloud Center UI-
Log in to Yandex Identity Hub
. -
In the left-hand panel, select
Groups and click the row with the name of the group you need. -
Navigate to the Members tab.
-
Click Add member. In the window that opens, do the following:
- Select the users. Use search, if required.
- Click Save.
Distribute all users among the previously created groups based on their tasks.
Note
A user may belong to multiple groups at the same time.
-
Create a production infrastructure
You have configured basic access permissions in your test organization. Now you can create different resources in your organization clouds: VMs, Yandex Managed Service for Kubernetes clusters, Yandex Container Registry registries, KMS encryption keys, Lockbox secrets, etc.
Warning
Note that VMs, clusters, registries, key, secrets, and many other resources created in folders are charged. You can learn more about the cost of cloud resources in the respective service pricing reference.
Access permissions to the created resources will be granted to users based on the access permissions settings of the relevant user group.
We recommend managing your infrastructure under service accounts which you can use to authenticate applications. Service accounts are created in folders. You can also add service accounts to user groups.
If you need to, you can assign additional roles to individual users or service accounts for an entire organization or individual clouds, folders, or resources at any time.
How to delete the resources you created
If you no longer need the created test organization, delete it.
You do not have to pay for organizations, clouds, folders, and users. However, you may be charged for other resources created within folders.
In addition to that, the infrastructure you create in this tutorial consumes quotas in Yandex Cloud Billing and some other services. Therefore, we recommend deleting an organization you do not use.
You can also separately delete clouds, folders, user groups, or service accounts from an organization.
See also
- Yandex Audit Trails:
- Yandex Cloud Billing:
- Yandex Cloud Logging:
- Yandex Identity Hub:
- Yandex Compute Cloud:
- Yandex Container Registry:
- Yandex Identity and Access Management:
- Yandex Key Management Service:
- Yandex Lockbox:
- Yandex Managed Service for Kubernetes:
- Yandex Managed Service for PostgreSQL:
- Yandex Monitoring: