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

[Identity] Hotfix 1.5.1: IMDS ping fixes #16878

Merged

Conversation

sadasant
Copy link
Contributor

This PR is intended to release Identity hotfix 1.5.1, which:

  • Fixes how we verify the IMDS endpoint is available. Now, besides skipping the Metadata header, we skip the URL query. Both will ensure that all the known IMDS endpoints return as early as possible.
  • Adds support for the AZURE_POD_IDENTITY_AUTHORITY_HOST environment variable. If present, the IMDS endpoint initial verification will be skipped.

It took us a while to figure out why sometimes IMDS pings couldn’t be fulfilled on time. While it was under our assumptions that requests to the IMDS endpoint would immediately fail if they were sent without a Metadata header, turns out that this is not the case: Some IMDS endpoints, like the one used by the Pod Identity service, won’t necessarily fail if this header is missing. More generally, these endpoints will fail if both this header and the query parameters are missing.

The environment variable seems like a reasonable plus to include.

Feedback always appreciated!

@sadasant sadasant self-assigned this Aug 12, 2021
@sadasant sadasant requested a review from daviwil as a code owner August 12, 2021 02:29
@ghost ghost added the Azure.Identity label Aug 12, 2021
clientId?: string,
options?: {
skipQuery?: boolean;
skipMetadataHeader?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

This allows to skip both or only one of the two. From my understanding of the PR description, we are skipping both to verify the endpoint. We keep both when getting the token. What is the scenario where we would need to skip only one of the two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now we don’t have a scenario in which we might want to skip only one, but it felt worse for me to have some arbitrary parameter that would do more than one thing. Like skipDetails? It feels so constrained to some current vague definition. So, I went with being extra verbose on what’s the intention of this last optional parameter, in a way that can help us add more configuration later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why I consider this a “concurrent definition” is because we assumed all IMDS endpoints would behave this way (rejecting requests without the Metadata header) up to this point. So, I want to make it easier for us to adapt to future findings, if they happen.

Copy link
Contributor Author

@sadasant sadasant Aug 12, 2021

Choose a reason for hiding this comment

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

Although I made this hotfix, and I’m intending to release it asap, I’m in the process of communicating this unexpected behavior to the team. Charles confirmed to me that, given that this header is not as we thought it would be, a similar change seems necessary in other languages. It could lead to something interesting. But the code change seems an improvement regardless of future inquiries.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough

Copy link
Member

Choose a reason for hiding this comment

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

May be you can highlight some where in the ref-docs for the user when to use these skip-options and in what combinations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not part of the public API though. This is invisible to users. Well, except when their authentication sometimes fails (current scenario in k8s).

@sadasant sadasant force-pushed the hotfix/identity_1.5.1-changes branch from aad1014 to e980b6a Compare August 12, 2021 17:02
@sadasant
Copy link
Contributor Author

Tested on the k8s test environment that was presenting the issue. It works!

Although there’s still some postmortem to do, this finally concludes with our investigations 😊

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
@sadasant
Copy link
Contributor Author

Update: Took a bit of time to test this on other IMDS endpoints. Things are working as usual there, as far as I could tell.

@sadasant sadasant merged commit e32af7d into Azure:hotfix/identity_1.5.1 Aug 12, 2021
@sadasant sadasant deleted the hotfix/identity_1.5.1-changes branch August 12, 2021 22:30
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Dec 28, 2021
Review request for Microsoft.ContainerService to add version preview/2021-11-01-preview (Azure#17104)

* Adds base for updating Microsoft.ContainerService from version stable/2021-10-01 to version 2021-11-01-preview

* Updates readme

* Updates API version in new specs and examples

* feat: define OIDC issuer profile (Azure#16834)

* feat: define OIDC issuer profile

* fix: add `OIDC` to custom-wrods.txt

* doc: update description

* style: fix style check

* fix: add type

* add enableNamespaceResources in Managed Cluster (Azure#16835)

* add enableNamespaceResources in Managed Cluster

* update example for enableNamespaceResources

* changed description of enableNamespaceresources

* change description for enableNamespaceResources

* feat: define currentKubernetesVersion (Azure#16878)

Add property currentKubernetesVersion for feature AliasMinorVersion

* add message of the day for Linux nodes (Azure#16942)

* [AKS] feat: add python SDK generation for 1001/1101-preview api (Azure#16895)

* feat: add python SDK generation for 1001/1101-preview api

* fix: missing tag

* fix: update path

* fix: update path

* fix: typo

* feat: update readme.python.md

* Rebased from main to dev branch (Azure#17081)

Co-authored-by: Anumita Shenoy <anumitashenoy@gmail.com>
Co-authored-by: Jianping Zeng <zjpjack@users.noreply.github.com>
Co-authored-by: Ace Eldeib <alexeldeib@gmail.com>
Co-authored-by: Tong Chen <45081443+tonche@users.noreply.github.com>
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.

5 participants