A company needs to grant an external compliance audit firm temporary access to audit logs stored in a private Amazon S3 bucket. The audit firm has its own AWS account. The company wants to ensure that the audit firm can access the logs securely without sharing long-term AWS credentials, adhering to the principle of least privilege. Which solution should a solutions architect recommend to meet these requirements?
- ACreate a dedicated IAM user in the company's account for the audit firm. Attach a policy allowing read-only access to the S3 bucket, generate long-term access keys, and share these credentials with the audit firm.
- BGenerate a pre-signed S3 URL using the company's AWS account root user credentials, and provide the URL to the audit firm to download the logs directly.
- Create an IAM role in the company's account with a trust policy that allows the audit firm's AWS account to assume the role. Attach an IAM policy to the role that allows read-only access to the specific S3 bucket. Provide the IAM role ARN to the audit firm.Answer
- DStore the S3 access credentials as a plaintext parameter in AWS Systems Manager Parameter Store, and configure the S3 bucket policy to allow public access filtered by the audit firm's IP address range.
Answer
Create an IAM role in the company's account with a trust policy that allows the audit firm's AWS account to assume the role, attach a read-only policy to the S3 bucket, and provide the role ARN.
The correct solution uses an IAM role with a trust policy allowing cross-account access. By using IAM roles, the audit firm can assume the role to obtain temporary security credentials, avoiding the need to share long-term credentials. Applying a read-only policy to the specific S3 bucket ensures the principle of least privilege is maintained.
Step-by-Step Solution
Key Concept
Cross-Account IAM Roles and Temporary Credentials