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

Race condition in clustered ASP.NET Core Key Storage provider #52

Open
wpbrown opened this issue Aug 6, 2019 · 2 comments
Open

Race condition in clustered ASP.NET Core Key Storage provider #52

wpbrown opened this issue Aug 6, 2019 · 2 comments
Labels
internals Refactoring and internal enhancements research Needs investigation

Comments

@wpbrown
Copy link
Owner

wpbrown commented Aug 6, 2019

Does the ASP.NET code actually do anything to deal with multiple processes attempting to create/rotate keys simultaneously?

https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers?view=aspnetcore-2.2

I think it does not:
https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-2.2#disableautomatickeygeneration

@wpbrown wpbrown added internals Refactoring and internal enhancements research Needs investigation labels Aug 6, 2019
@jtheisen
Copy link

jtheisen commented Mar 7, 2020

@wpbrown
Copy link
Owner Author

wpbrown commented Mar 7, 2020

@jtheisen Yea the race condition comment embedded in that question is exactly what I was on about here. Last time I looked at the code, it made no attempt to deal with a race. I think they've left it on the library user to designate a primary responsible for rotating keys and all others are readers. When deploying to a scale set like the domain joined ref arch, this would require leader election, and it all gets unnecessarily complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Refactoring and internal enhancements research Needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants