Skip to content

Support using the Entra SDK sidecar container to validate Azure access tokens#447

Open
AzureMarker wants to merge 25 commits into
kubeguard:masterfrom
AzureMarker:markdrobnak/entra-sdk-support
Open

Support using the Entra SDK sidecar container to validate Azure access tokens#447
AzureMarker wants to merge 25 commits into
kubeguard:masterfrom
AzureMarker:markdrobnak/entra-sdk-support

Conversation

@AzureMarker
Copy link
Copy Markdown
Contributor

@AzureMarker AzureMarker commented Apr 21, 2026

NOTE: Most of the changed lines are due to vendoring some packages for the new E2E tests.

There are some systems using Guard that want to perform the Azure access token validation using the "official" dotnet implementation. This is where the Entra SDK container comes in:
https://learn.microsoft.com/en-us/entra/msidweb/agent-id-sdk/overview

https://mcr.microsoft.com/en-us/artifact/mar/entra-sdk/auth-sidecar/about

This PR adds support for using this container as a sidecar for Azure access token validation. It cannot fully validate PoP tokens, so it's only used for the inner access token validation in that scenario.

This feature is enabled only when the new --azure.entra-sdk-url flag is set in the Guard options, for example:

--azure.entra-sdk-url=http://localhost:8080

The PR also fixes up the E2E tests and adds some that run through the full Azure token validation flow. This required some changes in the installer as well.

I added a local E2E testing script that automates the work of building the container image locally, loading it into the kind cluster, and running the E2E with that container image. There is a readme at test/e2e/README.md that explains how to use the script.

Closes #448

@AzureMarker AzureMarker requested review from a team as code owners April 21, 2026 00:20
Mark Drobnak added 12 commits April 20, 2026 17:22
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
The cluster role and role binding were removed but E2E was not updated:
kubeguard#369

Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
@AzureMarker AzureMarker force-pushed the markdrobnak/entra-sdk-support branch from 7664882 to c1ee28a Compare April 21, 2026 00:23
Mark Drobnak added 6 commits April 20, 2026 17:33
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
@AzureMarker AzureMarker changed the title Support using the Entra SDK sidecar container for validating Azure access tokens Support using the Entra SDK sidecar container to validate Azure access tokens Apr 21, 2026
Mark Drobnak added 4 commits April 21, 2026 16:42
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
Comment thread installer/deployment.go
},
},
InitialDelaySeconds: int32(30),
InitialDelaySeconds: 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this change will be a behavior change. though, it's unclear who's really using the installer. but is it really necessary?

Copy link
Copy Markdown
Contributor Author

@AzureMarker AzureMarker May 6, 2026

Choose a reason for hiding this comment

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

It's not necessary, but a 30 second wait is unnecessary and slows down the tests a lot.

@weinong
Copy link
Copy Markdown
Contributor

weinong commented May 6, 2026

generally LGTM. I pinged few people from AKS to review as well. We can aim to merge it later this week if they don't have other feedback.

Comment thread auth/providers/azure/verifier.go Outdated
@norshtein
Copy link
Copy Markdown

Seems the CI does not contain E2E, do we have an E2E test result for the new code?

Comment thread installer/options.go
Comment thread installer/options.go
@norshtein
Copy link
Copy Markdown

My comments are mainly about nit and those are non-blocking. The code's functionality LGTM.

Comment thread installer/options.go
Comment thread installer/deployment.go
Comment thread auth/providers/azure/verifier.go Outdated
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
@AzureMarker
Copy link
Copy Markdown
Contributor Author

Seems the CI does not contain E2E, do we have an E2E test result for the new code?

@norshtein Yes, the E2E was successful when I ran it locally:
image

There's an old PR to add the E2Es to PR checks: #232

Comment thread installer/deployment.go
Comment thread auth/providers/azure/verifier.go
Comment thread auth/providers/azure/verifier.go
Signed-off-by: Mark Drobnak <markdronak@microsoft.com>
@AzureMarker AzureMarker requested a review from weinong May 8, 2026 16:46
@arxhive
Copy link
Copy Markdown
Contributor

arxhive commented May 8, 2026

Thank you for the updates, LGTM!

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.

Tracking issue: Use Entra SDK sidecar container to validate Azure access tokens

5 participants