Getting information about subjects in the Yandex Cloud access management system
Yandex Identity and Access Management provides a feature for getting information about subjects to simultaneously search for and retrieve attributes of different types of subjects in the Yandex Cloud access management system.
Additional flexibility when searching for subjects and retrieving subject attributes comes from using filters based on the Common Expression Language (CEL)
This feature is available in the Yandex Cloud CLI and API interfaces.
Subject types
You can use this feature to search for multiple subject types within an organization at the same time:
| Subject type | Description | Minimum role required to get information |
|---|---|---|
USER_ACCOUNT |
Yandex account users, local users, and federated users | organization-manager.users.viewer or higher for the organization |
SERVICE_ACCOUNT |
Service accounts | iam.auditor or higher for the organization |
GROUP |
User groups, system groups, and public groups | organization-manager.groups.viewer or higher for the organization |
INVITEE |
Yandex account users who have been invited to the organization but have not yet accepted the invitation | organization-manager.users.viewer or higher for the organization |
Available methods
Identity and Access Management supports two methods for getting information about subjects: List and BatchGet.
When calling either method, you can provide a subject mask (field-mask) that specifies which subject attributes to retrieve. If you do not specify a subject mask, the method only returns sub and type by default. The available attributes depend on the subject type. For more information, see Subject attributes.
You can also use a flexible CEL filter when calling either method to narrow down the list of subjects you want to get information about.
For more info on using methods for getting subject details, see Getting information about subjects in the Yandex Cloud access management system.
List
The List method returns a list of organization subjects and their details based on the organization ID. You can use the REST API, gRPC API, or yc iam subject-details list CLI command to call List.
When calling the List method, make sure to provide the ID of the organization to search for subjects in.
BatchGet
The BatchGet method returns information about specified organization subjects based on their IDs. You can use the REST API, gRPC API, or yc iam subject-details get CLI command to call BatchGet.
When calling the BatchGet method, you must specify at least one subject ID you want to get information about.
To get a list of groups that include a Yandex account user, make sure to provide the organization ID when calling BatchGet.
Subject attributes
You can use the List and BatchGet methods to retrieve the values of the following subject attributes:
Note
The subject mask (field-mask) you provide in the List and BatchGet methods should contain field names without the name of the subject main container. e.g., sub, user_account, or service_account.service_agent.microservice_id.
|
Field |
Data type |
Attribute |
|
subject: Main container that includes all subject attributes. |
||
|
|
|
ID of the subject |
|
|
|
Subject type in the access management system:
|
|
|
Subject creation date and time |
|
|
|
|
Subject status (for federated and local users only):
|
|
|
|
Subject name. |
|
|
Last authentication date and time |
|
|
|
|
Subject ID in the external system |
|
subject.groups: Fields with attributes of groups that include a user or service account. 2 |
||
|
|
|
Group type:
|
|
|
|
User group, system group, or public group ID |
|
|
|
User group, system group, or public group name |
|
subject.user_account: Fields with user-specific attributes. |
||
|
|
|
Name |
|
|
|
Last name |
|
|
|
User's login. |
|
|
|
User's email address. |
|
|
|
Phone number. |
|
|
Scheduled user deactivation date and time, if set. Only for federated and local users. |
|
|
|
Date and time of the most recent update to the user attributes |
|
|
|
Date and time of the user’s last verification |
|
|
|
|
Reason for deactivation (for federated and local users only) |
|
subject.user_account.subject_container: Fields with attributes specific to different user types. |
||
|
|
|
Depending on the user type:
|
|
|
|
Depending on the user type:
|
|
|
|
Depending on the user type:
|
|
subject.user_account.job_info: Fields with attributes that describe the user’s company and job title. |
||
|
|
|
Company name |
|
|
|
Department |
|
|
|
Job title |
|
|
|
Employee ID |
|
subject.invitee: Fields with attributes specific to Yandex account users who have been invited to the organization but have not yet accepted the invitation. |
||
|
|
|
User's email address. |
|
|
|
User's login. |
|
subject.service_account: Fields with attributes specific to service accounts. |
||
|
subject.service_account.cloud: Fields with attributes that describe the cloud associated with the service account. |
||
|
|
|
Cloud ID. |
|
|
|
Name of the cloud. |
|
subject.service_account.folder: Fields with attributes that describe the folder associated with the service account. |
||
|
|
|
Folder ID. |
|
|
|
Name of the folder. |
|
subject.service_account.service_agent: Fields with attributes specific to service accounts acting as service agents. |
||
|
|
|
ID of the service on whose behalf the service agent acts. |
|
|
|
ID of the microservice on whose behalf the service agent acts. |
|
subject.group: Fields with attributes specific to user groups, system groups, and public groups. |
||
|
|
|
Group type:
|
|
|
|
User group, system group, or public group ID |
|
|
|
User group, system group, or public group name |
1 Values of enum-type fields provided in the request filter should use numeric format.
2 When using the BatchGet method to get a list of groups that include a Yandex account user, make sure to provide the organization ID in the request.
Subject filter
When getting a list of subjects and their details, you can apply a filter to narrow down the search results and include only the relevant information.
Filters are based on the Common Expression Language (CEL)filter field.
For more on available CEL features, see this official reference
In addition to standard CEL features, Identity and Access Management also supports icontains to perform case-insensitive substring matching. Here is an example:
"ABcdEf".icontains("abc") // true
For more info on using filters when getting subject details, see Getting information about subjects in the Yandex Cloud access management system.
Useful links
An organization is the highest resource in the Yandex Cloud resource model hierarchy that consolidates the resources of all other services. It is also used for user management as well as authentication and authorization management. For more information, see Organization.