Skip to content
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

Support IMDSv1 and IMDSv2 #9962

Merged
merged 2 commits into from
Dec 16, 2022
Merged

Support IMDSv1 and IMDSv2 #9962

merged 2 commits into from
Dec 16, 2022

Conversation

hanshuebner
Copy link
Contributor

@hanshuebner hanshuebner commented Dec 14, 2022

This supersedes #8382 by Ivan Savcic isavcic@gmail.com to fix tests.

Fixes FTI-4536 FTI-1889
Relates to CSRE-663

@hanshuebner hanshuebner changed the title Use IMDSv2 when retrieving EC2 instance role Support IMDSv1 and IMDSv2 Dec 15, 2022
This adds optional support for the IMDSv2 protocol.  By default, the
aws-lambda plugin will use the IMDSv1 protocol to retrieve the
instance role.  Users can configure it to use IMDSv2 instead by
setting the configuration parameter `aws_imds_protocol_version` to
`v2`.  The default for the parameter is `v1` to ensure that
installations that run Kong inside of Docker on EC2 will continue to
work unchanged.

Signed-off-by: Ivan Savcic <isavcic@gmail.com>
Copy link
Member

@windmgc windmgc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM with nitpick, and please add a user doc for the new config field.

Tested on EC2 with both IMDSv1/v2 and it seems working well.

Perhaps we should consider change the default to v2 in next major version as I saw some of these official SDKs are using IMDSv2 as a default behavior(e.g. aws-go-sdk)

@hbagdi
Copy link
Member

hbagdi commented Dec 20, 2022

Is this missing a documentation PR?
If you have already created one, please reference it from here.

@hanshuebner
Copy link
Contributor Author

Is this missing a documentation PR?
It is - Created KAG-317 to track the activity

@hanshuebner
Copy link
Contributor Author

@windmgc Harry asked whether we could auto-detect the IMDS protocol version and we discussed the matter in Slack. The issue with defaulting to IMDSv2 is that with container deployments in EC2, the EC2 instance metadata needs to be explicitly configured to make IMDSv2 work. It would be possible to autodetect the protocol version, but that'd come at the cost of delaying the initial requests making use of the AWS Lambda plugin. We feel that this would impact too many customers, so the configuration of the protocol version will remain explicit for now.

lhanjian pushed a commit that referenced this pull request Dec 23, 2024
This PR added these features for admins.

1. The admin's belong workspace can be updated after selection.
2. The admin can't update their own belong workspace.

KM-402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants