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 #1

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), this copy of BOSH.Agent.psm1 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>),
this copy of BOSH.Agent.psm1 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

NOTE: This PR is related to this other PR cloudfoundry/stembuild#29, because we have a copy of this file in more than one location. However, this copy is used in our CI to build AWS Windows stemcells, so we also need to make that change here.

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.

👍

@jpalermo jpalermo merged commit 664d57d into master Apr 4, 2024
1 check passed
@jpalermo jpalermo deleted the imdsv2-for-aws-stmecells 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