A developer is implementing secure client-side uploads for a mobile application. The application must allow authenticated users to upload files to their own prefix in an Amazon S3 bucket named using temporary credentials provided by Amazon Cognito Identity Pools. The target prefix is , where represents the user's Cognito Identity ID.
Which of the following configurations must the developer implement to meet these requirements? (Select TWO.)
- In the IAM permissions policy attached to the authenticated role, define the S3 resource path as and allow the action.Cevap
- Configure the trust policy of the authenticated IAM role to allow the service principal to call the action.Cevap
- CHardcode the AWS credentials of an IAM User with full S3 write permissions inside the mobile application code to initialize the S3 client wrapper.
- DAdd a trust relationship directly to the Amazon S3 bucket policy allowing the service principal to assume the bucket's permissions.
- EConfigure the trust policy of the authenticated IAM role to allow the service principal to call the action.
Cevap
Configure the trust policy of the authenticated IAM role to allow the federated principal to call the action. Additionally, in the IAM permissions policy attached to this role, allow the action on the resource path .
To allow client-side users authenticated with Cognito Identity Pools to access AWS resources, the authenticated IAM role must establish a trust relationship with the identity pool provider principal and allow the API action. To secure user uploads to S3, the attached permissions policy must grant access to the user-specific prefix, utilizing the dynamic policy variable to enforce user isolation.
Adım Adım Çözüm
Anahtar Kavram
Configuring IAM Trust Policies and Identity Pool Variables for Dynamic Resource Isolation