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

Backport of Fix issue where TLS configuration was ignored for unix sockets in consul connect envoy. into release/1.14.x #15934

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #15913 to be assessed for backporting due to the inclusion of the label backport/1.14.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


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.


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/derekm/NET-1990/unix-tls/quickly-sweet-javelin branch from 67a264c to dc274b3 Compare January 6, 2023 18:35
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/derekm/NET-1990/unix-tls/quickly-sweet-javelin branch from dc274b3 to 67a264c Compare January 6, 2023 18:35
@vercel
Copy link

vercel bot commented Jan 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
consul-ui-staging 🔄 Building (Inspect) Jan 6, 2023 at 6:35PM (UTC)

@github-actions github-actions bot added the theme/cli Flags and documentation for the CLI interface label Jan 6, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@hashi-derek hashi-derek marked this pull request as ready for review January 6, 2023 20:06
@hashi-derek hashi-derek merged commit 879e92f into release/1.14.x Jan 6, 2023
@hashi-derek hashi-derek deleted the backport/derekm/NET-1990/unix-tls/quickly-sweet-javelin branch January 6, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/cli Flags and documentation for the CLI interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants