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
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 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
Users without the
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 the
kms.editor: Enables you to manage keys (view, create, update, rotate keys, and encrypt and decrypt data). It includes all permissions granted by the
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 the
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 the
kms.auditorrole. 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.
Grants permission to view service configuration and metadata without access to data.
Enables you to view information about resources.
Allows you to manage resources, e.g., create, edit, and delete them.
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.ownerrole) or administrator (the
adminrole) assigns the
kms.adminrole 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.editorroles for keys and folders.
It is good practice to store KMS keys in a dedicated folder apart from other Yandex Cloud resources.
|Getting information about keys and versions||
|Symmetric encryption and decryption operations||
|Obtaining a list of keys in a folder||
|Obtaining a public key of an asymmetric encryption key pair||
|Decrypting data with a private key of an asymmetric encryption key pair||
|Creating and updating a key||
|Rotating a key||
|Changing the primary version||
|Destroying keys and versions||
|Granting a role, revoking a role||
|Viewing roles granted for a key||