diff --git a/.changelog/17481.txt b/.changelog/17481.txt new file mode 100644 index 0000000000000..89ad16998e836 --- /dev/null +++ b/.changelog/17481.txt @@ -0,0 +1,3 @@ +```release-note:bug +tlsutil: Default setting of ServerName field in outgoing TLS configuration for checks now handled by crypto/tls. +``` diff --git a/.changelog/17846.txt b/.changelog/17846.txt new file mode 100644 index 0000000000000..bd5a052f851f7 --- /dev/null +++ b/.changelog/17846.txt @@ -0,0 +1,3 @@ +```release-note:bug +connect/ca: Fixes a bug preventing CA configuration updates in secondary datacenters +``` diff --git a/.github/workflows/verify-release-linux.yaml b/.github/workflows/verify-release-linux.yaml deleted file mode 100644 index a86da7f05fb3e..0000000000000 --- a/.github/workflows/verify-release-linux.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -name: Verify Release - Linux - -on: - workflow_dispatch: - inputs: - packageName: - description: 'Name of consul release package (consul vs consul-enterprise)' - required: true - default: 'consul' - type: choice - options: - - consul - - consul-enterprise - version: - description: The x.y.z version (also need to specify applicable suffixes like +ent and -dev)' - required: true - type: string - -jobs: - verify-ubuntu-amd64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: docker build with version - run: | - docker build \ - --build-arg PACKAGE=${{ inputs.packageName }} \ - --build-arg VERSION=${{ inputs.version }} \ - --build-arg TARGETARCH=amd64 \ - -f ./build-support/docker/Verify-Release-Ubuntu.dockerfile . - - verify-debian-amd64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: docker build with version - run: | - docker build \ - --build-arg PACKAGE=${{ inputs.packageName }} \ - --build-arg VERSION=${{ inputs.version }} \ - --build-arg TARGETARCH=amd64 \ - -f ./build-support/docker/Verify-Release-Debian.dockerfile . - - verify-fedora: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: docker build with version - run: | - docker build \ - --build-arg PACKAGE=${{ inputs.packageName }} \ - --build-arg VERSION=${{ inputs.version }} \ - -f ./build-support/docker/Verify-Release-Fedora.dockerfile . - - verify-centos: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: docker build with version - run: | - docker build \ - --build-arg PACKAGE=${{ inputs.packageName }} \ - --build-arg VERSION=${{ inputs.version }} \ - -f ./build-support/docker/Verify-Release-CentOS.dockerfile . - - verify-amazon: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - - name: docker build with version - run: | - docker build \ - --build-arg PACKAGE=${{ inputs.packageName }} \ - --build-arg VERSION=${{ inputs.version }} \ - -f ./build-support/docker/Verify-Release-Amazon.dockerfile . diff --git a/agent/consul/leader_connect_ca.go b/agent/consul/leader_connect_ca.go index 8c715588eece3..c8c63c8874aad 100644 --- a/agent/consul/leader_connect_ca.go +++ b/agent/consul/leader_connect_ca.go @@ -735,7 +735,9 @@ func shouldPersistNewRootAndConfig(newActiveRoot *structs.CARoot, oldConfig, new if newConfig == nil { return false } - return newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config) + + // Do not persist if the new provider and config are the same as the old + return !(newConfig.Provider == oldConfig.Provider && reflect.DeepEqual(newConfig.Config, oldConfig.Config)) } func (c *CAManager) UpdateConfiguration(args *structs.CARequest) (reterr error) { diff --git a/build-support/docker/Verify-Release-Amazon.dockerfile b/build-support/docker/Verify-Release-Amazon.dockerfile deleted file mode 100644 index 591b234c3b7cc..0000000000000 --- a/build-support/docker/Verify-Release-Amazon.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM amazonlinux:latest -RUN yum install -y yum-utils shadow-utils -RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-CentOS.dockerfile b/build-support/docker/Verify-Release-CentOS.dockerfile deleted file mode 100644 index a2be67ac776f7..0000000000000 --- a/build-support/docker/Verify-Release-CentOS.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM centos:7 -RUN yum install -y yum-utils -RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX} \ No newline at end of file diff --git a/build-support/docker/Verify-Release-Debian.dockerfile b/build-support/docker/Verify-Release-Debian.dockerfile deleted file mode 100644 index 533890bca43f8..0000000000000 --- a/build-support/docker/Verify-Release-Debian.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM debian:bullseye -RUN apt update && apt install -y software-properties-common curl gnupg -RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - -ARG TARGETARCH=amd64 -RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX} \ No newline at end of file diff --git a/build-support/docker/Verify-Release-Fedora.dockerfile b/build-support/docker/Verify-Release-Fedora.dockerfile deleted file mode 100644 index 601751a911825..0000000000000 --- a/build-support/docker/Verify-Release-Fedora.dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM fedora:latest -RUN dnf install -y dnf-plugins-core -RUN dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN dnf install -y ${PACKAGE}-${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-Ubunt-i386.dockerfile b/build-support/docker/Verify-Release-Ubunt-i386.dockerfile deleted file mode 100644 index 82913b4f7261a..0000000000000 --- a/build-support/docker/Verify-Release-Ubunt-i386.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM i386/ubuntu:latest -RUN apt update && apt install -y software-properties-common curl -RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - -ARG TARGETARCH=amd64 -RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-Ubuntu.dockerfile b/build-support/docker/Verify-Release-Ubuntu.dockerfile deleted file mode 100644 index ddeffc40c5f64..0000000000000 --- a/build-support/docker/Verify-Release-Ubuntu.dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -FROM ubuntu:latest -RUN apt update && apt install -y software-properties-common curl -RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - -ARG TARGETARCH=amd64 -RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" -ARG PACKAGE=consul \ -ARG VERSION \ -ARG SUFFIX=1 -RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX} diff --git a/tlsutil/config.go b/tlsutil/config.go index 5cdaf7633eca5..a52d6b6ad829b 100644 --- a/tlsutil/config.go +++ b/tlsutil/config.go @@ -857,10 +857,23 @@ func (c *Configurator) IncomingHTTPSConfig() *tls.Config { return config } -// OutgoingTLSConfigForCheck generates a *tls.Config for outgoing TLS connections -// for checks. This function is separated because there is an extra flag to -// consider for checks. EnableAgentTLSForChecks and InsecureSkipVerify has to -// be checked for checks. +// OutgoingTLSConfigForCheck creates a client *tls.Config for executing checks. +// It is RECOMMENDED that the serverName be left unspecified. The crypto/tls +// client will deduce the ServerName (for SNI) from the check address unless +// it's an IP (RFC 6066, Section 3). However, there are two instances where +// supplying a serverName is useful: +// +// 1. When the check address is an IP, a serverName can be supplied for SNI. +// Note: setting serverName will also override the hostname used to verify +// the certificate presented by the server being checked. +// +// 2. When the hostname in the check address won't be present in the SAN +// (Subject Alternative Name) field of the certificate presented by the +// server being checked. Note: setting serverName will also override the +// ServerName used for SNI. +// +// Setting skipVerify will disable verification of the server's certificate +// chain and hostname, which is generally not suitable for production use. func (c *Configurator) OutgoingTLSConfigForCheck(skipVerify bool, serverName string) *tls.Config { c.log("OutgoingTLSConfigForCheck") @@ -875,13 +888,9 @@ func (c *Configurator) OutgoingTLSConfigForCheck(skipVerify bool, serverName str } } - if serverName == "" { - serverName = c.serverNameOrNodeName() - } config := c.internalRPCTLSConfig(false) config.InsecureSkipVerify = skipVerify config.ServerName = serverName - return config } diff --git a/tlsutil/config_test.go b/tlsutil/config_test.go index 30ebd62c206b7..721198afe83bf 100644 --- a/tlsutil/config_test.go +++ b/tlsutil/config_test.go @@ -1376,7 +1376,7 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) { }, }, { - name: "agent tls, default server name", + name: "agent tls, default consul server name, no override", conf: func() (*Configurator, error) { return NewConfigurator(Config{ InternalRPC: ProtocolConfig{ @@ -1389,11 +1389,11 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) { }, expected: &tls.Config{ MinVersion: tls.VersionTLS12, - ServerName: "servername", + ServerName: "", }, }, { - name: "agent tls, skip verify, node name for server name", + name: "agent tls, skip verify, consul node name for server name, no override", conf: func() (*Configurator, error) { return NewConfigurator(Config{ InternalRPC: ProtocolConfig{ @@ -1407,7 +1407,7 @@ func TestConfigurator_OutgoingTLSConfigForCheck(t *testing.T) { expected: &tls.Config{ InsecureSkipVerify: true, MinVersion: tls.VersionTLS12, - ServerName: "nodename", + ServerName: "", }, }, { diff --git a/website/content/docs/connect/native/go.mdx b/website/content/docs/connect/native/go.mdx index df9080f17f74d..e3068058fd1eb 100644 --- a/website/content/docs/connect/native/go.mdx +++ b/website/content/docs/connect/native/go.mdx @@ -7,6 +7,13 @@ description: >- # Service Mesh Native Integration for Go Applications + + +The Connect Native golang SDK is currently deprecated and will be removed in a future Consul release. +The SDK will be removed when the long term replacement to native application integration (such as a proxyless gRPC service mesh integration) is delivered. Refer to [GH-10339](https://github.com/hashicorp/consul/issues/10339) for additional information and to track progress toward one potential solution that is tracked as replacement functionality. + + + We provide a library that makes it drop-in simple to integrate Consul service mesh with most [Go](https://golang.org/) applications. This page shows examples of integrating this library for accepting or establishing mesh-based diff --git a/website/content/docs/connect/native/index.mdx b/website/content/docs/connect/native/index.mdx index e8cc421af8ac4..3cf64f346c2e6 100644 --- a/website/content/docs/connect/native/index.mdx +++ b/website/content/docs/connect/native/index.mdx @@ -7,10 +7,17 @@ description: >- # Service Mesh Native App Integration Overview -~> **Note:** The Native App Integration does not support many of the Consul's service -mesh features, and is not under active development. -The [Envoy proxy](/consul/docs/connect/proxies/envoy) should be used for most production -environments. + + +The Connect Native Golang SDK and `v1/agent/connect/authorize`, `v1/agent/connect/ca/leaf`, +and `v1/agent/connect/ca/roots` APIs are deprecated and will be removed in a future release. Although Connect Native +will still operate as designed, we do not recommend leveraging this feature because it is deprecated and will be removed +removed when the long term replacement to native application integration (such as a proxyless gRPC service mesh integration) is delivered. Refer to [GH-10339](https://github.com/hashicorp/consul/issues/10339) for additional information and to track progress toward one potential solution that is tracked as replacement functionality. + +The Native App Integration does not support many of the Consul's service mesh features, and is not under active development. +The [Envoy proxy](/consul/docs/connect/proxies/envoy) should be used for most production environments. + + Applications can natively integrate with Consul's service mesh API to support accepting and establishing connections to other mesh services without the overhead of a diff --git a/website/content/docs/connect/proxies/integrate.mdx b/website/content/docs/connect/proxies/integrate.mdx index 1ad9f4b911566..d00e01d1bd774 100644 --- a/website/content/docs/connect/proxies/integrate.mdx +++ b/website/content/docs/connect/proxies/integrate.mdx @@ -7,6 +7,17 @@ description: >- # Custom Proxy Configuration for Service Mesh + + + The Connect Native Golang SDK and `v1/agent/connect/authorize`, `v1/agent/connect/ca/leaf`, + and `v1/agent/connect/ca/roots` APIs are deprecated and will be removed in a future release. Although Connect Native + will still operate as designed, we do not recommend leveraging this feature because it is deprecated and will be removed when the long term replacement to native application integration (such as a proxyless gRPC service mesh integration) is delivered. Refer to [GH-10339](https://github.com/hashicorp/consul/issues/10339) for additional information and to track progress toward one potential solution that is tracked as replacement functionality. + + The Native App Integration does not support many of the Consul's service mesh features, and is not under active development. + The [Envoy proxy](/consul/docs/connect/proxies/envoy) should be used for most production environments. + + + This topic describes the process and API endpoints you can use to extend proxies for integration with Consul. ## Overview diff --git a/website/content/docs/release-notes/consul/v1_16_x.mdx b/website/content/docs/release-notes/consul/v1_16_x.mdx index 33241b6b84545..616104a7094f2 100644 --- a/website/content/docs/release-notes/consul/v1_16_x.mdx +++ b/website/content/docs/release-notes/consul/v1_16_x.mdx @@ -51,6 +51,15 @@ We are pleased to announce the following Consul updates. Consul's API gateway is the recommended alternative to ingress gateway. For ingress gateway features not currently supported by API gateway, equivalent functionality will be added to API gateway over the next several releases of Consul. +- **Connect Native Golang SDK:** The Connect Native [Golang SDK](https://github.com/hashicorp/consul/tree/main/connect) is deprecated and will be removed in a future release. No further enhancements or maintenance is expected in the future releases. We will remove the SDK when the long term replacement to native application integration (such as a proxyless gRPC service mesh integration) is delivered. Refer to [GH-10339](https://github.com/hashicorp/consul/issues/10339) for additional information and to track progress toward one potential solution that is tracked as replacement functionality. + +- **Connect Native APIs:** The following APIs for Connect Native are deprecated: + - `v1/agent/connect/authorize` - used by the SDK to perform intention based authorization checks + - `v1/agent/connect/ca/leaf` - used by the SDK to get a leaf cert for a locally registered service + - `v1/agent/connect/ca/roots` - use to retrieved cached CA roots form the local client agent + + The `v1/agent/connect/authorize` and `v1/agent/connect/ca/leaf` endpoints have corresponding gRPC APIs. We will remove these APIs when the gRPC API for `v1/agent/connect/ca/roots` and HTTP endpoints for all three APIs are available. + ## Upgrading For more detailed information, please refer to the [upgrade details page](/consul/docs/upgrading/upgrade-specific) and the changelogs. @@ -61,4 +70,4 @@ The changelogs for this major release version and any maintenance versions are l These links take you to the changelogs on the GitHub website. -- [1.16.0](https://github.com/hashicorp/consul/releases/tag/v1.16.0) \ No newline at end of file +- [1.16.0](https://github.com/hashicorp/consul/releases/tag/v1.16.0) diff --git a/website/content/docs/services/configuration/checks-configuration-reference.mdx b/website/content/docs/services/configuration/checks-configuration-reference.mdx index fee071de51b0a..c0d3e24cfde6b 100644 --- a/website/content/docs/services/configuration/checks-configuration-reference.mdx +++ b/website/content/docs/services/configuration/checks-configuration-reference.mdx @@ -35,8 +35,8 @@ Specify health check options in the `check` block. To register two or more heath | `h2ping` | String value that specifies the HTTP2 endpoint, including port number, to send HTTP2 requests to. |
  • H2ping
  • | | `h2ping_use_tls` | Boolean value that enables TLS for H2ping checks when set to `true`. |
  • H2ping
  • | | `http` | String value that specifies an HTTP endpoint to send requests to. |
  • HTTP
  • | -| `tls_server_name` | String value that specifies the name of the TLS server that issues certificates. Defaults to the SNI determined by the address specified in the `http` field. Set the `tls_skip_verify` to `false` to disable this field. |
  • HTTP
  • | -| `tls_skip_verify` | Boolean value that disbles TLS for HTTP checks when set to `true`. Default is `false`. |
  • HTTP
  • | +| `tls_server_name` | String value that specifies the server name used to verify the hostname on the returned certificates unless `tls_skip_verify` is given. Also included in the client's handshake to support SNI. It is recommended that this field be left unspecified. The TLS client will deduce the server name for SNI from the check address unless it's an IP ([RFC 6066, Section 3](https://tools.ietf.org/html/rfc6066#section-3)). There are two common circumstances where supplying a `tls_server_name` can be beneficial:
  • When the check address is an IP, `tls_server_name` can be specified for SNI. Note: setting `tls_server_name` will also override the hostname used to verify the certificate presented by the server being checked.
  • When the hostname in the check address won't be present in the SAN (Subject Alternative Name) field of the certificate presented by the server being checked. Note: setting `tls_server_name` will also override the hostname used for SNI.
  • |
  • HTTP
  • H2Ping
  • gRPC
  • | +| `tls_skip_verify` | Boolean value that determines if the check verifies the chain and hostname of the certificate that the server presents. Set to `true` to disable verification. We recommend setting to `false` for production use. Default is `false`. |
  • HTTP
  • H2Ping
  • gRPC
  • | | `method` | String value that specifies the request method to send during HTTP checks. Default is `GET`. |
  • HTTP
  • | | `header` | Object that specifies header fields to send in HTTP check requests. Each header specified in `header` object contains a list of string values. |
  • HTTP
  • | | `body` | String value that contains JSON attributes to send in HTTP check requests. You must escap the quotation marks around the keys and values for each attribute. |
  • HTTP
  • |