2223 Commits

Author SHA1 Message Date
freddygv
283b989ba5 Validate SANs for failovers 2021-07-14 23:41:33 -06:00
freddygv
752f5ff961 Validate Subject Alternative Name for upstreams
These changes ensure that the identity of services dialed is
cryptographically verified.

For all upstreams we validate against SPIFFE IDs in the format used by
Consul's service mesh:

spiffe://<trust-domain>/ns/<namespace>/dc/<datacenter>/svc/<service>
2021-07-14 23:41:19 -06:00
Dhia Ayachi
e9a4aa8f76
Format certificates properly (rfc7468) with a trailing new line (#10411) (#10556)
* Format certificates properly (rfc7468) with a trailing new line (#10411)

* trim carriage return from certificates when inserting rootCA in the inMemDB

* format rootCA properly when returning the CA on the connect CA endpoint

* Fix linter warnings

* Fix providers to trim certs before returning it

* trim newlines on write when possible

* add changelog

* make sure all provider return a trailing newline after the root and intermediate certs

* Fix endpoint to return trailing new line

* Fix failing test with vault provider

* make test more robust

* make sure all provider return a trailing newline after the leaf certs

* Check for suffix before removing newline and use function

* Add comment to consul provider

* Update change log

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* fix typo

* simplify code callflow

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>

* extract requireNewLine as shared func

* remove dependency to testify in testing file

* remove extra newline in vault provider

* Add cert newline fix to envoy xds

* remove new line from mock provider

* Remove adding a new line from provider and fix it when the cert is read

* Add a comment to explain the fix

* Add missing for leaf certs

* fix missing new line

* fix missing new line in leaf certs

* remove extra new line in test

* updage changelog

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>

* fix in vault provider and when reading cache (RPC call)

* fix AWS provider

* fix failing test in the provider

* remove comments and empty lines

* add check for empty cert in test

* fix linter warnings

* add new line for leaf and private key

* use string concat instead of Sprintf

* fix new lines for leaf signing

* preallocate slice and remove append

* Add new line to `SignIntermediate` and `CrossSignCA`

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>

* fix compilation error

* fix failing test

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>
2021-07-06 12:40:39 -04:00
hc-github-team-consul-core
c2149cd343
update bindata_assetfs.go 2021-06-21 21:35:37 +00:00
Matt Keeler
116b0ebc46
Add ability to load a license from the configuration/environment (#10442)
This is mainly for forwards compatibility with 1.10 and should not be relied on for a cluster staying on a 1.8.x/1.9.x version.
2021-06-21 16:38:21 -04:00
Matt Keeler
3609d903af
Hold onto the token store from the base deps in the Client (#10432) (#10433)
This is needed in order to access the agent token in some enterprise code.
2021-06-18 17:07:06 -04:00
Dhia Ayachi
658ea0eef8 improve monitor performance (#10368)
* remove flush for each write to http response in the agent monitor endpoint

* fix race condition when we stop and start monitor multiple times, the doneCh is closed and never recover.

* start log reading goroutine before adding the sink to avoid filling the log channel before getting a chance of reading from it

* flush every 500ms to optimize log writing in the http server side.

* add changelog file

* add issue url to changelog

* fix changelog url

* Update changelog

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>

* use ticker to flush and avoid race condition when flushing in a different goroutine

* stop the ticker when done

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>

* Revert "fix race condition when we stop and start monitor multiple times, the doneCh is closed and never recover."

This reverts commit 1eeddf7a

* wait for log consumer loop to start before registering the sink

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>
2021-06-15 16:23:29 +00:00
hc-github-team-consul-core
04e19838a9
update bindata_assetfs.go 2021-06-04 02:02:10 +00:00
hc-github-team-consul-core
10cf54e7a6 Merge branch 'release/1.8.11' into remote-x 2021-06-03 20:51:46 +00:00
hc-github-team-consul-core
3c4cea9158
update bindata_assetfs.go 2021-06-03 19:57:32 +00:00
Mike Morris
ea6d6dd2ee Revert "Revert "Merge pull request #10277 from hashicorp/dnephin/backport-serf-tag-refactor""
This reverts commit 442a8efc7fc7eb0121e27339e5322efef5ea6418.
2021-06-03 14:24:30 -04:00
Daniel Nephin
ee250d3113 Merge pull request #10321 from hashicorp/dnephin/backport-debug-cli-fix
[1.9.x] debug: remove the CLI check for debug_enabled
2021-05-31 20:10:45 +00:00
hc-github-team-consul-core
2195429f32
update bindata_assetfs.go 2021-05-26 02:18:23 +00:00
Mike Morris
442a8efc7f Revert "Merge pull request #10277 from hashicorp/dnephin/backport-serf-tag-refactor"
This reverts commit f45ab674ceae1c0cb19b9ca0a8d36d38b59b34db, reversing
changes made to 985ca60d352ba14c274ba388fd9af191fab68263.
2021-05-25 21:15:19 -04:00
Daniel Nephin
4bd66e0348 Merge pull request #10272 from hashicorp/dnephin/backport-namespace-license-fix
Backport some ent changes for serf tags
2021-05-21 12:54:51 -04:00
hc-github-team-consul-core
985ca60d35 Merge branch 'release/1.8.11-beta1' into remote-x 2021-05-18 20:55:05 +00:00
hc-github-team-consul-core
4b23e123ab
update bindata_assetfs.go 2021-05-18 20:19:37 +00:00
Daniel Nephin
ee992f788d Merge pull request #8812 from jjshanks/GH-8728
GH-8728 add raft default values
2021-05-18 19:33:17 +00:00
R.B. Boyer
2f9c448801 server: ensure that central service config flattening properly resets the state each time (#10245)
The prior solution to call reply.Reset() aged poorly since newer fields
were added to the reply, but not added to Reset() leading serial
blocking query loops on the server to blend replies.

This could manifest as a service-defaults protocol change from
default=>http not reverting back to default after the config entry
reponsible was deleted.

Backport of #10239 to 1.9.x
2021-05-14 18:25:37 +00:00
R.B. Boyer
63d03e3b6a agent: ensure we hash the non-deprecated upstream fields on ServiceConfigRequest (#10240) (#10244)
Backport of #10240 to 1.9.x
2021-05-14 15:49:55 +00:00
Daniel Nephin
ea6600dacc Merge pull request #10218 from hashicorp/dnephin/backport-local-agent-fix
[1.9.x] agent/local: do not persist the agent or user token
2021-05-12 17:20:07 +00:00
Daniel Nephin
f8d33b36fd local: default to the agent token instead of the user token
When de-registering in anti-entropy sync, when there is no service or
check token.

The agent token will fall back to the default (aka user) token if no agent
token is set, so the existing behaviour still works, but it will prefer
the agent token over the user token if both are set.

ref: https://www.consul.io/docs/agent/options#acl_tokens

The agent token seems more approrpiate in this case, since this is an
"internal operation", not something initiated by the user.
2021-05-04 14:45:31 -04:00
R.B. Boyer
55600be4a9
[1.8.x] connect: update supported envoy versions to 1.14.7, 1.13.7, 1.12.7, 1.11.2 (#10106) 2021-04-29 15:56:24 -05:00
Matt Keeler
835d3d4258 Add replication metrics (#10073)
# Conflicts:
#	agent/consul/replication.go
2021-04-23 16:18:08 -04:00
Kyle Havlovitz
658e6a97bb Merge pull request #9672 from hashicorp/ca-force-skip-xc
connect/ca: Allow ForceWithoutCrossSigning for all providers
2021-04-20 15:41:32 -05:00
hashicorp-ci
201e25ed70
update bindata_assetfs.go 2021-04-15 18:15:39 +00:00
Kent 'picat' Gruber
447dd528f6 Merge pull request #10023 from hashicorp/fix-raw-kv-xss
Add content type headers to raw KV responses
2021-04-15 09:48:14 -04:00
R.B. Boyer
cbf1e5d3e9
Merge pull request #10026 from hashicorp/1.8.x-fix-wan-ipv6-key
[1.8.x] Fix advertise_addr_wan_ipv6 configuration key
2021-04-14 16:53:04 -05:00
Daniel Nephin
1cc59bd0cf Merge pull request #9851 from panascais-forks/fix-wan-ipv6-key
Fix advertise_addr_wan_ipv6 configuration key
2021-04-14 16:29:28 -05:00
Daniel Nephin
168e8da213 Merge pull request #10025 from hashicorp/dnephin/fix-snapshot-auth-methods
snapshot: fix saving of auth methods
2021-04-14 17:25:13 -04:00
Matt Keeler
46de6ba9ca
Backport 10013: Move static token resolution into the ACLResolver (#10013) (#10017)
# Conflicts:
#	agent/acl.go
#	agent/acl_test.go
#	agent/agent.go
#	agent/ui_endpoint.go
2021-04-14 13:04:32 -04:00
Hans Hasselberg
0d0f14f901 introduce certopts (#9606)
* introduce cert opts

* it should be using the same signer

* lint and omit serial
2021-03-22 09:17:23 +00:00
hashicorp-ci
1f92b6cb84
update bindata_assetfs.go 2021-03-04 19:22:47 +00:00
John Cowen
24981a6c68 ui: Remove any trailing fullstop/period DNS characters from Gateways UI API (#9752)
Previous to this commit, the API response would include Gateway
Addresses in the form `domain.name.:8080`, which due to the addition of
the port is probably not the expected response.

This commit rightTrims any `.` characters from the end of the domain
before formatting the address to include the port resulting in
`domain.name:8080`
2021-02-25 09:36:43 +00:00
R.B. Boyer
76795ae6d6
test: omit envoy golden test files that differ from the latest version (#9824)
backport of #9807 to 1.8.x
2021-02-24 15:49:32 -06:00
R.B. Boyer
46edc401ad connect: if the token given to the vault provider returns no data avoid a panic (#9806)
Improves #9800
2021-02-22 20:09:25 +00:00
R.B. Boyer
40987a2b69
xds: only try to create an ipv6 expose checks listener if ipv6 is supported by the kernel (#9794)
1.8.x backport of #9765

Conflicts:
- agent/xds/listeners_test.go
- test/integration/connect/envoy/helpers.bash
- agent/xds/testdata (different envoy versions)
2021-02-22 10:45:40 -06:00
hashicorp-ci
b18269d20a
update bindata_assetfs.go 2021-02-11 19:00:47 +00:00
R.B. Boyer
22640c9e87
[1.8.x] connect: update supported envoy point releases to 1.14.6, 1.13.7, 1.12.7, 1.11.2 (#9739)
selective backport of #9737
2021-02-10 13:11:51 -06:00
R.B. Boyer
415be133fa
connect: connect CA Roots in the primary datacenter should use a SigningKeyID derived from their local intermediate (#9428) (#9734)
1.8.x backport of #9428
2021-02-09 16:55:22 -06:00
Matt Keeler
5b543790d2
Backport to release/1.8.x: #9738 - Stop background refresh of cached data for requests that result in ACL not found errors (#9742) 2021-02-09 11:32:38 -05:00
Freddy
c18a218bbb Avoid potential proxycfg/xDS deadlock using non-blocking send 2021-02-08 23:18:38 +00:00
R.B. Boyer
556b8bd1c2 server: use the presense of stored federation state data as a sign that we already activated the federation state feature flag (#9519)
This way we only have to wait for the serf barrier to pass once before
we can make use of federation state APIs Without this patch every
restart needs to re-compute the change.
2021-02-08 19:30:58 +00:00
R.B. Boyer
eed2302b43 xds: prevent LDS flaps in mesh gateways due to unstable datacenter lists (#9651)
Also fix a similar issue in Terminating Gateways that was masked by an overzealous test.
2021-02-08 16:20:37 +00:00
R.B. Boyer
bb5c2e802b xds: deduplicate mesh gateway listeners in a stable way (#9650)
In a situation where the mesh gateway is configured to bind to multiple
network interfaces, we use a feature called 'tagged addresses'.
Sometimes an address is duplicated across multiple tags such as 'lan'
and 'lan_ipv4'.

There is code to deduplicate these things when creating envoy listeners,
but that code doesn't ensure that the same tag wins every time. If the
winning tag flaps between xDS discovery requests it will cause the
listener to be drained and replaced.
2021-02-05 22:28:57 +00:00
Hans Hasselberg
e6584182f2 Add flags to support CA generation for Connect (#9585) 2021-01-27 07:55:31 +00:00
R.B. Boyer
685c38a1b1 server: initialize mgw-wanfed to use local gateways more on startup (#9528)
Fixes #9342
2021-01-25 23:31:28 +00:00
hashicorp-ci
dd110e8c74 Merge branch 'release/1.8.8' into remote-x 2021-01-22 20:17:04 +00:00
hashicorp-ci
e2f9307430
update bindata_assetfs.go 2021-01-22 18:50:02 +00:00
R.B. Boyer
f135c3b64e server: when wan federating via mesh gateways only do heuristic primary DC bypass on the leader (#9366)
Fixes #9341
2021-01-22 16:07:11 +00:00