Check who can use an AWS KMS key

Use a test account and key to confirm which AWS roles can perform a particular operation and which roles can change the key policy.

Before you start

  • Use a test AWS account, a customer-managed KMS key whose key spec supports the action, and separate roles for the permitted and denied attempts.
  • Keep an administrator who can restore the key policy. Check the key policy, identity policies and grants before testing the action.

Data and access

Shared or checked
AWS KMS evaluates the caller, the requested key operation, and the policies that apply to that key.
Check separately
Signing, reading a public key and administering a key are different permissions. Check any outstanding grants as well.

Who does what

Key administrator
Checks the test key policy and related grants. Keeps an administrative identity available to restore the original policy.
Authorized test identity
Attempts the key operation the test policy is intended to allow.
Excluded test identity
Attempts the same operation against the same key and should be denied. Check which identity actually called AWS.
  1. Choose your test operation

    Record the test key, test roles and exact operation. For a signing test, check that the key’s usage permits signing and choose a supported algorithm.

    Check. The test key and operation match the record. For signing, the key lists signing as an allowed use and supports the selected algorithm.

  2. Review what authorizes each role

    Check the key policy and the role’s AWS identity policies, plus any grants on the test key. Keep an authorized administrator able to restore the policy.

    Check. For each role, identify the policy or grant you expect to allow the action, or record that you found no applicable grant.

  3. Compare allowed and denied results

    Run the same test action as the intended role and as a role without that permission. Check that a role allowed to use the key cannot edit the policy unless you intentionally granted both permissions.

    Check. Keep the response for both roles on the same key and operation. Check policy-edit access separately from key use.

Check your result

The results establish access for the exact AWS key, roles and action you tested. Confirm separately whether any step calls a KeySigner approval.

How to verify your setup

If you get stuck

An unexpected role can use the key

Review AWS KMS grants as well as the key and identity policies. Compare the principal in CloudTrail with the role you intended to test before changing access to the key.

Report a problem with this guide

Explore all setup guides →