Commit Graph

11804 Commits

Author SHA1 Message Date
Daniel Nephin 62703e4426
Merge pull request #8438 from hashicorp/dnephin/1.8.x-backport-ineffassign
[1.8.x] Backport addition of  ineffassign linter and staticcheck
2020-08-07 13:04:56 -04:00
Matt Keeler 4d276647d2
Update CHANGELOG.md 2020-08-07 10:22:17 -04:00
Matt Keeler 1c3c8c7804 Require token replication to be enabled in secondary dcs when ACLs are enabled with AutoConfig (#8451)
AutoConfig will generate local tokens for clients and the ability to use local tokens is gated off of token replication being enabled and being configured with a replication token. Therefore we already have a hard requirement on having token replication enabled, this commit just makes sure to surface that to the operator instead of having to discern what the issue is from RPC errors.
2020-08-07 14:20:57 +00:00
Hans Hasselberg 98308542eb
Update CHANGELOG.md 2020-08-07 12:07:36 +02:00
Hans Hasselberg ba495cd11b auto_config implies connect (#8433) 2020-08-07 10:02:30 +00:00
Hans Hasselberg 56fb793fc1 Introducing changelog-gen (#8387)
* add templates for changelog-gen
* add entry files for currently unreleased PRs on master
2020-08-07 11:53:35 +02:00
Hans Hasselberg f96e84d502
Update CHANGELOG.md 2020-08-06 21:32:08 +02:00
Hans Hasselberg 1a351d53bb Mark its own cluster as healthy when rebalancing. (#8406)
This code started as an optimization to avoid doing an RPC Ping to
itself. But in a single server cluster the rebalancing was led to
believe that there were no healthy servers because foundHealthyServer
was not set. Now this is being set properly.

Fixes #8401 and #8403.
2020-08-06 08:43:18 +00:00
R.B. Boyer 9d5f9c6bec update changelog 2020-08-05 15:06:18 -05:00
R.B. Boyer 5b7bbb9de5 xds: revert setting set_node_on_first_message_only to true when generating envoy bootstrap config (#8440)
When consul is restarted and an envoy that had already sent
DiscoveryRequests to the previous consul process sends a request to the
new process it doesn't respect the setting and never populates
DiscoveryRequest.Node for the life of the new consul process due to this
bug: https://github.com/envoyproxy/envoy/issues/9682

Fixes #8430
2020-08-05 20:00:58 +00:00
Daniel Nephin 2bde91a2a0 Merge pull request #8404 from hashicorp/dnephin/remove-log-output-field
Use Logger consistently, instead of LogOutput
2020-08-05 18:32:16 +00:00
Daniel Nephin 4756cb6af4 Merge pull request #8437 from hashicorp/dnephin/fix-service-checks-cache-type
cache-type: Return nil value on error
2020-08-05 17:50:28 +00:00
Daniel Nephin 26e53053a9 Merge pull request #8034 from hashicorp/dnephin/add-linter-staticcheck-4
ci: enable SA4006 staticcheck check and add ineffassign
2020-08-05 13:37:35 -04:00
Daniel Nephin e5f5588d9d Merge pull request #8385 from hashicorp/dnephin/check-generated
ci: Add check-generated-protobuf
2020-08-05 16:11:46 +00:00
Mike Morris 622495fd28
Update CHANGELOG.md 2020-07-30 13:21:53 -04:00
freddygv b5e858d3e1 Avoid panics during shutdown routine 2020-07-30 11:13:40 -06:00
Kyle Havlovitz 5658faec6b
Update CHANGELOG.md 2020-07-30 09:43:12 -07:00
Matt Keeler e9b07c50bc Add some auto-config docs (#8410)
We will probably want a tutorial about this in the future but for now at least we document it a little.
2020-07-30 16:10:53 +00:00
Matt Keeler d6c35dd525
Update CHANGELOG.md 2020-07-30 11:43:25 -04:00
Matt Keeler c9b66157a1
Ensure certificates retrieved through the cache get persisted with auto-config (#8409) 2020-07-30 11:42:24 -04:00
Matt Keeler 4f98af0724 Allow setting verify_incoming* when using auto_encrypt or auto_config (#8394)
Ensure that enabling AutoConfig sets the tls configurator properly

This also refactors the TLS configurator a bit so the naming doesn’t imply only AutoEncrypt as the source of the automatically setup TLS cert info.
2020-07-30 14:16:15 +00:00
Hans Hasselberg ab71058aa4
Mention agent-caching ratelimiting. 2020-07-30 14:48:00 +02:00
Hans Hasselberg ae2cbbce99 agent/cache test for cache throttling. (#8396) 2020-07-30 12:41:38 +00:00
Kenia ee3b3f559a ui: Add sorting to Policies (#8373)
* Add sorting to ACLs policies with comparator

* Add acls/roles sorting test

* Add navigation test for acls/policies

* Update onchange value for sorting policies
2020-07-29 18:36:50 +00:00
Matt Keeler 683454775c
Update CHANGELOG.md 2020-07-29 11:12:14 -04:00
Kenia 3b244d8f56 ui: Add sorting to Roles (#8369)
* Add sorting to ACLs roles with comparator

* Add acls/roles sorting test

* Add navigation feature test to roles

* Update onchange value target for sorting roles
2020-07-29 14:56:03 +00:00
Kenia 25cc7e5cbc ui: Update onchange value target for sorting tokens (#8399) 2020-07-29 14:13:31 +00:00
John Cowen 96c5723d28 ui: Ensure URLs for tabs change when selecting a different DC (#8397)
* ui: Add URLs to tabs to we can assert them

* Add dcs to the service show page, temporarily

There is an ongoing PR which removes the need to do this by adding a dcs
property to the navigation, hence temporary

* Add a step to assert on whether text _contains_ rather than exact match

* Test whether the URL of the instance tab changes when the user switches dcs using the main navigation menu

* Recompute href-to's on URL change, just like is-href
2020-07-29 14:12:38 +00:00
Kenia 78a6e6393f ui: Fix up on the onchange value to target for soting intentions (#8398) 2020-07-29 14:08:11 +00:00
Kenia 2179bb0dec ui: Add sorting to ACLs tokens with tests (#8359)
* Add sorting to ACLs tokens with tests

* Create token comparator and implement in template

* Upgrade @hashicorp/consul-api-double to 3.1.6

* Add navigation test to acls tokens
2020-07-29 13:42:01 +00:00
John Cowen 53b30dda4d ui: Use X-Range header as a signal as to whether to reconcile the ember-data store (#8384)
* ui: Use `X-Range` header/meta to decide whether to reconcile or not

Previously we used a `shouldReconcile` method in order to decide whether
a response should trigger a reconciliation of the frontend ember-data
'source of truth' or not. It's a lot nicer/clearer if this 'flag' can be set
alongside the HTTP request information, moreover we almost have the same
functionality in `If-Range`/`Partial Content` HTTP functionality.

Here we partly follow this HTTP semantics but use a custom `X-Range` header
instead.
2020-07-29 08:16:54 +00:00
Matt Keeler e813445e57 Agent Auto Config: Implement Certificate Generation (#8360)
Most of the groundwork was laid in previous PRs between adding the cert-monitor package to extracting the logic of signing certificates out of the connect_ca_endpoint.go code and into a method on the server.

This also refactors the auto-config package a bit to split things out into multiple files.
2020-07-28 19:32:22 +00:00
Matt Keeler 91ec880e07
Backport #8389 (#8392)
# Conflicts:
#	agent/cache-types/catalog_list_services_test.go
2020-07-28 14:22:29 -04:00
Kenia f154aabd57 ui: Add sorting to Intentions with tests (#8348)
* Add sorting to Intentions with tests

* Skip Intentions url back test

* Create comparator for intention and implement in template

* Add a intentions navigation feature test
2020-07-28 15:38:04 +00:00
Pierre Souchay 678489d9d1 Added ratelimit to handle throtling cache (#8226)
This implements a solution for #7863

It does:

    Add a new config cache.entry_fetch_rate to limit the number of calls/s for a given cache entry, default value = rate.Inf
    Add cache.entry_fetch_max_burst size of rate limit (default value = 2)

The new configuration now supports the following syntax for instance to allow 1 query every 3s:

    command line HCL: -hcl 'cache = { entry_fetch_rate = 0.333}'
    in JSON

{
  "cache": {
    "entry_fetch_rate": 0.333
  }
}
2020-07-27 21:11:42 +00:00
Matt Keeler 0937f70ddf Move connect root retrieval and cert signing logic out of the RPC endpoints (#8364)
The code now lives on the Server type itself. This was done so that all of this could be shared with auto config certificate signing.
2020-07-24 14:01:58 +00:00
Kyle Havlovitz b1e73e18be vendor: Update github.com/armon/go-metrics to v0.3.3 2020-07-23 13:08:49 -07:00
Matt Keeler 4d41ee3887 Move generation of the CA Configuration from the agent code into a method on the RuntimeConfig (#8363)
This allows this to be reused elsewhere.
2020-07-23 20:05:52 +00:00
Chris Piraino ace8ec1da0
Update CHANGELOG.md 2020-07-23 13:16:04 -05:00
Chris Piraino 0385a5bb58 Fix envoy bootstrap logic to not append multiple self_admin clusters (#8371)
Previously, the envoy bootstrap config would blindly copy the self_admin
cluster into the list of static clusters when configuring either
ReadyBindAddr, PrometheusBindAddr, or StatsBindAddr.

Since ingress gateways always configure the ReadyBindAddr property,
users ran into this case much more often than previously.
2020-07-23 18:12:39 +00:00
Matt Keeler 56b46436c1
Backport: #8362 (#8366)
Refactoring of the agentpb package.

First move the whole thing to the top-level proto package name.

Secondly change some things around internally to have sub-packages.
# Conflicts:
#	agent/consul/state/acl.go
#	agent/consul/state/acl_test.go
2020-07-23 12:44:27 -04:00
Matt Keeler f52676e78b Update mapstructure to v1.3.3 (#8361)
This was done in preparation for another PR where I was running into https://github.com/mitchellh/mapstructure/issues/202 and implemented a fix for the library.
2020-07-22 19:14:05 +00:00
R.B. Boyer ee387b8548 update changelog 2020-07-21 15:51:01 -05:00
R.B. Boyer 0ec3e2ebf4 gossip: Avoid issue where two unique leave events for the same node could lead to infinite rebroadcast storms (#8343)
bump serf to v0.9.3 to include fix for https://github.com/hashicorp/serf/pull/606
2020-07-21 20:49:09 +00:00
Daniel Nephin 4205fdf1d6 Merge pull request #7948 from hashicorp/dnephin/buffer-test-logs
testutil: NewLogBuffer - buffer logs until a test fails
2020-07-21 19:22:29 +00:00
Matt Keeler 4c0b520353
Update CHANGELOG.md 2020-07-21 15:09:37 -04:00
Matt Keeler 49145df770
Merge pull request #8352 from hashicorp/backport/8311 2020-07-21 15:07:54 -04:00
Matt Keeler a8d2e5a2c2
Disable background cache refresh for Connect Leaf Certs
The rationale behind removing them is that all of our own code (xDS, builtin connect proxy) use the cache notification mechanism. This ensures that the blocking fetch behind the scenes is always executing. Therefore the only way you might go to get a certificate and have to wait is when 1) the request has never been made for that cert before or 2) you are using the v1/agent/connect/ca/leaf API for retrieving the cert yourself.

In the first case, the refresh change doesn’t alter the behavior. In the second case, it can be mitigated by using blocking queries with that API which just like normal cache notification mechanism will cause the blocking fetch to be initiated and to get leaf certs as soon as needed.

If you are not using blocking queries, or Envoy/xDS, or the builtin connect proxy but are retrieving the certs yourself then the HTTP endpoint might take a little longer to respond.

This also renames the RefreshTimeout field on the register options to QueryTimeout to more accurately reflect that it is used for any type that supports blocking queries.

# Conflicts:
#	agent/cache/cache.go
2020-07-21 13:51:18 -04:00
Matt Keeler 24e11b511e
Fix issue with changing the agent token causing failure to renew the auto-encrypt certificate
The fallback method would still work but it would get into a state where it would let the certificate expire for 10s before getting a new one. And the new one used the less secure RPC endpoint.

This is also a pretty large refactoring of the auto encrypt code. I was going to write some tests around the certificate monitoring but it was going to be impossible to get a TestAgent configured in such a way that I could write a test that ran in less than an hour or two to exercise the functionality.

Moving the certificate monitoring into its own package will allow for dependency injection and in particular mocking the cache types to control how it hands back certificates and how long those certificates should live. This will allow for exercising the main loop more than would be possible with it coupled so tightly with the Agent.

# Conflicts:
#	agent/agent.go
2020-07-21 13:49:18 -04:00
Nathan Lacey 8513ad572d Add certificate disclaimer for TLS encryption (#8316)
Co-authored-by: Freddy <freddygv@users.noreply.github.com>
2020-07-21 16:39:16 +00:00