This repository was archived by the owner on Jan 25, 2023. It is now read-only.
Add support for enabling auto_encrypt on both server and client instances#151
Open
jinnko wants to merge 4 commits intohashicorp:masterfrom
Open
Add support for enabling auto_encrypt on both server and client instances#151jinnko wants to merge 4 commits intohashicorp:masterfrom
jinnko wants to merge 4 commits intohashicorp:masterfrom
Conversation
We get support for enabling auto_encryption at set up time, allowing client instances to get their TLS key/cert pairs from the consul servers. In order to allow browsers to access the UI we also need to enable the HTTPS endpoint and disable mTLS on the HTTPS endponit, while keeping mTLS enabled for RPC connections.
When we're running consul in client mode and want it to connect to the servers we must provide the CA and enable HTTPS. It's also good practice to disable plain HTTP.
There's a known issue[1] in v1.6.0 that prevents consul clients from contacting the servers when they're configured to auto-join. This workaround[2] gets things working. 1: hashicorp/consul#6391 2: hashicorp/consul#6391 (comment)
When auto_encrypt is used on the client agents there's still no support for TLS over the HTTPS API[1]. In order for the client agents to interact with services such as nomad we need to enable the HTTP API, but to maintain some level of controls we also restrict write operations to localhost. 1: hashicorp/consul#6403
Collaborator
|
@Etiene Could you review this one? |
Etiene
reviewed
Sep 20, 2019
| "key_file": "$key_file_path", | ||
| "ports": { | ||
| "https": 8501, | ||
| "grpc": 8502 |
Contributor
There was a problem hiding this comment.
Shouldn't these be configurable?
Etiene
reviewed
Sep 20, 2019
| "https": 8501 | ||
| }, | ||
| "http_config": { | ||
| "allow_write_http_from": ["127.0.0.0/8"] |
Contributor
There was a problem hiding this comment.
Should this be configurable too?
Contributor
|
Thanks for the PR! How did you test this? I wonder if we should have an automated test to check this behavior |
|
I created a Pull Request for this Pull request. Enable auto encryption without requiring server key and certificate. My understand of auto-encryption is that the server will provide a PKI certificate to clients, you don't have to distribute them yourself. Adjusted to create a configuration similar to on in the Learning Consul documentation. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We get support for enabling auto_encryption at set up time, allowing client instances to get their TLS key/cert pairs from the consul servers.
In order to allow browsers to access the UI we also need to TLS on the HTTPS endponit, while keeping mTLS enabled for RPC connections.
There are a couple of special cases to be considered (see individual commits for details):