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 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
, resource-manager.clouds.owner
, or organization-manager.organizations.owner
role for a resource can assign roles for this resource.
Which resources you can assign a role for
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 cannot assign roles via the management console.
kms.keys.encrypter
The kms.keys.encrypter
role enables you to encrypt data and view information about keys.
kms.keys.decrypter
The kms.keys.decrypter
role enables you to decrypt data and view information about keys.
kms.keys.encrypterDecrypter
The kms.keys.encrypterDecrypter
role enables you to encrypt and decrypt data and view information about keys. Includes all access rights of the kms.keys.encrypter
and kms.keys.decrypter
roles.
kms.asymmetricEncryptionKeys.publicKeyViewer
The kms.asymmetricEncryptionKeys.publicKeyViewer
role enables you to obtain a public key from an asymmetric encryption key pair.
kms.asymmetricSignatureKeys.publicKeyViewer
The kms.asymmetricSignatureKeys.publicKeyViewer
role enables you to obtain a public key from an asymmetric key pair of a digital signature.
kms.asymmetricSignatureKeys.signer
The kms.asymmetricSignatureKeys.signer
role enables you to sign data with a private key from an asymmetric key pair of a digital signature.
kms.asymmetricEncryptionKeys.decrypter
The kms.asymmetricEncryptionKeys.decrypter
role enables you to decrypt data with a private key from an asymmetric encryption key pair.
kms.auditor
The kms.auditor
role 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.
kms.viewer
The kms.viewer
role enables you to read information about keys.
kms.editor
The kms.editor
role enables you to manage keys (view, create, update, rotate keys, and encrypt and decrypt data). Includes all access rights of the kms.viewer
and kms.keys.encrypterDecrypter
roles.
kms.admin
The kms.admin
role enables you to assign random roles for keys using the CLI and API, delete keys and key versions, and update the primary version. Includes all access rights of the kms.editor
role.
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 (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 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 |