-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat(mTLS): adds mTLS support to dataplane api-server #280
base: main
Are you sure you want to change the base?
feat(mTLS): adds mTLS support to dataplane api-server #280
Conversation
how about generating certs during the test, writing them to temp files and then passing those to
this looks good. we can test it using https://github.com/islishude/grpc-mtls-example/blob/main/cmd/client/main.go.
we don't have an integration test for the current grpc server. i guess an integration test for the api server would involve spinning up the server and calling each method from an independent client? for testing mTLS specifically, i think we can just get away with only testing one method, since the thing we want to test is actually the TLS connection. something, like the answer to your first question, but coded in a script.
we don't really have any docs apart from code comments. i think code comments for now is fine. documentation is an entirely separate conversation that we need to have soon. |
d8616e1
to
b6ce541
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: EandrewJones The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@aryan9600 All comments addressed apart from the one issue flagged below.
If we're not treating this as an integration test, where should we add this so it runs in our pipeline? We need the dataplane server running so we can mimic the client, so it seems like it should go into the integration test pipeline ( |
2f70c40
to
06d22a3
Compare
I pushed up a go test that creates certs, spins up the dataplane, and dials the grpc w/ mTLS from a client. The test passes, but I suspect it's a false positive because the dataplane exits almost immediately on my machine due to an error:
I only care about having a valid test at this point and adding it to our CI. My guess is I need to deploy the dataplane into KTF to get a proper environment for testing. Is that correct @shaneutt ? |
Does the golang controlplane archival have any impact on this? Or do I just
need to stand up KTF before I run these tests.
Best
Evan Jones
Website: www.ea-jones.com
…On Wed, Oct 23, 2024 at 4:50 PM Shane Utt ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/integration/dataplane_mtls_test.go
<#280 (comment)>
:
> +// runDockerImage starts the Docker container with the specified name.
+func runDockerImage(containerName, imageName string) error {
+ cmd := exec.Command(
+ "docker",
+ "run",
+ "--name", containerName,
+ "-d",
+ "-p", "9874:9874",
+ "-v", os.Getenv("PWD")+"/certs:/app/certs",
+ imageName,
+ "mutual-tls",
+ "--server-certificate-path", "/app/certs/server.pem",
+ "--server-private-key-path", "/app/certs/server-key.pem",
+ "--client-certificate-authority-root-path", "/app/certs/root.pem",
+ )
+ return cmd.Run()
+}
Right, we use KTF specifically for MetalLB which we use for IPAM for our
(bpf hijacked) services right now. So for a complete testing environment
we're still a bit bound to KTF (or you can manually reproduce the same
environment with your own metallb configmap).
—
Reply to this email directly, view it on GitHub
<#280 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ2T6AMKOYZPALI3TE4QDBTZ5AY2ZAVCNFSM6AAAAABN3I65QGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGOJQHA3TSMJUGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The archival shouldn't have an impact: there's a |
06d22a3
to
e7c2ff1
Compare
7dc3686
to
3fa2eef
Compare
@shaneutt @aryan9600 This should be ready for final review. I finally have passing tests. Upon |
Woops I still owe you a review! If you wouldn't mind doing a rebase to main I'll have some time this week to start a review (I was out the last couple weeks sorry for the lag ^_^) |
9fab255
to
9ad32bc
Compare
Rebased.
Best
Evan Jones
Website: www.ea-jones.com
…On Mon, Dec 2, 2024 at 11:26 AM Shane Utt ***@***.***> wrote:
Woops I still owe you a review! If you wouldn't mind doing a rebase to
main I'll have some time this week to start a review (I was out the last
couple weeks sorry for the lag ^_^)
—
Reply to this email directly, view it on GitHub
<#280 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ2T6AK7S2D5FHCE5F4WF432DSX7TAVCNFSM6AAAAABN3I65QGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJSGU2TQNJTGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Closes #50.
Questions
I am not sure how best to add tests for this. Unit testing the config trivially tests the behavior of Opt which we know works. Unit testing
setup_tls
forces me to mockread_to_string
in the absence of an actual file to read in and all the ways I've read about doing that in rust feel really kludgie / dirty up the code with dependency injections, etc.