exam questions

Exam AWS Certified Cloud Practitioner CLF-C02 All Questions

View all questions & answers for the AWS Certified Cloud Practitioner CLF-C02 exam

Exam AWS Certified Cloud Practitioner CLF-C02 topic 1 question 4 discussion

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

  • A. Hard code an IAM user’s secret key and access key directly in the application, and upload the file.
  • B. Store the IAM user’s secret key and access key in a text file on the EC2 instance, read the keys, then upload the file.
  • C. Have the EC2 instance assume a role to obtain the privileges to upload the file.
  • D. Modify the S3 bucket policy so that any service can upload to it at any time.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
TheFivePips
Highly Voted 1 year, 4 months ago
Selected Answer: C
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.
upvoted 17 times
...
elijahmugariri
Most Recent 3 weeks, 4 days ago
Selected Answer: C
C is correct answer
upvoted 1 times
...
asif_aws
1 month ago
Selected Answer: C
Option C assumed a role for EC2 for security best practices because role will temporary permission to EC2
upvoted 1 times
...
foxewa
1 month ago
Selected Answer: C
• Assuming an IAM role is the recommended and secure method to grant temporary, limited access to AWS resources like S3 for EC2 instances. • When you attach an IAM role to an EC2 instance, AWS automatically provides temporary security credentials to the instance via the metadata service — eliminating the need to hard code or store keys.
upvoted 1 times
...
foxewa
1 month ago
Selected Answer: C
• Assuming an IAM role is the recommended and secure method to grant temporary, limited access to AWS resources like S3 for EC2 instances. • When you attach an IAM role to an EC2 instance, AWS automatically provides temporary security credentials to the instance via the metadata service — eliminating the need to hard code or store keys.
upvoted 1 times
...
Roroyoshi
1 month, 1 week ago
Selected Answer: C
C is correct
upvoted 1 times
...
newbieaws9x
1 month, 3 weeks ago
Selected Answer: C
C is valid
upvoted 1 times
...
Roroyoshi
1 month, 3 weeks ago
Selected Answer: C
C is correct, always follow the least privilege principle
upvoted 1 times
...
klaus___1000
2 months, 3 weeks ago
Selected Answer: C
AWS Services always assumes roles to gain access to other aws services.
upvoted 1 times
...
Qurresh
4 months ago
Selected Answer: C
c option is valid
upvoted 1 times
...
Collinsk
4 months, 2 weeks ago
Selected Answer: C
Have the EC2 instance assume a role to obtain the privileges to upload the file
upvoted 1 times
...
Sir_Kay
4 months, 2 weeks ago
Selected Answer: C
Best security practice as it provides temporary credentials with the necessary permissions without storing static keys.
upvoted 1 times
...
Frankdespi
4 months, 4 weeks ago
Selected Answer: C
C. Have the EC2 instance assume a role to obtain the privileges to upload the file.
upvoted 1 times
...
guilherme_tambelini
5 months, 1 week ago
Selected Answer: C
C. Have the EC2 instance assume a role to obtain the privileges to upload the file.
upvoted 1 times
...
ShaiTay
7 months ago
Selected Answer: C
C. Have the EC2 instance assume a role to obtain the privileges to upload the file.
upvoted 1 times
...
chalaka
8 months, 3 weeks ago
Selected Answer: C
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
upvoted 2 times
...
chalaka
1 year, 1 month ago
Selected Answer: C
C. Have the EC2 instance assume a role to obtain the privileges to upload the file. is correct.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...