Courseiva
Network Security, Compliance and GovernancemediumMultiple ChoiceObjective-mapped

ANS-C01 Network Security, Compliance and Governance Practice Question

A company has deployed a web application on an EC2 instance that needs to access an S3 bucket and a DynamoDB table. The instance is in a private subnet. Which approach meets the security best practice of avoiding long-lived credentials on the instance?

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 policies granting access to S3 and DynamoDB, and attach the role to the EC2 instance profile.

The best practice is to attach an IAM role with the necessary permissions to the EC2 instance. The instance automatically obtains temporary credentials via the instance metadata service, avoiding long-lived credentials. Option D is correct. Option A (IAM user access keys) is not recommended as they are long-lived. Option B (security group rules) controls network traffic but does not grant access to S3 or DynamoDB. Option C (AWS Systems Manager Parameter Store) still requires credentials to access the parameters, which would not eliminate long-lived credentials.

Answer analysis

Option-by-option breakdown

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

  • Store IAM user access keys in the application configuration file.

    Why it's wrong here

    IAM user credentials are long-lived and should not be stored on EC2 instances.

  • Configure security group rules to allow outbound traffic to S3 and DynamoDB endpoints.

    Why it's wrong here

    Security groups control network traffic but do not grant access to S3 or DynamoDB API operations.

  • Use AWS Systems Manager Parameter Store to store credentials and retrieve them at runtime using the instance's IAM role.

    Why it's wrong here

    This still requires the instance to have an IAM role to access Parameter Store, but then the credentials from Parameter Store are still long-lived.

  • Create an IAM role with policies granting access to S3 and DynamoDB, and attach the role to the EC2 instance profile.

    Why this is correct

    The instance can obtain temporary credentials from the instance metadata service, eliminating the need for long-lived credentials.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

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

This ANS-C01 question is part of Courseiva's 1,621-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 ANS-C01 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 ANS-C01 exam.