A security engineer must provide temporary read-only access to an S3 bucket for an external auditor without creating IAM users. Which method adheres to the principle of least privilege?
Trap 1: Create an IAM user with read-only permissions and provide the…
Providing long-term access keys is a major security risk. IAM users require permanent credentials that must be managed, rotated, and protected. If the auditor's workstation is compromised, these static credentials could be exploited to access sensitive data until manually revoked, violating the principle of least privilege.
Trap 2: Attach a bucket policy that grants access to the auditor's specific…
Relying solely on IP-based restrictions in a bucket policy is insufficient for secure access management. IP addresses can be spoofed or shared, and this method does not provide a formal identity context. It fails to leverage IAM's robust session-based security features, making it harder to track specific auditor activities.
Trap 3: Generate a pre-signed URL for every object in the bucket and share…
Generating pre-signed URLs for an entire bucket is operationally inefficient and difficult to manage. Managing expiration times and access lists for thousands of individual objects is prone to human error and does not provide an identity-based audit trail, making it unsuitable for comprehensive auditing requirements.
- A
Create an IAM user with read-only permissions and provide the auditor with the access keys.
Why wrong: Providing long-term access keys is a major security risk. IAM users require permanent credentials that must be managed, rotated, and protected. If the auditor's workstation is compromised, these static credentials could be exploited to access sensitive data until manually revoked, violating the principle of least privilege.
- B
Attach a bucket policy that grants access to the auditor's specific IP address range.
Why wrong: Relying solely on IP-based restrictions in a bucket policy is insufficient for secure access management. IP addresses can be spoofed or shared, and this method does not provide a formal identity context. It fails to leverage IAM's robust session-based security features, making it harder to track specific auditor activities.
- C
Configure a cross-account IAM role with an external ID and read-only permissions.
Cross-account roles with an External ID provide a secure, scalable way to grant access. The External ID prevents the confused deputy problem, ensuring that the trust relationship is validated during the assume-role request. This temporary access mechanism is the safest way to authorize external parties without managing permanent user accounts.
- D
Generate a pre-signed URL for every object in the bucket and share them with the auditor.
Why wrong: Generating pre-signed URLs for an entire bucket is operationally inefficient and difficult to manage. Managing expiration times and access lists for thousands of individual objects is prone to human error and does not provide an identity-based audit trail, making it unsuitable for comprehensive auditing requirements.