Access management in Key Management Service
In this section, you will learn:
- Which resources you can assign a role for.
- Which roles exist in the service.
- Which roles are required for particular actions.
About access management
In Yandex Cloud, all transactions are checked in Yandex Identity and Access Management. If a subject does not have the required permission, the service returns an error.
To grant permissions for a resource, assign roles for this resource to the subject that will perform the operations. You can assign roles to a Yandex account, service account, federated users, user group, system group, or public group. For more information, see How access management works in Yandex Cloud.
Roles for a resource can be assigned by users who have the kms.admin
role or one of the following roles for that resource:
admin
resource-manager.admin
organization-manager.admin
resource-manager.clouds.owner
organization-manager.organizations.owner
Which resources you can assign a role for
You can assign a role to an organization, cloud, or folder. The roles assigned for organizations, clouds, or folders also apply to nested resources.
In the management console, you can assign a role through the YC CLI or the Yandex Cloud API for individual resources of the service:
Which roles exist in the service
You can manage access to KMS keys using both service and primitive roles.
The chart below shows which roles are available in the service and how they inherit each other's permissions. For example, the editor
role includes all the permissions of viewer
. You can find the description of each role under the chart.
Service roles
Service roles provide more granular control over KMS keys, taking into account the service specifics: a strict division of subjects into key administrators (the kms.admin
role) and users (the kms.keys.encrypterDecrypter
role).
Users without the resource-manager.clouds.owner
or admin
role cannot assign roles via the management console.
kms.keys.user
The kms.keys.user
role enables using symmetric encryption keys.
kms.keys.encrypter
The kms.keys.encrypter
role enables viewing info on symmetric encryption keys and using such keys to encrypt data.
kms.keys.decrypter
The kms.keys.decrypter
role enables viewing info on symmetric encryption keys and using such keys to decrypt data.
kms.keys.encrypterDecrypter
The kms.keys.encrypterDecrypter
role enables viewing info on symmetric encryption keys and using such keys to encrypt or decrypt data.
This role also includes the kms.keys.encrypter
and kms.keys.decrypter
permissions.
kms.asymmetricEncryptionKeys.publicKeyViewer
The kms.asymmetricEncryptionKeys.publicKeyViewer
role enables viewing info on asymmetric encryption key pairs, as well as getting a public key from an encryption key pair.
kms.asymmetricSignatureKeys.publicKeyViewer
The kms.asymmetricSignatureKeys.publicKeyViewer
role enables viewing info on digital signature key pairs, as well as getting a public key from a digital signature key pair.
kms.asymmetricSignatureKeys.signer
The kms.asymmetricSignatureKeys.signer
role enables signing data with a private key from a digital signature key pair.
kms.asymmetricEncryptionKeys.decrypter
The kms.asymmetricEncryptionKeys.decrypter
role enables decrypting data with a private key from an asymmetric encryption key pair.
kms.auditor
The kms.auditor
role enables viewing info on encryption keys and key pairs and access permissions assigned to them.
Users with this role can:
- View the list of symmetric encryption keys, info on them and on access permissions assigned to them.
- View info on asymmetric encryption key pairs and access permissions assigned to them.
- View information on digital signature key pairs and on access permissions assigned to them.
- View details on the Key Management Service quotas.
kms.viewer
The kms.viewer
role enables viewing info on encryption and digital signature keys and key pairs, access permissions assigned to them, and KMS quotas.
Users with this role can:
- View the list of symmetric encryption keys, info on them and on access permissions assigned to them.
- View info on asymmetric encryption key pairs and access permissions assigned to them.
- View information on digital signature key pairs and on access permissions assigned to them.
- View details on the Key Management Service quotas.
This role also includes the kms.auditor
permissions.
kms.editor
The kms.editor
role allows you to create encryption and digital signature keys and key pairs as well as use them to encrypt, decrypt, and sign data.
Users with this role can:
- View the list of symmetric encryption keys, info on them and their access permissions, as well as create, rotate, and modify symmetric key metadata, including rotation periods.
- Encrypt and decrypt data using symmetric encryption keys.
- View info on asymmetric encryption key pairs and access permissions assigned to them as well as create such key pairs or modify their metadata.
- Get a public key and decrypt data using a private key from an asymmetric encryption key pair.
- View info on digital signature key pairs and access permissions assigned to them as well as create such key pairs or modify their metadata.
- Get a public key and sign data using a private key from a digital signature key pair.
- View details on the Key Management Service quotas.
kms.admin
The kms.admin
role enables managing encryption and digital signature keys and key pairs, as well as managing access to such keys or key pairs and using them to encrypt, decrypt, and sign data.
Users with this role can:
- View info on access permissions assigned to symmetric encryption keys and modify such permissions.
- View the list of symmetric encryption keys and details on them, as well as create, activate, deactivate, rotate, and delete symmetric encryption keys, or change their default version and metadata (including rotation period).
- Encrypt and decrypt data using symmetric encryption keys.
- View info on access permissions assigned to asymmetric encryption key pairs and modify such permissions.
- View details on asymmetric encryption key pairs as well as create, activate, deactivate, and delete such key pairs, or modify their metadata.
- Get a public key and decrypt data using a private key from an asymmetric encryption key pair.
- View info on access permissions assigned to digital signature key pairs and modify such permissions.
- View details on digital signature key pairs as well as create, activate, deactivate, and delete such key pairs, or modify their metadata.
- Get a public key and sign data using a private key from a digital signature key pair.
- View details on Key Management Service quotas.
- View info on the relevant folder.
This role also includes the kms.editor
permissions.
Primitive roles
Primitive roles allow users to perform actions in all Yandex Cloud services.
auditor
The auditor
role grants a permission to read configuration and metadata of any Yandex Cloud resources without any access to data.
For instance, users with this role can:
- View info on a resource.
- View the resource metadata.
- View the list of operations with a resource.
auditor
is the most secure role that does not grant any access to the service data. This role suits the users who need minimum access to the Yandex Cloud resources.
viewer
The viewer
role grants the permissions to read the info on any Yandex Cloud resources.
This role also includes the auditor
permissions.
Unlike auditor
, the viewer
role provides access to service data in read mode.
editor
The editor
role provides permissions to manage any Yandex Cloud resources, except for assigning roles to other users, transferring organization ownership, removing an organization, and deleting Key Management Service encryption keys.
For instance, users with this role can create, modify, and delete resources.
This role also includes the viewer
permissions.
admin
The admin
role enables assigning any roles, except for resource-manager.clouds.owner
and organization-manager.organizations.owner
, and provides permissions to manage any Yandex Cloud resources (except for transferring organization ownership and removing an organization).
Prior to assigning the admin
role for an organization, cloud, or billing account, make sure to check out the information on protecting privileged accounts.
This role also includes the editor
permissions.
Instead of primitive roles, we recommend using service roles. This ensures more selective access control and implementation of the principle of least privilege.
For more information about primitive roles, see the Yandex Cloud role reference.
What roles do I need
Example of key access control
We recommend working with roles as follows:
- The cloud owner (the
resource-manager.clouds.owner
role) or administrator (theadmin
role) assigns thekms.admin
role to the KMS administrator. - The KMS administrator creates the required number of keys and assigns (through the CLI or API) the roles to use them: subjects from different teams are given the
kms.keys.encrypter
,kms.keys.decrypter
,kms.asymmetricEncryptionKeys.publicKeyViewer
,kms.asymmetricEncryptionKeys.decrypter
, andkms.editor
roles for keys and folders.
It is good practice to store KMS keys in a dedicated folder apart from other Yandex Cloud resources.
Action | Methods | Required roles |
---|---|---|
KMS | ||
Getting information about keys and versions | get , listVersions |
kms.viewer for key for folder |
Symmetric encryption and decryption operations | encrypt , decrypt , reEncrypt , generateDataKey |
kms.keys.encrypterDecrypter for key (encryption and decryption), kms.keys.encrypter for key (encryption only), and kms.keys.decrypter for key (decryption only) |
Obtaining a list of keys in a folder | list |
kms.auditor for folder |
Obtaining a public key of an asymmetric encryption key pair | kms.asymmetricEncryptionKeys.publicKeyViewer for key |
|
Decrypting data with a private key of an asymmetric encryption key pair | kms.asymmetricEncryptionKeys.decrypter for key |
|
Creating and updating a key | create , update |
kms.editor for folder |
Rotating a key | rotate |
kms.editor for key |
Changing the primary version | setPrimaryVersion |
kms.admin for key |
Destroying keys and versions | delete , scheduleVersionDestruction , cancelVersionDestruction |
kms.admin for key |
Granting a role, revoking a role | setAccessBindings , updateAccessBindings |
kms.admin for key |
Viewing roles granted for a key | listAccessBindings |
kms.auditor for key |