Security Hub Question

0

How do i solve the security vulnerability with the error "EC2 instances should use instance Metadata Service Version 2 (IMDSv2)

已提问 7 个月前212 查看次数
1 回答
2
已接受的回答

Before setting the IMDSv2 for the EC2 instance, check CloudWatch metric MetadataNoToken. This metric shows th.e number of IMDSv1 calls to the IMDS on your instances. If the metric MetadataNoToken records zero IMDSv1 usage, you can follow these options for updating existing EC2 instances:

  1. From the Amazon EC2 console: select the EC2 instance, choose Actions --> Instance settings --> Modify instance metadata options --> for IMDSv2, select Required.
  2. For EC2 instances created from Launch Templates, modify the MetadataOptions parameter in the Launch Template to require use of IMDSv2
  3. From AWS CLI: Use the modify-instance-metadata-options CLI command to specify that only IMDSv2 is to be used.

If the metric MetadataNoToken shows IMDSv1 usage, update the SDKs, CLIs, and your software that use Role credentials on their EC2 instances to versions compatible with IMDSv2.

Reference: Transition to using Instance Metadata Service Version 2

profile pictureAWS
已回答 7 个月前
profile picture
专家
已审核 3 天前
profile picture
专家
已审核 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则