Soru

Zorluk: KolayAWS Key Management Service (KMS) and Data Encryption

A SysOps Administrator is attempting to grant an IAM user permission to decrypt data using an AWS Key Management Service (KMS) customer managed key. The administrator attaches an IAM policy to the user that allows the `kms:Decrypt` action on the key's ARN. However, the user still receives an 'Access Denied' error when trying to perform decryption.

What is the most likely cause of this issue?

  1. The key policy of the KMS key does not contain a statement that delegates authorization control to IAM policies.Cevap
  2. B
    The IAM user has not been granted the `iam:PassRole` permission, which is required to pass the key's execution role to the KMS service.
  3. C
    The VPC route table has not been associated with a Gateway VPC Endpoint for KMS to route the decryption API call privately.
  4. D
    The S3 bucket containing the encrypted objects does not have bucket versioning enabled, which is required to process KMS decryption requests.

Cevap

The key policy of the KMS key does not contain a statement that delegates authorization control to IAM policies.
For an IAM policy to successfully grant access to a KMS customer managed key, the KMS key policy itself must contain a statement that enables IAM policies to do so. In KMS, the key policy is the primary resource-based policy and acts as the gatekeeper. By default, when a customer managed key is created, AWS adds a policy statement that allows the account's root user (and thereby IAM policies in the account) to define permissions. If this statement is missing or removed, IAM policies attempting to grant KMS access will be ignored, resulting in an 'Access Denied' error.

Adım Adım Çözüm

1
Identify the primary resource-based policy that controls access to a KMS customer managed key.
Determine that the KMS key policy is the ultimate authority for key access.
KMS security relies on key policies as the primary gatekeeper.
2
Analyze how IAM policies interact with KMS key policies.
Recognize that for an IAM policy to take effect, the key policy must explicitly delegate control to the account (typically via root principal permissions).
If the key policy does not delegate control, IAM policies attempting to grant access to the key will be ignored, resulting in Access Denied.

Anahtar Kavram

AWS KMS Key Policy Delegation to IAM
Bu soruyu puanla