Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified Security - Specialty All Questions

View all questions & answers for the AWS Certified Security - Specialty exam

Exam AWS Certified Security - Specialty topic 1 question 96 discussion

Exam question from Amazon's AWS Certified Security - Specialty
Question #: 96
Topic #: 1
[All AWS Certified Security - Specialty Questions]

A Security Administrator at a university is configuring a fleet of Amazon EC2 instances. The EC2 instances are shared among students, and non-root SSH access is allowed. The Administrator is concerned about students attacking other AWS account resources by using the EC2 instance metadata service.
What can the Administrator do to protect against this potential attack?

  • A. Disable the EC2 instance metadata service.
  • B. Log all student SSH interactive session activity.
  • C. Implement iptables-based restrictions on the instances.
  • D. Install the Amazon Inspector agent on the instances.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
INASR
Highly Voted 3 years, 1 month ago
C is correct , disabling the instance metadata means you killed the assume role in the instance profile which is included in the metadata and caused major issues
upvoted 28 times
aiwaai
3 years, 1 month ago
YES you are right. so we need this,,, Disable the Metadata Service # route add -host 169.254.169.254 reject Non-root users would first need to get appropriate authorization before they could enable and read from the service.
upvoted 3 times
...
sanc
3 years ago
we can disable metadata https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/
upvoted 1 times
PatrykMilewski
3 years ago
This question is definitely older than this feature from late 2019, so we should say, that C is correct, but for real life scenario, A is better
upvoted 1 times
...
...
dfranco76
3 years ago
From doc: The following example prevents access to the instance metadata service by all processes, except for processes running in the user account trustworthy-user. $ sudo iptables --append OUTPUT --proto tcp --destination 169.254.169.254 --match owner ! --uid-owner trustworthy-user --jump REJECT https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
upvoted 5 times
dfranco76
3 years ago
Or, you can consider only allowing access to particular users or groups, by using allow rules.
upvoted 1 times
...
...
...
s3an
Highly Voted 3 years, 1 month ago
A is the best answer here. "To turn off access to instance metadata on an existing instance....." https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html You can disable the service for existing (running or stopped) ec2 instances. https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-metadata-options.html
upvoted 12 times
automike
3 years, 1 month ago
This does not mean turning off the metadata service, it means restricting access to the metadata.
upvoted 2 times
...
Bach999
3 years, 1 month ago
‘Protect metadata from misuse’ doesn't mean we should disable metadata service. It means we should support legal use of metadata and try best to reject invalid use.
upvoted 4 times
...
...
shammous
Most Recent 2 weeks ago
Selected Answer: A
C. Implement iptables-based restrictions Could block access to metadata service IP (169.254.169.254) Potentially effective but can be bypassed if students have sufficient privileges Less reliable than disabling IMDS completely ✗ Not the most effective solutionThe correct answer is A: Disable the EC2 instance metadata service. This is the most effective solution because: It completely eliminates the attack vector It's a preventive rather than detective control It's the most reliable way to ensure students can't access instance metadata Other options either don't address the specific threat or provide incomplete protection.
upvoted 1 times
...
Raphaello
9 months ago
Selected Answer: C
"non-root SSH access"..fine, then use iptables to block access to IMDS! No reason to disable IMDS, which will impact instance profiles (if needed).
upvoted 1 times
...
addy_prepare
1 year, 2 months ago
Selected Answer: C
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
upvoted 1 times
...
epomatti
1 year, 2 months ago
Selected Answer: A
A is correct. The question does NOT mention any requirement that IMDS will be used. If it mentioned that other processes in the Linux host would still need to connect to AWS, then the answer would be C, but that is not the case.
upvoted 1 times
...
Nuha_23
1 year, 2 months ago
Selected Answer: A
A is Correct
upvoted 1 times
...
ITGURU51
1 year, 5 months ago
AWS security best practice is to use the iptables firewall to restrict access to the metadata service. C Source: https://d1.awsstatic.com/events/reinvent/2019/Security_best_practices_for_the_Amazon_EC2_instance_metadata_service_SEC310.pdf
upvoted 5 times
...
boooliyooo
1 year, 10 months ago
Selected Answer: C
if we look at another pov, could the question be saying that the admin is making use of EC2 fleets? if so you can't disable IMDS
upvoted 1 times
...
tobedeleted
2 years ago
Selected Answer: C
Answer is C. NOT A. Because "If you turn off all access to instance metadata, applications or agents that rely on instance metadata access to function will break." Refer Note from following AWS Doc: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html
upvoted 2 times
...
[Removed]
2 years ago
Selected Answer: A
it is possible to disable metadata service: https://geekflare.com/disable-aws-ec2-metadata/
upvoted 1 times
tobedeleted
2 years ago
Yes, it is possible. But what would happen to those cross-account roles and services that would assume a role and to get temporary credentials to perform certain activities? Why would you stop IMDS completely?
upvoted 2 times
...
...
madcloud
2 years, 1 month ago
C is correct you can set firewall rules to block access to meta data iptables -l ==> to check the existing rules iptables -- append OUTPUT --proto tcp --destination 169.254.169.254 --match owner ! --uid-owner root --jump REJECT ==> this will only allow root to access meta data
upvoted 2 times
madcloud
2 years, 1 month ago
forgot to mention that firewall rules are built services in ec2 instance
upvoted 1 times
...
...
VijiTu
2 years, 2 months ago
Let’s now disable IMDS as part of instance launch: aws ec2 modify-instance-metadata-options –instance-id <instance-id> –http-endpoint disabled While the first script needs IMDS available at all times, the secure script will work without it. A good practice is to disable the IMDS as part of Instance’s User data. IMDS should be disabled by default. Only those authorized will open the service, by demand. Hence marking Answer as A
upvoted 1 times
...
Root_Access
2 years, 2 months ago
Selected Answer: A
C is correct for Linux boxes but A is easier and applicable to all type of instances. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html
upvoted 1 times
...
dcasabona
2 years, 3 months ago
Selected Answer: A
It seems option A and C works is this situation. The question is, do we need the instance metadata enable? If so, option A is not an option and option C is the answer. In my opinion, the instance metadata is not need in order to avoid access to other AWS resources, so why would we implement iptables if we can just disable metadata service? Option A.
upvoted 1 times
...
ude
2 years, 3 months ago
Selected Answer: A
A is the answer
upvoted 1 times
...
sapien45
2 years, 3 months ago
Selected Answer: C
Limit instance metadata service access You can consider using local firewall rules to disable access from some or all processes to the instance metadata service.
upvoted 4 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 ...