Soru

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

A SysOps Administrator is configuring permissions for an IAM user in the same AWS account to encrypt and decrypt data using a customer managed key in AWS Key Management Service (AWS KMS). Currently, the IAM user has an IAM policy attached that allows all KMS actions on the key, but they are still receiving an Access Denied error when attempting to use the key.

Which of the following actions must be taken to successfully enable access for the user? (Select TWO.)

  1. Modify the customer managed key's policy to grant permission to the AWS account's root principal, enabling IAM policies to manage key access.Cevap
  2. Assign an IAM policy directly to the IAM user containing explicit permissions for the encrypt and decrypt actions targeting the key's ARN.Cevap
  3. C
    Modify the IAM user policy to include iam:PassRole permissions for the KMS key's ARN, allowing the user to assume the key's permissions.
  4. D
    Rely solely on the IAM policy, because user-level IAM policies automatically override KMS key policies for resources in the same account.
  5. E
    Associate the KMS key with a Gateway VPC Endpoint policy to allow the key's traffic to bypass standard key policy checks.

Cevap

Modify the customer managed key's policy to grant permission to the AWS account's root principal, and assign an IAM policy directly to the IAM user containing explicit permissions for the encrypt and decrypt actions targeting the key's ARN.
For an IAM user in the same account to use a customer managed KMS key, two conditions must be met: the KMS key policy must delegate access control to the account (typically by granting the account root principal administrative or usage permissions), and the user must be granted the necessary permissions (such as encrypt and decrypt) in an IAM policy. These two policies work together to allow access.

Adım Adım Çözüm

1
Examine the KMS key policy.
Confirm whether the key policy delegates control to the AWS account (root principal) to allow IAM policies to manage access.
By default, KMS keys require the key policy to explicitly delegate permission to the account before IAM policies can be used to grant access.
2
Ensure the IAM policy is properly configured and attached to the user.
The user has an IAM policy attached containing allow statements for encrypt and decrypt against the key's ARN.
Once delegation is enabled on the key policy, the IAM policy is evaluated to determine if the specific user has been granted access.

Anahtar Kavram

AWS KMS Key Policy Precedence and IAM Policy Integration
Bu soruyu puanla