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

Enable IMDSv2 in AWS Windows stemcell #29

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

klakin-pivotal
Copy link
Contributor

When the bosh-linux-stemcell-builder was updated to add IMDSv2 support to AWS Linux stemcells in commit
86bb00e0b64ea7ece71ed2775358fbab99cef033 (see:
cloudfoundry/bosh-linux-stemcell-builder@86bb00e), stembuild was not updated with the corresponding change.

This commit makes that change. It looks like without this change, Bosh Agents running in Windows on IMDSv2-only VMs will be unable to talk to the AWS Metadata Server, and will be unable to start. JIRA ticket BOSHWIN-43 was opened with a customer complaining of this very problem.

Commentary from the bosh-linux-stemcell-builder commit mentioned above follows:

  • TokenPath must be set in agent.json in order for the bosh-agent to load metadata using the IMDSv2 protocol.
  • This commit adds that field. It will be ignored unless the agent has been updated to expect it.

[#180052419] [TAS-94] Convert the Agent on AWS to use IMDSv2

When the bosh-linux-stemcell-builder was updated to add IMDSv2 support
to AWS Linux stemcells in commit
86bb00e0b64ea7ece71ed2775358fbab99cef033 (see:
<cloudfoundry/bosh-linux-stemcell-builder@86bb00e>),
stembuild was not updated with the corresponding change.

This commit makes that change. It looks like without this change, Bosh
Agents running in Windows on IMDSv2-only VMs will be unable to talk to
the AWS Metadata Server, and will be unable to start. JIRA ticket
BOSHWIN-43 was opened with a customer complaining of this very problem.

Commentary from the bosh-linux-stemcell-builder commit mentioned above
follows:

- TokenPath must be set in `agent.json` in order for the bosh-agent to load metadata using the IMDSv2 protocol.
- This commit adds that field. It will be ignored unless the agent has been updated to expect it.

[#180052419] [TAS-94] Convert the Agent on AWS to use IMDSv2
@klakin-pivotal
Copy link
Contributor Author

Do note that I didn't have a pair when working on this, so I'd appreciate some thorough review.

I didn't notice any tests that tested the contents of agent.json, only tests that checked to see if any file was written at all... so I think this SHOULD pass through CI okay.

Copy link
Member

@jpalermo jpalermo left a comment

Choose a reason for hiding this comment

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

Even though stembuild doesn't currently support building aws stemcells, these files are kept in sync with the psmodules copy, so this is a copy of cloudfoundry/bosh-psmodules#1

@jpalermo jpalermo merged commit 12a2f08 into master Apr 4, 2024
@jpalermo jpalermo deleted the imdsv2-for-windows-stemcells branch April 4, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants