-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
BREAKING CHANGE: Change IMDS metadata defaults to more strict #1579
Conversation
local.tf
Outdated
metadata_http_tokens = "optional" # If session tokens are required: optional, required. | ||
metadata_http_put_response_hop_limit = null # The desired HTTP PUT response hop limit for instance metadata requests. | ||
metadata_http_tokens = "required" # If session tokens are required: optional, required. | ||
metadata_http_put_response_hop_limit = 1 # The desired HTTP PUT response hop limit for instance metadata requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes will trigger an update for existing users unless they provide these values already.
I propose we group such changes for the next major release and make it visible in the upgrade guide.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure, fully agree.
Added this one to milestone v18.0.0 - https://github.com/terraform-aws-modules/terraform-aws-eks/milestone/5 @daroga0002 @lisfo4ka If you find other PRs which introduce breaking changes, let's add them there. |
@lisfo4ka please rebase |
Note that I tested this yesterday by manually setting "required", and EBS and EFS CSI Provisioner helm charts stopped working because they could not read metadata. I tried it with managed nodes, but should be the same. And probably, this can be fixed somehow, maybe in the chart values or something, I'm not expert in this instance metadata thingy. In my case I don't mind if you set it by default because it is very easy to change to "optional", but wanted you to know that this is giving me important issues. So maybe test it, or add an important note so people know. |
This is a good idea to be secure by default I might be wrong but I think It means user should use IRSA for all the component. I'm not sure you can retrieve region or vpc id or other information without querying metadata service, that mean adding them manually I guess. For example: https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html#deploy-lb-controller I can also think of aws ebs csi driver which also rely on metadata, and not sure if the csi-node can function without metadata access (kubernetes-sigs/aws-ebs-csi-driver#474). Anyway this is good but will require some adaptation on the user side to be able to upgrade to this major release |
exactly as per https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html Because:
|
Thank you for your contribution! The Remove any changes to the |
Hi folks, Investigating a little bit deeper I suggest increasing TTL ( Moreover, AWS EKS best practices admit increasing the hop limit on EC2 instances to 2. Even more, official CloudFormation templates for EKS cluster deployment are going to change the hop limit to 2 as well. It seems not yet And of course, we can remind in a Changelog that after restricting access to the instance metadata the pod can't inherit node IAM profile anymore, so the appropriate IAM roles for application service accounts should be provided. And just let me clarify that the parameter Also, we can leave a suggestion to configure the CloudWatch dashboard based on the |
This issue has been resolved in version 18.0.0 🎉 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR o'clock
Description
This will close #1271.
Defaults were set according to the Amazon EKS security best practices
Terraform apply:
Checklist