-
Notifications
You must be signed in to change notification settings - Fork 37
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: Add (m)TLS #464
Merged
Merged
feat: Add (m)TLS #464
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
ci failing on bufbuild/buf#1209, does not block this so i can fix in another pr edit: fixed and merged |
richardcase
reviewed
Jun 21, 2022
richardcase
previously approved these changes
Jun 27, 2022
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.
Just the one comment but i don't think that is essential at all.
Lol i completely forgot to do that suggestion |
This commit adds the option to configure TLS or mTLS on the server. There is also a script to generate certs for testing which can be found at `hack/scripts/gen_local_certs.sh`. To manually test I did the following: ``` ./hack/scripts/gen_local_certs.sh all --host localhost --cfssl $(which ssl --cfssljson $(which cfssljson) make build sudo ./bin/flintlockd run \ --containerd-socket=/run/containerd-dev/containerd.sock \ --parent-iface="${NET_DEVICE}" \ --grpc-endpoint=localhost:9091 \ --tls-cert localhost/localhost.pem \ --tls-key localhost/localhost-key.pem \ --tls-client-ca localhost/intermediate-ca.pem \ --tls-client-validate ``` I added `localhost/liquidmetalclient1.pem` and the ca to `hammertime`, and verified that the request failed without the certs. On start, flintlockd will log whether TLS is enabled or disabled: ``` ... INFO[0000] flintlockd, version=undefined, built_on=undefined, commit=undefined INFO[0000] flintlockd grpc api server starting WARN[0000] basic authentication is DISABLED INFO[0000] TLS is enabled INFO[0000] starting microvm controller INFO[0000] starting microvm controller with 1 workers controller=microvm ... ``` There are unit tests for the validation, but to test that the certs have been wired in to the server properly, I will need to add some e2e layer testing. I am going to tackle that in another ticket. Co-authored-by: Richard Case <[email protected]>
richardcase
approved these changes
Jun 27, 2022
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.
This commit adds the option to configure TLS or mTLS on the server.
There is also a script to generate certs for testing which can be found
at
hack/scripts/gen_local_certs.sh
.To manually test I did the following:
I added
localhost/liquidmetalclient1.pem
and the ca tohammertime
,and verified that the request failed without the certs and worked with them.
On start, flintlockd will log whether TLS is enabled or disabled:
There are unit tests for the validation, but to test that the certs have
been wired in to the server properly, I will need to add some e2e layer
testing. I am going to tackle that in another ticket.
Completing #461, follows on from #462 which will be merged first.
Fixes #243
Co-authored-by: Richard Case [email protected]