-
Notifications
You must be signed in to change notification settings - Fork 487
Add support for enabling auto_encrypt on both server and client instances #151
base: master
Are you sure you want to change the base?
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
@Etiene Could you review this one? |
"ca_path": "$ca_path", | ||
"cert_file": "$cert_file_path", | ||
"key_file": "$key_file_path", | ||
"ports": { | ||
"https": 8501, | ||
"grpc": 8502 |
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.
Shouldn't these be configurable?
"https": 8501 | ||
}, | ||
"http_config": { | ||
"allow_write_http_from": ["127.0.0.0/8"] |
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.
Should this be configurable too?
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. |
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):