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 AAD signing key issuer validation for API Key auth #6459

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

schmittjoseph
Copy link
Member

@schmittjoseph schmittjoseph commented Apr 15, 2024

Summary

When using API Key auth, enable AAD signing key issuer validation -- this is required by CodeQL.

We already have an official way of performing AAD auth, so this is change largely a no-op. The full effects of adding this validation are as follows:

  • If an OpenIdConnectConfiguration is configured then extra validation will be performed on it. When using API Key auth, we never add this configuration so nothing will happen unless the user somehow has.
  • If the API key is derived from an X.509 certificate then we will now validate the lifetime of the certificate (if it is already active and non-expired).
Release Notes Entry

@schmittjoseph schmittjoseph marked this pull request as ready for review April 15, 2024 18:31
@schmittjoseph schmittjoseph requested a review from a team as a code owner April 15, 2024 18:31
@schmittjoseph schmittjoseph merged commit b3e6493 into dotnet:main Apr 18, 2024
26 checks passed
@schmittjoseph schmittjoseph added servicing-patch Servicing fixes that is targeted for a patch release (0.0.x version) servicing-minor Servicing fixes that is targeted for a minor release (0.x.0 version) servicing-major Servicing fixes that is targeted for a major release (x.0.0 version) labels Apr 18, 2024
@schmittjoseph schmittjoseph deleted the aad-changes branch April 18, 2024 20:17
@schmittjoseph
Copy link
Member Author

/backport to release/8.0

@schmittjoseph
Copy link
Member Author

/backport to release/7.x

Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/dotnet-monitor/actions/runs/8744153570

@schmittjoseph
Copy link
Member Author

/backport to release/6.x

Copy link
Contributor

Started backporting to release/7.x: https://github.com/dotnet/dotnet-monitor/actions/runs/8744154827

Copy link
Contributor

Started backporting to release/6.x: https://github.com/dotnet/dotnet-monitor/actions/runs/8744156068

Copy link
Contributor

@schmittjoseph backporting to release/6.x failed, the patch most likely resulted in conflicts.

Please backport manually using one of the below commands, followed by git am --continue once the merge conflict has been resolved.

PowerShell

(Invoke-WebRequest "https://github.com/dotnet/dotnet-monitor/commit/b3e64938549c60d95ebf6dad945de4aaee563ff0.patch").Content | git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch

Bash

curl -sSL "https://github.com/dotnet/dotnet-monitor/commit/b3e64938549c60d95ebf6dad945de4aaee563ff0.patch" | git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch

git am error output:

$ git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch changes.patch

Applying: Enable EnableAadSigningKeyIssuerValidation (#6459)
.git/rebase-apply/patch:22: trailing whitespace.
            // Required for CodeQL. 
.git/rebase-apply/patch:45: trailing whitespace.
            // Required for CodeQL. 
warning: 2 lines add whitespace errors.
Using index info to reconstruct a base tree...
A	src/Tools/dotnet-monitor/Auth/ApiKey/JwtBearerOptionsExtensions.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs
CONFLICT (content): Merge conflict in src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Enable EnableAadSigningKeyIssuerValidation (#6459)
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
servicing-major Servicing fixes that is targeted for a major release (x.0.0 version) servicing-minor Servicing fixes that is targeted for a minor release (0.x.0 version) servicing-patch Servicing fixes that is targeted for a patch release (0.0.x version)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants