-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
How to lower security guards for integration testing? #7981
Comments
@eshitachandwani to look as current oncall |
Hey @lowgear, you're correct that using |
I think I have not described my scenario clear enough. Let me correct myself. In our project we make tests hermetic as possible. In particular, we set up all the components of the system on localhost during test preparation stage and the endpoint to which the connection is established during the test is a port on localhost too. So, unfortunately, using the system's default certificate pool is not helpful in my particular situation. If more details are required I will be glad to provide. |
@lowgear its not clear what you mean by "it is not viable to have a certificate stored along with the tests sources as it will eventually expire because it will not be valid longer than the root certificate". Regarding You can take a look at other auth mechanisms here https://grpc.io/docs/guides/auth/ |
@lowgear just checking if you got a chance to try the approach in the example and if you need more clarification or help. |
Okay, I have examined the example you have linked and yes, with such approach I can generate certificates for the purpose of testing. But basically my question was if I can avoid doing exactly that - that's what I meant by "I would not like to set up my own root CA and actual SSL in my tests" :) I guess the answer to my exact question is no. But that brings up the question if such library as |
Yeah I think you cannot easily and directly achieve true SSL/TLS authentication (with certificate verification) without setting up your own root CA and issuing certificates. I can ask other maintainers if there are workarounds but it would definitely not be recommended for integration tests as they should be close to real world scenarios where a client needs to be able to verify that the server's certificate was issued by a trusted Certificate Authority (CA). |
Well, in our production it is common practice to terminate SSL at L7 balancer and then send unencrypted traffic to the backends. As far as I know it is well known practice and a valid use of passing credentials over unencrypted connection (but surely only because of the trusted environment). |
This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
@lowgear so the thing is oauth rpc credentials required transport security https://github.com/grpc/grpc-go/blob/master/credentials/oauth/oauth.go#L140 and that's why you are not able to use insecure transport credentials. In addition there is a security level check which checks if a connection's security level is greater than or equal to the specified one. I tried to comment out these checks and tried the auth example with insecure transport purnesh42H/grpc-go@master...purnesh42H:grpc-go:use-insecrure-with-oauth and looks like that works. So, I think just for your testing you can implement your own custom credentials which doesn't require secure transport credentials and use that with oauth RPC credentials. However, this is not recommended for prod path. |
This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
Hello!
I am attempting to set up integration tests in my project.
I need to use per-RPC credentials for authorization but I would not like to set up my own root CA and actual SSL in my tests.
During my attempts I have figured out that grpc-go cares about client configuration security and integrity thus preventing me from setting up described configuration (specifically, from using
grpc.WithPerRPCCredentials(oauth.TokenSource{...})
together withinsecure.NewCredentials()
).What is the recommended way of accomplishing the described behavior in tests?
The text was updated successfully, but these errors were encountered: