-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
testing/e2e,grpcproxy: Fix: go test --tags "cluster_proxy" -v ./tests/e2e/... #12273
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integration/fixtures/gencerts.sh: - refactored common logic to a helper function - added definition for client-nocn certificate (used for grpc-proxy -> etcd-server) communication.
Executed: (cd ./integration/fixtures && ./gencerts.sh) This in particular cereated a new client-nocn.crt (and key) that can be used for testing grpc-proxy -> etcd-server connections.
…ert flags. We have following communication schema: client --- 1 ---> grpc-proxy --- 2 --- > etcd-server There are 2 sets of flags/certs in grpc proxy [ https://github.com/etcd-io/etcd/blob/master/etcdmain/grpc_proxy.go#L140 ]: A. (cert-file, key-file, trusted-ca-file, auto-tls) this are controlling [1] so client to proxy connection and in particular they are describing proxy public identity. B. (cert,key, cacert ) - these are controlling [2] so what's the identity that proxy uses to make connections to the etcd-server. If 2 (B.) contains certificate with CN and etcd-server is running with --client-cert-auth=true, the CN can be used as identity of 'client' from service perspective. This is permission escalation, that we should forbid. If 1 (A.) contains certificate with CN - it should be considered perfectly valid. The server can (should) have full identity. So only --cert flag (and not --cert-file flag) should be validated for empty CN.
Change tests/e2e to use proper (client-nocn.crt) certificate when running in tags="cluster_proxy" mode. Thanks to this (and previous in this PR) changes, the following test run finally succeeds: ./build && go test --tags "cluster_proxy" -v ./tests/e2e/...
@wenjiaswe Would you be willing to look at the certs related changes? |
jpbetz
suggested changes
Sep 9, 2020
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.
One very minor question about a comment then LGTM
jpbetz
suggested changes
Sep 9, 2020
ptabor
force-pushed
the
2020-09-07-fix-grpc-proxy-tests
branch
2 times, most recently
from
September 9, 2020 17:54
e98e6aa
to
b46bb55
Compare
ptabor
force-pushed
the
2020-09-07-fix-grpc-proxy-tests
branch
from
September 9, 2020 18:04
b46bb55
to
9d5a840
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR contains fixes that makes the e2e tests work through grpc proxy:
In particular:
Among others addresses requests:
Tested with:
go test --tags "cluster_proxy" -v ./tests/e2e/...