-
Notifications
You must be signed in to change notification settings - Fork 220
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
fix!: standardize gRPC authentication and mitigate DoS #5936
fix!: standardize gRPC authentication and mitigate DoS #5936
Conversation
871b58d
to
ea5c9f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach, looks good. What about adding some unit tests to ServerAuthenticationInterceptor
?
applications/minotari_app_grpc/src/authentication/server_interceptor.rs
Outdated
Show resolved
Hide resolved
applications/minotari_app_grpc/src/authentication/server_interceptor.rs
Outdated
Show resolved
Hide resolved
I looked into this, but it wasn't clear how to cleanly do such tests. Right now, it seems that all of the integration tests use |
ea5c9f9
to
b3c2521
Compare
b3c2521
to
f41a43d
Compare
f41a43d
to
b519163
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I understand the reason for the move it feels a little weird to keep the password in cleartext, even though keeping the hashed password previously didn't change the level of security if someone could access it.
And we are now moving to remove grpc from the wallet entirely so it looks like we're closing down vectors from multiple angles. So I'm good with this.
utAck.
@brianp: I agree that it's not an ideal solution, but I think it meets a reasonable threat model and, improves the user experience, and removes the DoS vector. Even with removing wallet gRPC by default, that attack vector would still exist with node gRPC. Supporting TLS will be an additional layer of protection too. So I think overall it's a net win that doesn't sacrifice practical security. |
Description
Standardizes gRPC authentication by removing PHC strings from configuration and preventing a client DoS.
Closes #5809. Closes #5927.
Motivation and Context
As noted in #5927, gRPC authentication is nonstandard. In the current design, server credentials are processed against a client-supplied username and PHC string for verification. This can lead to server DoS, as described in #5809.
This PR fixes the DoS vector. When the gRPC server is started, it applies
Argon2
to produce a PHC string that is kept in memory. When a client supplies its (non-PHC) passphrase, it is processed against the stored PHC string. This ensures that the server completely controls theArgon2
parameters that are used.Note that this is still suboptimal, as the client and server passphrases are still stored in plaintext configuration. Deciding how to handle those is out of scope for this work.
How Has This Been Tested?
It should be tested manually.
What process can a PR reviewer use to test or verify this change?
It should be tested manually.
BREAKING CHANGE: Updates the public APIs for
BasicAuthCredentials
andServerAuthenticationInterceptor
to accommodate the new behavior. Additionally, existing configuration client/server credentials will stop working, and client credentials will need to use plaintext passwords.