Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Backport of Add fix for when we need to use the system-wide trusted CAs into release/0.5.x#460

Merged
andrewstucki merged 2 commits intorelease/0.5.xfrom
backport/system-ca-fix/thoroughly-sweet-shad
Nov 18, 2022
Merged

Backport of Add fix for when we need to use the system-wide trusted CAs into release/0.5.x#460
andrewstucki merged 2 commits intorelease/0.5.xfrom
backport/system-ca-fix/thoroughly-sweet-shad

Conversation

@hc-github-team-consul-api-gateway
Copy link
Copy Markdown
Contributor

Backport

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

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


Changes proposed in this PR:

This adds the simplest path for supporting the helm option externalServer.useSystemRoots. Since the controller always passes in a value to the deployment via CONSUL_CACERT when the controller knows that the Consul connections are served over TLS, we leverage the fact that it's going to write an empty file to disk that the deployment will then try and use as a file.

Rather than doing a larger re-write of the deployment code to handle cases in which TLS is configured but no certs are passed in (when you want to validate with system-wide certs), I added some code that handles the invalid certificates being passed in, in which case we just fallback to using the system-wide certs. What this entails is:

  1. Ensuring that the file passed in CONSUL_CACERT is valid.
  2. If it isn't, unsetting it but flagging that CONSUL_USE_SSL is set to mark that this still needs to talk over SSL
  3. Passing this info down to our envoy process manager so that it knows to bootstrap envoy with the proper paths for verifying the Consul SSL connection (i.e. the path to the envoy container's system roots)

How I've tested this PR:

Verified this on HCP with useSystemRoots, with a local consul server node and the self-signed certs that go with it, and with a local node and TLS disabled. These were validated with the changes in hashicorp/consul-k8s#1743.

Checklist:

  • Tests added
  • CHANGELOG entry added

    Run make changelog-entry for guidance in authoring a changelog entry, and
    commit the resulting file, which should have a name matching your PR number.
    Entries should use imperative present tense (e.g. Add support for...)


Overview of commits

@hc-github-team-consul-api-gateway hc-github-team-consul-api-gateway force-pushed the backport/system-ca-fix/thoroughly-sweet-shad branch from 89c8dce to 530fb06 Compare November 18, 2022 20:39
@andrewstucki andrewstucki added the pr/no-changelog Skip the CI check that requires a changelog entry label Nov 18, 2022
@andrewstucki andrewstucki merged commit 7caecc1 into release/0.5.x Nov 18, 2022
@andrewstucki andrewstucki deleted the backport/system-ca-fix/thoroughly-sweet-shad branch November 18, 2022 21:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pr/no-changelog Skip the CI check that requires a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants