Why set IMDSv2 hop limit to 1 on nodes?
IntermediateProductionSecurity Hardening & Compliance
Answer
Pods can reach the EC2 metadata service and steal the node's IAM role credentials, which often have broad rights. Requiring IMDSv2 and setting HttpPutResponseHopLimit to 1 stops containers in non-host-network Pods from fetching tokens (the extra network hop), forcing them to use IRSA/Pod Identity instead.
aws ec2 modify-instance-metadata-options --instance-id i-0abc --http-tokens required --http-put-response-hop-limit 1
More on Security Hardening & Compliance
What is the baseline security checklist for a production cluster?BeginnerWhy should containers run as non-root?BeginnerHow should human access to the cluster be managed?BeginnerWhat is the purpose of image scanning in CI and in the cluster?BeginnerWhy not store secrets in Git or in ConfigMaps?BeginnerWhat is a default-deny NetworkPolicy baseline?Beginner