-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Set http_put_response_hop_limit = 1
by default
#3333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the reference. I have not been using AWS Load Balancer Controller (LBC) in my EKS clusters so I was not aware of this limitation. From what I understand, AWS LBC is using the IMDS to retrieve the AWS region and the VPC ID (in For some years, the LBC has been updated to be able to rely on other sources of information instead of the IMDS:
So it seems that when the LBC is configured with ISRA, the IMDS can be set with I also saw an issue raised 3 years ago about the documentation recommending the insecure IMDS configuration: kubernetes-sigs/aws-load-balancer-controller#2665 . Someone provided some context in kubernetes-sigs/aws-load-balancer-controller#2665 (comment) (in 2022):
This issue was closed due to inactivity, so there is unfortunately no comment related to the more recent Pull Requests which removed the dependency on the IMDS. While exploring AWS LBC's issue tracker, I stumbled upon kubernetes-sigs/aws-load-balancer-controller#3955 (comment)
Did you follow when AWS changed this default configuration for EKS Node groups? |
we can consider switching this default at the next breaking change, but we can't impose this on users at this time |
I understand. I am fine with this approach. Thanks! |
Is your request related to a new offering from AWS?
Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.
Is your request related to a problem? Please describe.
AWS EKS Best Practices Guide recommends setting
http_put_response_hop_limit = 1
(in section "Identities and Credentials for EKS pods Recommendations", subsection "Restrict access to the instance profile assigned to the worker node"):The EKS Terraform module would be easier to use in a secure way if
http_put_response_hop_limit
was set to1
by default.Describe the solution you'd like.
When creating a EKS Cluster with Terraform with few options, I would like its
metadata_options.http_put_response_hop_limit
to be set to1
instead of2
.Describe alternatives you've considered.
Defining
metadata_options.http_put_response_hop_limit = 1
in all Terraform projects works, but it is quite cumbersome.Additional context
I am not aware of a legitimate use-case of using
http_put_response_hop_limit = 2
in EKS nodes in 2025. AWS documents a warning:Using the role assigned to the worker node in a pod is actually very dangerous because this role has special rights in the Kubernetes cluster (it can be used for example to read the Kubernetes Secrets used by pods running on the same node).
To make a pod able to use AWS resources without using the role assigned to the worker node, several robust ways exist: IRSA, EKS Pod Identities or even putting long-term AWS credentials in some Kubernetes Secrets used by the pod (which is not considered as the state of the art in the matter of security).
I suggest modifying the default value in
terraform-aws-eks/modules/eks-managed-node-group/variables.tf
Line 272 in 0b9d27b
terraform-aws-eks/modules/self-managed-node-group/variables.tf
Line 356 in 0b9d27b
terraform-aws-eks/node_groups.tf
Line 5 in 0b9d27b
The text was updated successfully, but these errors were encountered: