Skip to content
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

Fix issue where TLS configuration was ignored for unix sockets in consul connect envoy. #15913

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

hashi-derek
Copy link
Member

@hashi-derek hashi-derek commented Jan 5, 2023

When using consul connect envoy, TLS configuration was not applied to local unix sockets, even when flags were specified that provided certificates.

Notably, this affects Nomad deployments, which rely on unix sockets + encryption for certain configurations.
hashicorp/nomad#15360

Before this change, the only way TLS was enabled was if https:// was a prefix for the -grpc-addr flag. This allowed users to configure the certificates via environment variables / flags on clients and slowly adopt grpc+tls over time (the -grpc-addr value is also discoverable via an API call to /v1/agent/self, but the certificate is not).

After this change, TLS will be enabled only if either of the following are true:

  • -grpc-addr starts with https://
  • -grpc-addr starts with unix:// AND grpc certificates are configured

This ensures that the existing ability for users to roll out HTTP -> HTTPS conversions is not affected, while users of unix sockets can encrypt traffic, if desired.

Finally, there was some logic added recently that attempted to dial the gRPC connection prior to launching envoy to help users debug issues. However, this would be run during bootstrap mode, which would cause an undesired early return (Nomad generates the bootstrap on one host with Consul CLI and then passes that into a container). To fix this, the check has been swapped to a warning only (instead of returning) and the check also no longer runs during bootstrap mode.

@hashi-derek hashi-derek added the backport-inactive/1.14 This release series is no longer active label Jan 5, 2023
@github-actions github-actions bot added the theme/cli Flags and documentation for the CLI interface label Jan 5, 2023
@hashi-derek hashi-derek requested review from a team, erichaberkorn and wilkermichael and removed request for a team January 5, 2023 22:09
@hashi-derek hashi-derek marked this pull request as ready for review January 5, 2023 22:09
Copy link
Contributor

@wilkermichael wilkermichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hashi-derek hashi-derek merged commit 7b4f45e into main Jan 6, 2023
@hashi-derek hashi-derek deleted the derekm/NET-1990/unix-tls branch January 6, 2023 18:34
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 9, 2023
…ul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 9, 2023
…ul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 11, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 11, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 11, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 11, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14
shoenig added a commit to hashicorp/nomad that referenced this pull request Jan 11, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14

Co-authored-by: Seth Hoenig <shoenig@duck.com>
philrenaud pushed a commit to hashicorp/nomad that referenced this pull request Jan 23, 2023
* [no ci] first pass at plumbing grpc_ca_file

* consul: add support for grpc_ca_file for tls grpc connections in consul 1.14+

This PR adds client config to Nomad for specifying consul.grpc_ca_file

These changes combined with hashicorp/consul#15913 should
finally enable Nomad users to upgrade to Consul 1.14+ and use tls grpc connections.

* consul: add cl entgry for grpc_ca_file

* docs: mention grpc_tls changes due to Consul 1.14
skpratt pushed a commit that referenced this pull request Jan 25, 2023
…sul connect envoy. (#15913)

Fix issue where TLS configuration was ignored for unix sockets in consul connect envoy.
Disable xds check on bootstrap mode and change check to warn only.
vzell pushed a commit to vzell/ansible-nomad that referenced this pull request Sep 5, 2023
See:
 - Consul Connect sidecar proxies require additional configuration for gRPC-TLS listener - hashicorp/nomad#15360
 - client: accommodate Consul 1.14.0 gRPC and agent self changes - hashicorp/nomad#15309
 - consul: add client configuration for grpc_ca_file - hashicorp/nomad#15701
 - Fix issue where TLS configuration was ignored for unix sockets in consul connect envoy. - hashicorp/consul#15913
 - Envoy -> consul “upstream connect error or disconnect/reset before headers. reset reason: connection termination” - https://discuss.hashicorp.com/t/envoy-consul-upstream-connect-error-or-disconnect-reset-before-headers-reset-reason-connection-termination/48303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-inactive/1.14 This release series is no longer active theme/cli Flags and documentation for the CLI interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants