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

[await-tags] Provide authentication to instance metadata API #1630

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

davidfurey
Copy link
Member

@davidfurey davidfurey commented Mar 13, 2025

What does this change?

Calls to the instance metadata API without authentication are no longer accepted. Adding the token effectively updates this from using IMDSv1 to IMDSv2. This should resolve FSBP EC2.8 for a number of services in the editorial tools space.

NB- this role is still deprecated, but it is quicker to upgrade it for FSBP compliance than to convince ourselves that it isn't needed

How to test

What is the value of this?

Resolves FSBP EC2.8

Have we considered potential risks?

This script is already broken because the existing INSTANCE_ID call fails, so this PR cannot make things worse.

Calls to this API without authentication are no longer accepted. Adding the token effectively updates this from using IMDSv1 to IMDSv2

NB- this role is still deprecated, but it is quicker to upgrade it for FSBP compliance than to convince ourselves that it isn't needed

Co-authored-by: Emily Bourke <[email protected]>
@davidfurey davidfurey requested a review from a team as a code owner March 13, 2025 15:21
Copy link
Contributor

@jorgeazevedo jorgeazevedo left a comment

Choose a reason for hiding this comment

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

Nice one, I think this should work! I ran the curl calls in a real instance and they behaved as expected

@davidfurey
Copy link
Member Author

Thanks for the review!

@davidfurey davidfurey enabled auto-merge March 13, 2025 16:03
@davidfurey davidfurey merged commit d7ffd43 into main Mar 13, 2025
5 checks passed
@davidfurey davidfurey deleted the use-imdsv2-await-tags branch March 13, 2025 16:06
@emdash-ie
Copy link
Contributor

Have started bake 114 of editorial-tools-focal-java11-ARM-WITH-cdk-base to test that this works as we expect.

@emdash-ie
Copy link
Contributor

Bake finished, deploying archiver to CODE now.

@emdash-ie
Copy link
Contributor

The change doesn’t appear to have fixed the tag lookup, it seems: the logs still show the message “AWS tags not found after 1 minute”. Will check for usages of the IMDSv1 API though, as that should still have come down even if the script isn’t working.

@emdash-ie
Copy link
Contributor

It looks like archiver in CODE is still using the old AMI (bake 113). I think my deploy was insufficient, possibly I needed to deploy the cloudformation?

@emdash-ie
Copy link
Contributor

Apparently it can take time for AMIs to be visible in the right account, but a normal deploy should be fine once it is visible. I have confirmed that the right AMI is visible, and started a new deploy. Hopefully this one should do it!

@emdash-ie
Copy link
Contributor

The logs look good this time: https://logs.gutools.co.uk/s/editorial-tools/app/r/s/49bKq

@emdash-ie
Copy link
Contributor

The metric also looks good: there’s a datapoint for MetadataNoTokenRejected at 16:40 which is from the previous deploy, but none after that.

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

Successfully merging this pull request may close these issues.

3 participants