Courseiva

SCS-C02 Identity and Access Management Practice Question

A company hosts a web application on EC2 instances behind an Application Load Balancer. The application accesses an S3 bucket to store user uploads. The security team needs to ensure that the EC2 instances can access the S3 bucket without storing AWS credentials on the instances. What should the security team do?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Create an IAM role with an S3 access policy and attach it to the EC2 instance profile.

An IAM instance profile with an IAM role grants temporary credentials to EC2 instances. Option A is wrong because storing credentials on instances is insecure. Option B is wrong because it's not a best practice. Option D is wrong because security groups do not grant access to S3.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Create an IAM user with programmatic access and use those credentials in the application.

    Why it's wrong here

    Creating an IAM user with programmatic access produces a static access key ID and secret access key. Storing those credentials on an EC2 instance means they are long-lived secrets that require manual rotation and careful safeguarding, and any successful attack on the instance exposes them. This approach also forces separate credential management for each instance and completely bypasses AWS's temporary credential infrastructure, which is why it is not the recommended pattern.

  • ✗

    Configure a security group that allows outbound traffic to the S3 bucket.

    Why it's wrong here

    Security groups control network traffic at the instance level, filtering by IP address and port, but they do not enforce API-level authorization. An S3 bucket is not a security group member; access to S3 is granted through IAM policies, bucket policies, or S3 access points. Even if an outbound security group rule allows HTTPS traffic to S3 endpoints, the application will still receive a 403 if it lacks valid AWS credentials to sign the request, so this option cannot grant S3 access.

  • ✓

    Create an IAM role with an S3 access policy and attach it to the EC2 instance profile.

    Why this is correct

    Attaching an IAM role with the appropriate S3 access policy to the EC2 instance profile enables the instance to obtain temporary credentials from AWS STS via the instance metadata service (IMDSv2). The AWS SDK automatically retrieves and rotates these credentials, meaning the application never stores or manages long-lived keys. This follows the principle of least privilege and is the AWS-recommended pattern for granting EC2 instances access to S3, because it ties permissions to the instance itself rather than to a user or stored key.

  • ✗

    Store AWS access keys in a configuration file on the EC2 instances.

    Why it's wrong here

    Storing AWS access keys in a configuration file on the EC2 instances hard-codes static credentials into the filesystem, making them vulnerable to accidental exposure, insider threats, or compromise via exploits like directory traversal or local file read. Unlike an IAM role, these keys do not auto-rotate and remain valid until manually revoked, requiring a cumbersome rotation process across all instances. This practice also couples the application to a single user identity, complicating audit trails and minimizing the ability to revoke permissions per instance without deactivating shared keys.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 1,205 original SCS-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SCS-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SCS-C02 exam.