Question

Difficulty: EasyIdentity and Access Management (IAM)

A developer needs to configure a script running on their local workstation to upload log files to an Amazon S3 bucket. Which of the following is the AWS-recommended method to securely authenticate this script?

  1. A
    Generate and use the AWS account root user access keys to ensure the script has uninterrupted access.
  2. Create an IAM user for the developer, generate programmatic access keys, and assign only the necessary permissions to write to the S3 bucket.Answer
  3. C
    Create an IAM role with console access credentials and hardcode those credentials directly within the script.
  4. D
    Contact AWS Support to configure the local workstation's IP address to bypass AWS authentication requirements.

Answer

Create an IAM user for the developer, generate programmatic access keys, and assign only the necessary permissions to write to the S3 bucket.
The correct answer is to create an IAM user for the developer, generate programmatic access keys, and assign only the necessary permissions to write to the S3 bucket. This ensures the script uses programmatic credentials with the minimum required privileges, securing the account.

Step-by-Step Solution

1
Identify the authentication requirement
A local script running outside of AWS requires programmatic credentials to interact with AWS APIs.
Before the script can interact with Amazon S3, it must authenticate with AWS to verify its identity and permissions.
2
Apply the principle of least privilege and root user best practices
Avoid using the AWS account root user, and instead create a dedicated IAM user with only the specific S3 write permissions required.
This limits the potential damage if the credentials are compromised, which aligns with AWS security best practices.

Key Concept

AWS IAM Programmatic Access and Least Privilege
Rate this question