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

Introduce a read-only mode for data protection keyring consumers #53539

Merged
merged 9 commits into from
Jan 26, 2024

Conversation

amcasey
Copy link
Member

@amcasey amcasey commented Jan 22, 2024

Introduce a read-only mode for data protection keyring consumers

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

When multiple app instances consume the same keyring, they all try to rotate it, leading to races. This change introduces an IConfiguration property (usually set as an env var) that puts data protection in a read-only mode. The expectation is that writing will be done by a separate (i.e. non-app-instance) component.

Fixes #52915

When multiple app instances consume the same keyring, they all try to rotate it, leading to races.  This change introduces an IConfiguration property (usually set as an env var) that puts data protection in a read-only mode.  The expectation is that writing will be done by a separate (i.e. non-app-instance) component.

Part of dotnet#52915
@amcasey amcasey added the area-dataprotection Includes: DataProtection label Jan 22, 2024
@amcasey
Copy link
Member Author

amcasey commented Jan 22, 2024

To actually fix #52915, we'll want a public API. I've separated out this part because it can be backported, whereas a new API cannot.

Chris pointed out that KeyManagementOptions.AutoGenerateKeys already allows this to be configured programmatically.

@amcasey amcasey marked this pull request as ready for review January 22, 2024 21:51
amcasey and others added 2 commits January 22, 2024 14:55
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
@amcasey
Copy link
Member Author

amcasey commented Jan 25, 2024

Interesting - the failure is specific to *nix. Investigating.

@amcasey amcasey merged commit c643f1e into dotnet:main Jan 26, 2024
26 checks passed
@amcasey amcasey deleted the ReadOnlyKeys branch January 26, 2024 17:57
@ghost ghost added this to the 9.0-preview1 milestone Jan 26, 2024
@wtgodbe wtgodbe modified the milestones: 9.0-preview1, 9.0-preview2 Jan 31, 2024
@ghost ghost added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 31, 2024
@amcasey
Copy link
Member Author

amcasey commented Feb 29, 2024

/backport to branch release/8.0

Copy link
Contributor

Started backporting to branch: https://github.com/dotnet/aspnetcore/actions/runs/8088872298

Copy link
Contributor

@amcasey an error occurred while backporting to branch, please check the run log for details!

Error: The specified backport target branch branch wasn't found in the repo.

@amcasey
Copy link
Member Author

amcasey commented Feb 29, 2024

/backport to release/8.0

Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/aspnetcore/actions/runs/8088881925

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dataprotection Includes: DataProtection area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce a read-only mode for data protection keyring consumers
3 participants