AWS Certified Cloud Practitioner CLF-C02 Exam QuestionsBrowse all questions from this exam

AWS Certified Cloud Practitioner CLF-C02 Exam - Question 4


According to security best practices, how should an Amazon EC2 instance be given access to an Amazon S3 bucket?

Show Answer
Correct Answer: C

According to security best practices, the most secure way to give an Amazon EC2 instance access to an Amazon S3 bucket is by having the EC2 instance assume a role to obtain the necessary privileges. This method employs AWS Identity and Access Management (IAM) roles to grant temporary permissions to the instance. This approach is preferred because it eliminates the need to hard code or store access keys directly on the instance or in application code, thereby reducing the risk of credential exposure and adhering to the principle of least privilege. By assuming a role, the EC2 instance is granted only the permissions it needs for a limited duration, enhancing overall security.

Discussion

24 comments
Sign in to comment
TheFivePipsOption: C
Jan 24, 2024

The recommended security best practice for giving an Amazon EC2 instance access to an Amazon S3 bucket is option C: Have the EC2 instance assume a role to obtain the privileges to upload the file. This involves using AWS Identity and Access Management (IAM) roles to grant temporary permissions to the EC2 instance, rather than hard-coding or storing access keys directly in the application or on the instance. This approach enhances security by minimizing the exposure of long-term credentials and following the principle of least privilege. The EC2 instance assumes a role with specific permissions to interact with the S3 bucket, and AWS automatically rotates temporary credentials for the instance. Options A and B involve storing IAM user's secret keys on the EC2 instance, which is not recommended due to security risks. Option D, modifying the S3 bucket policy to allow any service to upload to it at any time, is also not recommended as it may lead to security vulnerabilities and compromises the principle of least privilege.

ShivaNagarajanOption: D
Oct 12, 2023

https://repost.aws/knowledge-center/ec2-instance-access-s3-bucket#

Anyio
Oct 15, 2023

You mean C dude!

Itzmelakshmikanth3108
Mar 23, 2024

C. Have the EC2 instance assume a role to obtain the privileges to upload the file. Using IAM roles to grant permissions to EC2 instances is a more secure and manageable method compared to hard coding or storing access keys directly on the instance. By assigning an IAM role to the EC2 instance, you can define the necessary permissions for accessing the S3 bucket without exposing any sensitive credentials. This follows the principle of least privilege, ensuring that the EC2 instance only has the permissions it needs to perform its intended tasks, enhancing overall security posture.

Rotimija
Oct 12, 2023

C is correct

AnyioOption: C
Oct 15, 2023

You definitely need a role to access the S3 bucket as best practice! https://repost.aws/knowledge-center/ec2-instance-access-s3-bucket#

VasishtOption: C
Dec 27, 2023

Option C is correct

Ruffyit
Jan 30, 2024

The recommended security best practice for giving an Amazon EC2 instance access to an Amazon S3 bucket is option C: Have the EC2 instance assume a role to obtain the privileges to upload the file. This involves using AWS Identity and Access Management (IAM) roles to grant temporary permissions to the EC2 instance, rather than hard-coding or storing access keys directly in the application or on the instance.

chalakaOption: C
Sep 22, 2024

C. Have the EC2 instance assume a role to obtain the privileges to upload the file. Using IAM roles and granting EC2 instances permissions to assume these roles is the best practice for managing access to AWS resources securely. By assigning an IAM role to the EC2 instance and configuring the necessary permissions in the role's policy, you can ensure that the EC2 instance has the appropriate permissions to access the S3 bucket without the need to hard code or store sensitive credentials on the instance. This approach follows the principle of least privilege and enhances security by reducing the risk of exposure of access keys or secrets

parrtner73Option: C
Oct 15, 2023

C is the correct one

ASDFDSAFDFAOption: C
Oct 27, 2023

C obviously

lunamullerOption: C
Oct 30, 2023

Answer is C.

Nepton
Nov 23, 2023

Have the EC2 instance assume a role to obtain the privileges to upload the file.

ohoongOption: C
Dec 16, 2023

yes C is correct

chalakaOption: C
Apr 24, 2024

C. Have the EC2 instance assume a role to obtain the privileges to upload the file. is correct.

ShaiTayOption: C
Nov 14, 2024

C. Have the EC2 instance assume a role to obtain the privileges to upload the file.

guilherme_tambeliniOption: C
Jan 7, 2025

C. Have the EC2 instance assume a role to obtain the privileges to upload the file.

FrankdespiOption: C
Jan 19, 2025

C. Have the EC2 instance assume a role to obtain the privileges to upload the file.

Sir_KayOption: C
Jan 29, 2025

Best security practice as it provides temporary credentials with the necessary permissions without storing static keys.

CollinskOption: C
Jan 30, 2025

Have the EC2 instance assume a role to obtain the privileges to upload the file

QurreshOption: C
Feb 10, 2025

c option is valid

klaus___1000Option: C
Mar 20, 2025

AWS Services always assumes roles to gain access to other aws services.

RoroyoshiOption: C
Apr 19, 2025

C is correct, always follow the least privilege principle

newbieaws9xOption: C
Apr 21, 2025

C is valid

RoroyoshiOption: C
May 4, 2025

C is correct