Commit Graph

5348 Commits (34457b3a7c48f892fa6d8bc23abf02af5119a433)

Author SHA1 Message Date
hc-github-team-consul-core 9069ca6c76
Backport of [NET-8367] security: upgrade google.golang.org/protobuf to 1.33.0 into release/1.17.x (#20805)
* backport of commit a407616755

* backport of commit 455f67fa57

---------

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2024-03-06 23:57:53 +00:00
hc-github-team-consul-core f8f33268ce
Backport of Use correct enterprise meta on wildcard service update into release/1.17.x (#20728)
* backport of commit 94a0aa2ea7

* backport of commit f0e1badd6f

* backport of commit 183dd2fb12

---------

Co-authored-by: Sarah Alsmiller <sarah.alsmiller@hashicorp.com>
2024-02-26 12:40:15 -06:00
hc-github-team-consul-core 8bc8b8bb0a
Backport of NET-7813 - DNS : SERVFAIL when resolving PTR records into release/1.17.x (#20689)
NET-7813 - DNS : SERVFAIL when resolving PTR records

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-02-21 18:47:45 +00:00
hc-github-team-consul-core 0bfa43b191
Backport of Decouple xds capacity controller and raft-autopilot into release/1.17.x (#20550)
* backport of commit 1668a314c6

* backport of commit d33eda97be

* Backport DeliverLatest func.

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-09 08:01:53 -06:00
hc-github-team-consul-core 097c08d18d
Backport of Fix audit-log encoding issue (CC-7337) into release/1.17.x (#20499)
Fix audit-log encoding issue (CC-7337) (#20345)

* add changes

* added changelog

* change update

* CE chnages

* Removed gzip size fix

* fix changelog

* Update .changelog/20345.txt



* Adding comments

---------

Co-authored-by: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com>
Co-authored-by: Abhishek Sahu <abhishek.sahu@hashicorp.com>
Co-authored-by: Hans Hasselberg <hans@hashicorp.com>
Co-authored-by: srahul3 <rahulsharma@hashicorp.com>
2024-02-06 11:55:40 +00:00
hc-github-team-consul-core 017ced4e8e
Backport of Fix issue with persisting proxy-defaults into release/1.17.x (#20488)
* backport of commit b5c6c1da83

* backport of commit 1b7dbd7eea

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-02-05 16:27:53 -06:00
Chris S. Kim 0a56927902
[1.17.x] Skip filter chain created by permissive mtls (#20429) 2024-02-05 09:41:15 -05:00
hc-github-team-consul-core 4d180cad14
Backport of Fix SAN matching on terminating gateways into release/1.17.x (#20419)
Fix SAN matching on terminating gateways (#20417)

Fixes issue: hashicorp/consul#20360

A regression was introduced in hashicorp/consul#19954 where the SAN validation
matching was reduced from 4 potential types down to just the URI.

Terminating gateways will need to match on many fields depending on user
configuration, since they make egress calls outside of the cluster. Having more
than one matcher behaves like an OR operation, where any match is sufficient to
pass the certificate validation. To maintain backwards compatibility with the
old untyped `match_subject_alt_names` Envoy behavior, we should match on all 4
enum types.

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/transport_sockets/tls/v3/common.proto#enum-extensions-transport-sockets-tls-v3-subjectaltnamematcher-santype

Co-authored-by: Derek Menteer <105233703+hashi-derek@users.noreply.github.com>
2024-01-31 13:01:19 -06:00
Luke Kysow f180183642
Change logging of registered v2 resource endpoints to add /api prefix (#20355)
Change logging of registered v2 resource endpoints to add /api prefix (#20352)

* Change logging of registered v2 resource endpoints to add /api prefix

Previous:

    agent.http: Registered resource endpoint: endpoint=/demo/v1/executive

New:

    agent.http: Registered resource endpoint: endpoint=/api/demo/v1/executive

This reduces confusion when attempting to call the APIs after looking at
the logs.
2024-01-25 14:57:38 -08:00
Tauhid Anjum a7362db204
Backport of NET-5824 Exported services api (#20015) (#20315)
NET-5824 Exported services api (#20015)

* Exported services api implemented

* Tests added, refactored code

* Adding server tests

* changelog added

* Proto gen added

* Adding codegen changes

* changing url, response object

* Fixing lint error by having namespace and partition directly

* Tests changes

* refactoring tests

* Simplified uniqueness logic for exported services, sorted the response in order of service name

* Fix lint errors, refactored code
2024-01-23 14:43:52 +05:30
hc-github-team-consul-core 1c7e9443cb
Backport of Case sensitive route match into release/1.17.x (#20305)
backport of commit 1b458c4883

Co-authored-by: Lord-Y <Lord-Y@users.noreply.github.com>
2024-01-22 10:02:21 -06:00
hc-github-team-consul-core 993f2d21c0
Backport of Fix to not create a watch to `Internal.ServiceDump` when mesh gateway is not used into release/1.17.x (#20268)
This add a fix to properly verify the gateway mode before creating a watch specific to mesh gateways. This watch have a high performance cost and when mesh gateways are not used is not used.

This also adds an optimization to only return the nodes when watching the Internal.ServiceDump RPC to avoid unnecessary disco chain compilation. As watches in proxy config only need the nodes.

* backport of commit b0ce20b5e2
* backport of commit 3d4bde00cf
* backport of commit b2c77246b9
* backport of commit e7ab4d418d
* backport of commit d00d9c5da4
* backport of commit b2db3d5eb4
* backport of commit 50fb45ac74
* backport of commit 7b41a61c17
* backport of commit 2fa0e0a629
* backport of commit 88849c9030
* backport of commit 4ac54f10bc
* backport of commit 2a9dfc37f2

---------

Co-authored-by: Dhia Ayachi <dhia@hashicorp.com>
2024-01-19 08:17:22 -06:00
hc-github-team-consul-core 0e7c7e24ed
Backport of check error in TestDNSCycleRecursorCheckAllFail before asserting response to stop panic in CI. into release/1.17.x (#20235)
* no-op commit due to failed cherry-picking

* check error in TestDNSCycleRecursorCheckAllFail before asserting response to stop panic in CI. (#20231)

---------

Co-authored-by: temp <temp@hashicorp.com>
Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-01-17 17:11:54 +00:00
hc-github-team-consul-core 5d350c6827
Backport of agent: remove data race in agent config into release/1.17.x (#20203)
backport of commit 6aa99b32e8
2024-01-16 11:10:56 -06:00
hc-github-team-consul-core 0d97ec54e5
Backport of Various race condition and test fixes. into release/1.17.x (#20216)
* backport of commit fead597130

* backport of commit 91dfaad67b

* backport of commit dc04075010

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-01-16 10:42:59 -06:00
hc-github-team-consul-core 55b388b3a5
Backport of [NET-6593] agent: check for minimum RSA key size into release/1.17.x (#20142)
* backport of commit 0e36f636a4

* manual backport

---------

Co-authored-by: Dan Bond <danbond@protonmail.com>
2024-01-10 13:21:43 +00:00
hc-github-team-consul-core 14928687bc
Backport of Fix broken tests. into release/1.17.x (#20133)
* backport of commit 7a91738824

* Fix broken test.

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2024-01-09 14:35:02 -06:00
hc-github-team-consul-core ab2666afb7
Backport of Use safeio to write server metadata file into release/1.17.x (#20106)
* backport of commit 0956e061b6

* backport of commit ed9709a578

---------

Co-authored-by: cskh <hui.kang@hashicorp.com>
2024-01-05 15:16:14 -05:00
hc-github-team-consul-core 833f3e2396
Backport of NET-4774 - replace usage of deprecated Envoy field match_subject_alt_names into release/1.17.x (#20057)
NET-4774 - replace usage of deprecated Envoy field match_subject_alt_names (#19954)

Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-01-02 19:13:16 +00:00
hc-github-team-consul-core 4e1e51904b
Backport of NET-6943 - Replace usage of deprecated Envoy field envoy.config.router.v3.WeightedCluster.total_weight. into release/1.17.x (#20061)
* no-op commit due to failed cherry-picking

* NET-6943 - Replace usage of deprecated Envoy field envoy.config.router.v3.WeightedCluster.total_weight. (#20011)

---------

Co-authored-by: temp <temp@hashicorp.com>
Co-authored-by: John Murret <john.murret@hashicorp.com>
2024-01-02 17:31:51 +00:00
John Murret 59da5e792f
Backport into 1.17 of NET-6944 - Replace usage of deprecated Envoy field envoy.extensions.filters.http.lua.v3.Lua.inline_code (#20054)
NET-6944 - Replace usage of deprecated Envoy field envoy.extensions.filters.http.lua.v3.Lua.inline_code (#20012)
2023-12-22 18:00:58 +00:00
hc-github-team-consul-core 03c94a7cf0
Backport of agent: prevent empty server_metadata.json into release/1.17.x (#19997)
backport of commit 9fc0fc3dcc

Co-authored-by: cskh <hui.kang@hashicorp.com>
2023-12-21 10:05:17 -05:00
hc-github-team-consul-core ad4851c973
Backport of Fix bug with prepared queries using sameness-groups. into release/1.17.x (#19972)
backport of commit 21bde38517

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-12-15 13:17:08 -06:00
hc-github-team-consul-core c4caa3147d
Backport of Hash based config entry replication into release/1.17.x (#19916)
add hash based config entry replication

Co-authored-by: Dhia Ayachi <dhia@hashicorp.com>
2023-12-12 13:36:07 -05:00
hc-github-team-consul-core 6c6d978634
Backport of Remove warning for consul 1.17 deprecation into release/1.17.x (#19905)
backport of commit 8d43647ed9

Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
2023-12-12 10:05:45 -05:00
Derek Menteer 212485578c
Backport of: Fix ClusterLoadAssignment timeouts dropping endpoints. into 1.17 (#19884)
Fix ClusterLoadAssignment timeouts dropping endpoints.

When a large number of upstreams are configured on a single envoy
proxy, there was a chance that it would timeout when waiting for
ClusterLoadAssignments. While this doesn't always immediately cause
issues, consul-dataplane instances appear to consistently drop
endpoints from their configurations after an xDS connection is
re-established (the server dies, random disconnect, etc).

This commit adds an `xds_fetch_timeout_ms` config to service registrations
so that users can set the value higher for large instances that have
many upstreams. The timeout can be disabled by setting a value of `0`.

This configuration was introduced to reduce the risk of causing a
breaking change for users if there is ever a scenario where endpoints
would never be received. Rather than just always blocking indefinitely
or for a significantly longer period of time, this config will affect
only the service instance associated with it.
2023-12-11 10:02:33 -06:00
hc-github-team-consul-core f80fc2b548
Backport of Fix xDS missing endpoint race condition. into release/1.17.x (#19874)
backport of commit 7d8764dc0e

Co-authored-by: Keith Smiley <ksmiley@salesforce.com>
Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-12-08 11:59:21 -06:00
Andrew Stucki 880713a10b
[Backport 1.17.x] Add CE version of Gateway Upstream Disambiguation (#19868)
* Add CE version of Gateway Upstream Disambiguation

* Add range variable shadow

---------

Co-authored-by: Thomas Eckert <teckert@hashicorp.com>
2023-12-08 17:00:14 +00:00
hc-github-team-consul-core a34009b7c1
Backport of parse config protocol on write to optimize disco-chain compilation into release/1.17.x (#19859)
* parse config protocol on write to optimize disco-chain compilation (#19829)

* parse config protocol on write to optimize disco-chain compilation

* add changelog

* add test fixes from PR

* adding missing config field

---------

Co-authored-by: Dhia Ayachi <dhia@hashicorp.com>
2023-12-07 15:35:26 -05:00
hc-github-team-consul-core 1a5ace03f0
Backport of improve client RPC metrics consistency into release/1.17.x (#19843)
* backport of commit 06507fe053

* backport of commit 14e160573d

* backport of commit 088ec70f90

---------

Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
2023-12-06 14:06:17 -05:00
hc-github-team-consul-core b1acee8f94
Backport of [NET-6251] Nomad client templated policy into release/1.17.x (#19839)
backport of commit 9a8d0c848b

Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
2023-12-06 11:18:33 -05:00
lornasong 81a22ae9b6
Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810)
* [Cloud][CC-6925] Updates to pushing server state (#19682)

* Upgrade hcp-sdk-go to latest version v0.73

Changes:
- go get github.com/hashicorp/hcp-sdk-go
- go mod tidy

* From upgrade: regenerate protobufs for upgrade from 1.30 to 1.31

Ran: `make proto`

Slack: https://hashicorp.slack.com/archives/C0253EQ5B40/p1701105418579429

* From upgrade: fix mock interface implementation

After upgrading, there is the following compile error:

cannot use &mockHCPCfg{} (value of type *mockHCPCfg) as "github.com/hashicorp/hcp-sdk-go/config".HCPConfig value in return statement: *mockHCPCfg does not implement "github.com/hashicorp/hcp-sdk-go/config".HCPConfig (missing method Logout)

Solution: update the mock to have the missing Logout method

* From upgrade: Lint: remove usage of deprecated req.ServerState.TLS

Due to upgrade, linting is erroring due to usage of a newly deprecated field

22:47:56 [consul]: make lint
--> Running golangci-lint (.)
agent/hcp/testing.go:157:24: SA1019: req.ServerState.TLS is deprecated: use server_tls.internal_rpc instead. (staticcheck)
                time.Until(time.Time(req.ServerState.TLS.CertExpiry)).Hours()/24,
                                     ^

* From upgrade: adjust oidc error message

From the upgrade, this test started failing:

=== FAIL: internal/go-sso/oidcauth TestOIDC_ClaimsFromAuthCode/failed_code_exchange (re-run 2) (0.01s)
    oidc_test.go:393: unexpected error: Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

Prior to the upgrade, the error returned was:
```
Provider login failed: Error exchanging oidc code: oauth2: cannot fetch token: 401 Unauthorized\nResponse: {\"error\":\"invalid_grant\",\"error_description\":\"unexpected auth code\"}\n
```

Now the error returned is as below and does not contain "cannot fetch token"
```
Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

```

* Update AgentPushServerState structs with new fields

HCP-side changes for the new fields are in:
https://github.com/hashicorp/cloud-global-network-manager-service/pull/1195/files

* Minor refactor for hcpServerStatus to abstract tlsInfo into struct

This will make it easier to set the same tls-info information to both
 - status.TLS (deprecated field)
 - status.ServerTLSMetadata (new field to use instead)

* Update hcpServerStatus to parse out information for new fields

Changes:
 - Improve error message and handling (encountered some issues and was confused)
 - Set new field TLSInfo.CertIssuer
 - Collect certificate authority metadata and set on TLSInfo.CertificateAuthorities
 - Set TLSInfo on both server.TLS and server.ServerTLSMetadata.InternalRPC

* Update serverStatusToHCP to convert new fields to GNM rpc

* Add changelog

* Feedback: connect.ParseCert, caCerts

* Feedback: refactor and unit test server status

* Feedback: test to use expected struct

* Feedback: certificate with intermediate

* Feedback: catch no leaf, remove expectedErr

* Feedback: update todos with jira ticket

* Feedback: mock tlsConfigurator

* make proto for additional file in 1.17 not in main
2023-12-04 15:34:24 -05:00
John Maguire 71e2a0c986
[NET-5688] APIGateway UI Topology Fixes (#19657) (#19765)
* [NET-5688] APIGateway UI Topology Fixes (#19657)

* Update catalog and ui endpoints to show APIGateway in gateway service
topology view

* Added initial implementation for service view

* updated ui

* Fix topology view for gateways

* Adding tests for gw controller

* remove unused args

* Undo formatting changes

* Fix call sites for upstream/downstream gw changes

* Add config entry tests

* Fix function calls again

* Move from ServiceKey to ServiceName, cleanup from PR review

* Add additional check for length of services in bound apigateway for
IsSame comparison

* fix formatting for proto

* gofmt

* Add DeepCopy for retrieved BoundAPIGateway

* gofmt

* gofmt

* Rename function to be more consistent

* updated ui assets
2023-11-29 11:23:52 -05:00
hc-github-team-consul-core 6ff06bd08d
Backport of [NET-6249] Add templated policies description into release/1.17.x (#19736)
backport of commit 5cf44bea20

Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
2023-11-27 16:43:14 -05:00
hc-github-team-consul-core d974bf4028
Backport of NET-6251 API gateway templated policy into release/1.17.x (#19729)
backport of commit c4408eaae1

Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
2023-11-24 13:40:58 -05:00
hc-github-team-consul-core 92d7d692a6
Backport of [NET-6103] Enable query tokens by service name using templated policy into release/1.17.x (#19668)
backport of commit 9f2b068696

Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
2023-11-16 19:49:39 +00:00
hc-github-team-consul-core c4ca97f65b
Backport of Fix more test flakes into release/1.17.x (#19546)
* backport of commit 5cb614ed73

* backport of commit 13c10a19b1

---------

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-11-07 16:38:37 +00:00
hc-github-team-consul-core 2f0d638fa4
Backport of [NET-6459] Fix issue with wanfed lan ip conflicts. into release/1.17.x (#19523)
backport of commit a47995f72d

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-11-06 15:07:14 +00:00
hc-github-team-consul-core 3e0240caba
Backport of [NET-5916] Fix locality-aware routing config and tests (CE) into release/1.17.x (#19491)
backport of commit c0203fbcb5

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-11-03 17:06:57 -05:00
hc-github-team-consul-core 9f85516e7d
Backport of NET-6294 - v1 Agentless proxycfg datasource errors after v2 changes into release/1.17.x (#19416)
backport of commit fa50df4b2d

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-10-27 21:04:20 +00:00
hc-github-team-consul-core b7055a096e
Backport of Use strict DNS for mesh gateways with hostnames into release/1.17.x (#19396)
* backport of commit e9eabcb3b3

* backport of commit 013de0bce9

---------

Co-authored-by: Andrew Stucki <andrew.stucki@hashicorp.com>
2023-10-26 20:28:45 +00:00
hc-github-team-consul-core 54ee2b633e
Backport of Add clarification for route match behavior into release/1.17.x (#19368)
* backport of commit dba8d6721e

* backport of commit 436cc19464

---------

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
2023-10-25 20:19:32 +00:00
hc-github-team-consul-core e6c6814c13
Backport of [NET-6305] xds: Ensure v2 route match and protocol are populated for gRPC into release/1.17.x (#19366)
* backport of commit 0a8fe0d94f

* backport of commit 74bf2aa8b0

---------

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2023-10-25 19:12:18 +00:00
hc-github-team-consul-core 7d60b6ccb9
Backport of NET-6081 - xds controller golden file inputs into xds resources - sources into release/1.17.x (#19354)
no-op commit due to failed cherry-picking

Co-authored-by: temp <temp@hashicorp.com>
2023-10-24 20:32:14 +00:00
hc-github-team-consul-core 1c98afd997
Backport of NET-6080 - xds controller golden file inputs into xds resources - destinations into release/1.17.x (#19352)
* backport of commit f142c77956

* backport of commit 79eadd1afd

* backport of commit d269c63a99

* backport of commit 532aad4dbf

* backport of commit 2de83d470f

* backport of commit c8af477a30

* NET-6080 - xds controller golden file inputs into xds resources - destinations (#19244)

* NET-5397 - wire up golden tests from sidecar-proxy controller for xds controller and xdsv2

* WIP

* WIP

* everything matching except leafCerts.  need to mock those

* single port destinations working except mixed destinations

* golden test input to xds controller tests for destinations

* proposed fix for failover group naming errors

* clean up test to use helper.

* clean up test to use helper.

* fix test file

* add docstring for test function.

* add docstring for test function.

* fix linting error

* fixing test after route fix merged into main

* first source test works

* WIP

* modify all source files

* source tests pass

* fixing tests after bug fix in main

* got first destination working.

* adding destinations

* fix docstring for test

* fixing tests after bug fix in main

---------

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-10-24 19:11:28 +00:00
Derek Menteer 8b35e087c5
Backport of Add grpc keepalive configuration (#19339) to 1.17.x (#19345)
Add grpc keepalive configuration. (#19339)

Prior to the introduction of this configuration, grpc keepalive messages were
sent after 2 hours of inactivity on the stream. This posed issues in various
scenarios where the server-side xds connection balancing was unaware that envoy
instances were uncleanly killed / force-closed, since the connections would
only be cleaned up after ~5 minutes of TCP timeouts occurred. Setting this
config to a 30 second interval with a 20 second timeout ensures that at most,
it should take up to 50 seconds for a dead xds connection to be closed.
2023-10-24 08:51:49 -05:00
hc-github-team-consul-core c613594416
Backport of Vault CA bugfixes into release/1.17.x (#19309)
* backport of commit 8a6a858584

* backport of commit 1922b5f539

* backport of commit a4dff42744

* backport of commit cb7e5ded36

* backport of commit fcc9ee6542

* backport of commit 61d1c264d8

---------

Co-authored-by: Chris S. Kim <ckim@hashicorp.com>
2023-10-20 17:05:05 +00:00
hc-github-team-consul-core fa564e95fe
Backport of [NET-6221] Ensure LB policy set for locality-aware routing (CE) into release/1.17.x (#19289)
backport of commit a2de5916df

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2023-10-19 14:31:20 +00:00
hc-github-team-consul-core 1c91abd23d
Backport of [NET-5810] CE changes for multiple virtual hosts into release/1.17.x (#19247)
backport of commit c5018c1da7

Co-authored-by: jm96441n <john.maguire@hashicorp.com>
2023-10-17 15:33:12 +00:00
hc-github-team-consul-core 689f32c59d
Backport of catalog, mesh: implement missing ACL hooks into release/1.17.x (#19212)
catalog, mesh: implement missing ACL hooks (#19143)

This change adds ACL hooks to the remaining catalog and mesh resources, excluding any computed ones. Those will for now continue using the default operator:x permissions.

It refactors a lot of the common testing functions so that they can be re-used between resources.

There are also some types that we don't yet support (e.g. virtual IPs) that this change adds ACL hooks to for future-proofing.

Co-authored-by: Iryna Shustava <ishustava@users.noreply.github.com>
2023-10-14 01:50:22 +00:00