Instances hosting Nitro Enclave workloads (EnclaveOptions.Enabled=true) are evaluated for IMDSv2 enforcement on the metadata service (HttpTokens=required). This check assesses the host environment; it does not audit the enclave itself.
Risk
IMDSv1 exposes temporary IAM credentials to SSRF and workload-compromise paths on the host, undermining the confidentiality of the identity the enclave workload depends on.
prowler aws --checks ec2_confidential_workload_host_imdsv2_not_enforced
Recommendation
Apply defense in depth on identity surfaces: require IMDSv2 on every confidential-workload host so credentials cannot be lifted from the metadata service via SSRF or a compromised workload on the host.
Remediation
aws ec2 modify-instance-metadata-options --instance-id <instance-id> --http-tokens required --http-endpoint enabled
- Open the EC2 console.
- Select the confidential-workload host and choose Actions > Instance settings > Modify instance metadata options.
- Set IMDS to Enabled and IMDSv2 to Required.
- Save.
Source Code
Resource Type
AwsEc2Instance