Commit Graph
3586 Commits
Author SHA1 Message Date
Michael Li 0adfe2d5a3 test(e2e): Fix syntax (#4164) 2023-12-15 15:15:03 -05:00
Michael Li b696f1653d test(e2e): Add worker ip to aws tests (#4153) 2023-12-14 13:48:29 -05:00
Michael Li f36b3d4723 chore(e2e): Avoid error in action if no log files are found (#4152) 2023-12-13 14:16:44 -05:00
e49a84ce9c docs: Add connection workflow docs (#4034)
* docs: Add connection workflow docs

* docs: Update HCP connect to target topic

* docs: Update Overview topic and nav

* docs: Break out exec flag topic

* docs: Updates to connect helpers topic

* docs: Update exec flag and proxycommand topics

* docs: Fix broken link

* docs: Update meta content and get started topics

* docs: Redirect deleted proxycommand topic

* docs: Add links for HCP and self-managed tutorials

* docs: Add multi-hop

* adds CodeTabs and windows instructions

* Update website/content/docs/concepts/connection-workflows/workflow-ssh-proxycommand.mdx

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>

* removes windows workflow

---------

Co-authored-by: stellarsquall <stellarsquall@protonmail.ch>
Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
2023-12-13 13:58:10 -05:00
Michael Li 600a2dff24 test(e2e): Add rate limit test (#4135) (#4143)
* test(e2e): Add rate limit test (#4135)

(cherry picked from commit 9bf350d622a14ea39feaca29861c738a5deff9bb)

* test(e2e): Modify rate limit test due to timing issues (#4145)

The rate limit test was running into failures due to some hard-coded assumptions (waiting for a command to last longer than 3 seconds to determine if the CLI auto-retried). This change makes it more resilient.

(cherry picked from commit 3535f15922c37fda5457f02cf8ae894203359042)
2023-12-13 10:17:04 -05:00
Timothy Messier 1bf883e4b1 chore(changelog): Add entry for 0.13.5 2023-12-12 21:14:01 +00:00
Timothy Messier 428cb4111c chore: Update changelog for 0.14.3 2023-12-12 21:09:19 +00:00
Dan Heath 5ff8d4e1c1 docs: Clarify projects' purpose (#4049)
* docs: Clarify projects' purpose

* docs: Update meta content

* docs: Add more context
2023-12-12 15:22:41 -05:00
Dan Heath 9bf942243c docs: Update release notes for 0.14.x (#4146) 2023-12-12 15:11:44 -05:00
Lisbet Alvarez 69810ba80b update ui commit to include bug fix (#4144) 2023-12-11 17:11:52 -08:00
3cfc20e6f6 docs: Document API rate limiting (#4111)
* docs: Document API rate limiting

* docs: Fix default setting

* addss rate limiting examples to complete configuration example

* use # for comments for consistency

* Update website/content/docs/api-clients/api.mdx

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>

* Apply batch suggestions from code review

Co-authored-by: Michael Li <michael.li@hashicorp.com>

* docs: Updates from review feedback

* docs: Updates from review feedback

* docs: Add new defaults and sub-headings

* Update website/content/docs/api-clients/go-sdk.mdx

Co-authored-by: Timothy Messier <tim.messier@gmail.com>

* docs: Remove remaining comments from code blocks

* docs: Update code blocks

* fixes tabs

* Update website/content/docs/api-clients/api.mdx

Co-authored-by: Michael Li <michael.li@hashicorp.com>

---------

Co-authored-by: stellarsquall <stellarsquall@protonmail.ch>
Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
Co-authored-by: Michael Li <michael.li@hashicorp.com>
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-12-11 09:52:36 -05:00
Sarah Thompson d4f2f02072 Merge pull request #4057 from hashicorp/update-releng-codeowners
Remove release-engineering as codeowners
2023-12-11 11:54:19 +00:00
Lisbet Alvarez c61600896f Bump UI commit (#4118)
* Bump UI commit

* update ui commit to include another bug fix

* update commit with oidc prompt changes
2023-12-08 09:59:48 -08:00
Timothy Messier a77c88ae5d feat(ratelimit): Increase default values (#4129)
This increases the default rate limits to:

- 1,500 reqs / 30 seconds for list actions in total
- 1,500 reqs / 30 seconds for list actions per IP address
- 150 reqs / 30 seconds for list actions per auth token

And for all other actions:

- 30,000 reqs / 30 seconds for list actions in total
- 30,000 reqs / 30 seconds for list actions per IP address
- 3,000 reqs / 30 seconds for list actions per auth token

This seems to be a reasonable default for a small to medium size cluster
based on some scale testing.

(cherry picked from commit 237c8b6084f42655edaba49055e511163fdf1c53)
2023-12-08 14:53:49 +00:00
Elim Tsiagbey 053421600d feat(oidc-prompts): Add Validation for Prompts (#4130)
Add validation to prevent "none" from being combined with multiple prompts.

- Valid `["none"]`
- Invalid `["none", "select_account"]`
- Valid `["consent", "select_account"]`
2023-12-08 09:51:54 -05:00
Timothy Messier c70a6ff6ba chore: Bump to Go version 1.21.5
Go 1.21.5 fixes a few vulnerabilities. Most notably for boundary is a
fix in net/http to limit chunked data overhead.

See: https://groups.google.com/g/golang-announce/c/iLGK3x6yuNo
(cherry picked from commit 575cd9d63b1ac4787d048d86b0b209c61a7f3946)
2023-12-07 19:42:45 +00:00
Dan HeathandRobin Beck 4cbf468230 docs: Update session recording reqs for HCP (#4088)
* docs: Update session recording reqs for HCP

* docs: Update link

* docs: Add note for HCP Boundary

* docs: Update with proper Note format

* Update website/content/docs/configuration/session-recording/create-storage-bucket.mdx

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>

---------

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
2023-12-07 13:29:03 -05:00
Hugo cf71ae042c feat(github): Disable schema-diff for PRs in draft state (#4110) 2023-12-07 16:59:34 +00:00
Jim 9952910828 chore (changelog): document go-kms-wrapping bug fix (#4107) 2023-12-06 12:12:15 -05:00
Johan Brandhorst-Satzkorn fa7813d800 testing: clarify tracing requirements (#4063)
I missed that you need to explicitly create a server
using http.DefaultServeMux.
2023-12-05 11:36:25 -08:00
Michael Li 11d4211f30 Revert "chore(deps): bump actions/setup-python from 4.7.1 to 4.8.0 (#4098)" (#4101)
This reverts commit 17e9edc07f.
2023-12-05 09:58:12 -05:00
dependabot[bot] 17e9edc07f chore(deps): bump actions/setup-python from 4.7.1 to 4.8.0 (#4098)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.7.1 to 4.8.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236...b64ffcaf5b410884ad320a9cfac8866006a109aa)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 09:53:10 -05:00
Timothy Messier 52cab530f2 Merge pull request #4092 from hashicorp/llb-rate-limiting
Add support for rate limiting

This introduces rate limiting for the Controller API endpoints. Limits
can be set separately for each combination of resource and action. And
each combination has a limit per auth-token, IP address, and in total.

By default each list action for all resources has a limit of 120
requests per minute. All other actions for all resources have a limit of
3,000 requests per minute. This can be overridden by including
`api_rate_limit` stanzas in the controller configuration. For example to
set a limit on target list requests per auth token:

    controller {
      api_rate_limit {
            resources = ["target"]
            actions   = ["list"]
            per 	= "auth-token"
            limit 	= 10
            period	= "1s"
      }
      // other controller configuration
    }

Or to completely override all of the defaults:

    controller {
      // total limit for all resources and actions
      api_rate_limit {
            resources = ["*"]
            actions   = ["*"]
            per  	= "total"
            limit 	= 500
            period	= "1s"
      }

      // limit for ip addresses to all resources and actions
      api_rate_limit {
            resources = ["*"]
            actions   = ["*"]
            per 	= "ip-address"
            limit 	= 100
            period	= "1s"
      }

      // Limit for auth tokens to all resources and actions
      api_rate_limit {
            resources = ["*"]
            actions   = ["*"]
            per 	= "auth-token"
            limit 	= 50
            period	= "1s"
      }
      // other controller configuration
    }

All rate limiting can be disabled by setting the
`api_rate_limit_disable` configuration variable:

    controller {
      api_rate_limit_disable = true
      // other controller configuration
    }

When rate limiting is enabled, boundary will create quotas to track the
number of requests used within a time period. Boundary will reserve a
set amount of memory for tracking quotas. This ensures that boundary
does not consume too much memory if there is a sudden burst of requests
from many different clients. However this does mean if boundary is
unable to store a quota, it will limit the request with a 503 HTTP
status code. The amount of memory can be controlled with the
`api_rate_limit_max_quotas` configuration variable. This can also be
monitored via two new metrics:

- `boundary_controller_api_ratelimiter_quota_storage_capacity`
- `boundary_controller_api_ratelimiter_quota_storage_usage`

Clients making requests to the controller API can inspect HTTP response
headers to understand the configured limits and current usage. Each
response will contain the following headers:

- RateLimit: Provides the current limit, number of remaining requests,
  and the time the quota will reset for the limit that is closest to
  being exhausted for the requested resource and action.
- RateLimit-Policy: Describes the limits for the requested resource and
  action.

If a request is limited, the client will receive a 429 HTTP status code,
and the Retry-After header will be set to the number of seconds the
client should wait before attempting the request again.
2023-12-05 08:06:23 -05:00
Timothy Messier 758e7b8bf1 test(credentials): Disable rate limiting for test
This test quickly polls a list endpoint, which exceeds the default rate
limits before the test can complete in CI.
2023-12-04 22:40:39 +00:00
Timothy Messier cd21f10a3b chore(lint): Update version of golangci-lint
Updating this helps resolve some false positives that were happening in
CI when detecting linter issues on PRs.
2023-12-04 22:23:50 +00:00
Timothy Messier a7730b02ac test(host_catalog): Fix flaky assertion 2023-12-04 21:38:31 +00:00
Timothy Messier 6e233c879f fix(ratelimit): Round up when setting Retry-After header
Previously this would truncate to the nearest integer, which could
result in clients retrying before the quota has reset, and getting rate
limited again. This also includes an update from go-rate that will round
up when reporting the reset time for the RateLimit header.

Note that in the case of a 503, the Retry-After header was already being
set correctly.

See: https://github.com/hashicorp/go-rate/pull/8
2023-12-04 21:35:20 +00:00
Timothy Messier da5dd383ad feat(api): Use Retry-After header when retrying a request
If the api.Client receives a 429 or 503 along with a Retry-After header,
the client will automatically wait the amount of time specified, and
then re-try the request.
2023-12-04 18:07:01 +00:00
Timothy Messier 35b91c66de refact(ratelimit): Rename MaxEntries to MaxQuotas 2023-12-04 17:25:16 +00:00
Timothy Messier a150c588bb feat(controller): Emit sys event detailing the rate limit configuration
A sys event will be emitted when the controller is constructed, and if
the rate limits are changed via a SIGHUP. The event contains the details
of the rate limits for each combination of resource and action. This
event can be used by operators to confirm the limits are set as they
would expect based on the controller config.
2023-12-04 16:24:20 +00:00
Timothy Messier 9438be4506 feat(ratelimier): Support disabling rate limiting 2023-12-04 16:24:20 +00:00
Timothy Messier d0c3da5f1d refact(ratelimiter): Updates due to refactor in go-rate 2023-12-04 16:24:19 +00:00
Timothy Messier 3c2bed92b0 feat(ratelimit): Expose metrics on quota usage
This provides two prometheus metrics to monitor the rate limiter:

boundary_controller_api_ratelimiter_quota_storage_capacity:

This is a gague that shows the total number of quotas that can be stored
at a given moment by the rate limiter.

boundary_controller_api_ratelimiter_quota_storage_usage:

This is a gague that shows the number of quotas currently being stored
by the limiter. If this becomes equal to the capacity, requests that
would result in a new quota being created will get limited and receive a
429 status code.
2023-12-04 16:24:04 +00:00
Timothy Messier 0bc423ebd8 feat(controller): Reload api rate limits on SIGHUP 2023-12-04 16:24:04 +00:00
Timothy Messier f54f2c0fc4 fix(ratelimit): Correctly extract ids from paths with punctuation 2023-12-04 16:24:04 +00:00
Timothy Messier 26854b01a8 feat(ratelimit): Set RateLimit and RateLimit-Policy headers 2023-12-04 16:24:04 +00:00
Timothy Messier e337cf8f69 feat(controller): Add authtoken public id to request context
This allows for http middleware handler functions that run later in the
handler function stack to have access to the extracted auth token public
id.
2023-12-04 16:24:04 +00:00
Timothy Messier 059d4992de feat(ratelimit): Add support for limits per ip address and auth token 2023-12-04 16:24:00 +00:00
Timothy Messier 00bd2899af feat(controller): Add ratelimiter http middleware 2023-12-04 16:22:58 +00:00
Timothy Messier 2853324479 feat(ratelimit): Add http middleware handler function 2023-12-04 16:20:44 +00:00
Timothy Messier 6da47443fd feat(ratelimit): Create rate limits from configs 2023-12-04 16:20:44 +00:00
Timothy Messier 61fcd857ec feat(resource): Add function to get type from plural string 2023-12-04 16:20:44 +00:00
Timothy Messier bc48e58035 chore: Add go-rate dependency 2023-12-04 16:20:42 +00:00
Timothy Messier 51adde4b2c feat(handlers): Register actions for each resource type
This registers the ActionSets for each resource when the handler
packages are initialized. This then allows other packages to retrieve
the ActionSets for a given resource from the action package.

The initial consumer of this will be the ratelimit package so that it
can programmatically enumerate all of the valid combinations of a
resource and action.

This leaves a number of TODO to refactor the handler packages to also
retrieve the action sets from the registered actions instead of using a
package variable. This is left as a TODO since there is some
inconsistencies in how these package variables are used between the
handlers. For example a number of packages use a map of subtypes to
ActionSets which is then used withing the handler implementation. Others
use a map, but don't seem to use it at all. And others just use an
ActionSet.
2023-12-04 16:20:29 +00:00
Timothy Messier 3f4a723541 feat(action): Add registrar for valid actions by resource 2023-12-04 16:20:29 +00:00
Timothy Messier 8643d8e6c6 feat(errors): Add code for invalid configuration 2023-12-04 16:20:29 +00:00
Timothy Messier c52caae345 refact(action): Make ActionSet behave as a set instead of a list
This switches the implementation of an ActionSet from a slice to a map
to ensure the elements in an ActionSet are unique. This allows for other
packages to perform set operations such as a union or difference without
needing to account for duplicates.
2023-12-04 16:20:29 +00:00
Timothy Messier bee45dc486 feat(config): Add fields for controller rate limit configuration 2023-12-04 16:20:28 +00:00
Timothy Messier 0fb77358e5 feat(ratelimit): Define initial ratelimit package and Config 2023-12-04 16:20:28 +00:00
hashicorp-tsccr[bot]andhashicorp-tsccr[bot] b159080593 Result of tsccr-helper -log-level=info -pin-all-workflows . (#4080)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2023-12-04 09:48:09 -05:00