Access management in Key Management Service
In this section, you will learn:
- Which resources you can assign roles to.
- 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 permission for a resource, assign roles for this resource to the subject that will perform operations. Roles can be assigned to a Yandex account, a service account, federated users, a user group, or a system group. For more information, see How access management works in Yandex Cloud.
Only users with the admin
or resource-manager.clouds.owner
role for a resource can assign roles for this resource.
Which resources you can assign roles to
Roles can be assigned for a cloud, folder, or key. These roles also apply to nested resources. For example, the editor role includes all viewer role permissions. You can find the description of each role under the chart.
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 can't assign roles via the management console.
List of service roles:
kms.admin
: Enables you to assign random roles for keys using the CLI and API, delete keys and key versions, and update the primary version. It includes all permissions granted by thekms.editor
role.kms.editor
: Enables you to manage keys (view, create, update, rotate keys, and encrypt and decrypt data). It includes all permissions granted by thekms.viewer
,kms.keys.encrypterDecrypter
,kms.asymmetricEncryptionKeys.publicKeyViewer
, andkms.asymmetricEncryptionKeys.decrypter
roles.kms.asymmetricEncryptionKeys.publicKeyViewer
: Enables you to obtain a public key from an asymmetric encryption key pair.kms.asymmetricSignatureKeys.publicKeyViewer
: Enables you to obtain a public key from an asymmetric key pair of a digital signature.kms.asymmetricSignatureKeys.signer
: Enables you to sign data with a private key from an asymmetric key pair of a digital signature.kms.asymmetricEncryptionKeys.decrypter
: Enables you to decrypt data with a private key from an asymmetric encryption key pair.kms.keys.encrypterDecrypter
: Enables you to encrypt and decrypt data in symmetric mode and view information about keys. It includes all permissions granted by thekms.keys.encrypter
andkms.keys.decrypter
roles.kms.keys.encrypter
: Enables you to encrypt data and view information about keys.kms.keys.decrypter
: Enables you to decrypt data and view information about keys.kms.viewer
: Enables you to view information about signature and encryption keys. It includes all permissions granted by thekms.auditor
role. It does not allow you to obtain a public key.kms.auditor
: Enables you to view a list of signature and encryption keys and get information about signature and encryption permissions. It does not allow you to obtain a public key.
Primitive roles
auditor
Grants permission to view service configuration and metadata without access to data.
viewer
Enables you to view information about resources.
editor
Allows you to manage resources, e.g., create, edit, and delete them.
admin
Allows you to manage your resources and access to them.
For more information about primitive roles, see Roles.
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 the roles (through the CLI or API) 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 a key |
Granting a role, revoking a role | setAccessBindings , updateAccessBindings |
kms.admin for key |
Viewing roles granted for a key | listAccessBindings |
kms.auditor for key |