An application container deployed on Amazon ECS tasks is designed to read encrypted objects from an Amazon S3 bucket. The objects are encrypted using an AWS KMS customer managed key. During execution, the application receives an 'Access Denied' error when trying to retrieve and decrypt the files. Which two configurations should the developer verify or modify to resolve this authorization failure? (Select TWO.)
- Add s3:GetObject and kms:Decrypt permissions to the IAM policy attached to the ECS Task Role.Cevap
- Update the AWS KMS key policy to permit the ECS Task Role to perform the kms:Decrypt action.Cevap
- CAdd s3:GetObject and kms:Decrypt permissions to the IAM policy attached to the ECS Task Execution Role.
- DGrant the ECS Task Execution Role permissions to read the objects in the S3 bucket policy.
- EModify the trust policy of the ECS Task Role to allow the AWS Key Management Service (KMS) principal to assume the role.
Cevap
Attach an IAM policy to the ECS Task Role granting s3:GetObject and kms:Decrypt permissions, and ensure the KMS key policy allows the ECS Task Role to execute the kms:Decrypt action.
The correct configuration requires identifying that the application running inside the container uses the ECS Task Role for accessing AWS services. Since the objects in the S3 bucket are encrypted with a customer managed KMS key, the Task Role needs permissions for both reading from S3 and decrypting with the KMS key. Additionally, the key policy of the customer managed key must be updated to allow the Task Role to perform the decryption operation, as KMS key policies must explicitly allow access to IAM roles.
Adım Adım Çözüm
Anahtar Kavram
Resolving authorization issues when accessing KMS-encrypted S3 resources from ECS tasks requires distinguishing between ECS Task Roles and Task Execution Roles, and ensuring both IAM identity policies and KMS key policies permit the action.