Commit Graph
4516 Commits
Author SHA1 Message Date
Johan Brandhorst-SatzkornandDamian Debkowski ec0a3f964b Worker status refactor (#5417)
* oss: feat(proto): statistics rpc added to server coordination service

* oss: feat(session): add update statistics status service

* oss: feat(handlers): add Statistics method to worker service server

* oss: feat(worker): add statistics ticking

* oss: internal/proto: define the new RoutingInfo RPC

* oss: internal/server: repository changes for RoutingInfo RPC

* oss: internal/daemon: add RoutingInfo handler to worker service

The new RoutingInfo RPC is used to get information from the worker
that is used to make routing decisions on the controller. It also
handles the initial request from the worker.

* oss: feat(db): server_worker_session_info table

* oss: feat(proto): session info rpc for server coordination service

* oss: feat(server): worker session info request data type

* oss: feat(worker): session info ticker

* oss: feat(handler): server coordination handler for session info

* oss: feat(session): utilize session info request time for session cleanup

* oss: proto: fix some gotags comments

Some of these fields were missing comments, while others had
incorrectly formatted comments.

* oss: worker: send connection status to server

This is required for the correct tracking of orphaned connections

* oss: internal/daemon/worker: add function to wait for Statistics RPC

* oss: internal/daemon/worker: add routing info RPC

The new RoutingInfo RPC replaces part of the Status RPC,
namely the part which is used by the controller and worker
to perform decisions around the establishment of new sessions
and new worker connections.

* oss: internal/daemon/worker: remove unnecessary error check

* oss: internal/daemon/worker: lock access to config and upstreams

The new confLock protects access to the conf value and to the
addressReceivers slice.

* oss: worker: replace Status RPC with RoutingInfo

* oss: worker: deprecate the Status RPC and related types

The Status RPC and related messages have been replaced
by the RoutingInfo/SessionInfo/Statistics RPCs. The controller
will continue to support the Status RPC until two new minor
versions have been released.

* oss: internal/event: add default deny for new worker RPCs

* oss: internal/daemon/worker: allow RPC interval to be set

The new SessionInfo/RoutingInfo/Statistics RPCs run at
long intervals, which make some of our cluster tests take
a long time to complete. This allows their interval to be
configured in tests.

* oss: all: use TestWorkerRPCInterval in slow tests

This should speed up these tests significantly.

* oss: internal/tests/cluster: reset sys eventer in test

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2025-01-09 10:26:37 -08:00
Michael Li 554195f49f test(e2e): Add test for connect http (#5423)
* test(e2e): Add comment to test

* test(e2e): Add test for connect http

* CR
2025-01-09 12:43:21 -05:00
Michael Li 0a54be59b5 chore: Modify tparse check (#5425) 2025-01-09 09:50:18 -05:00
Damian Debkowski dc66aa0556 fix(enos): bump default db version to new required minimum (#5426) 2025-01-08 22:42:08 -08:00
Michael Li 91c060ca44 test(e2e): Add increased retries due to worker status report changes (#5424) 2025-01-08 15:46:37 -05:00
HugoandJohan Brandhorst-Satzkorn dce336500e chore(plugins): Update AWS plugin to v0.5.0 (#5421)
* chore(plugins): Update AWS plugin to v0.5.0

* docs: Update CHANGELOG

* docs: Update CHANGELOG language

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2025-01-08 17:33:33 +00:00
Hugo 346ac58fa3 feat(cmd): Default to azure plugin when performing db migration (#5422) 2025-01-08 17:25:13 +00:00
Timothy Messier 71af25f584 fix(db): Remove begin when assembling migrations (#5148)
When building the set of migrations to run as part of executing the
`database migrate` or `database init`, the migrations are collected and
combined to run within a database transaction. As such the `begin` and
`commit` statements in the migration files should get removed from the
final set of statements that get executed. However, when the migrations
files were updated to include copyright and license headers, this broke
the logic that would strip out the `begin` statement.

While this does not cause any issue with executing the statements in a
single transaction, it does result in noise in the database server's
logs, with log messages like:

    BEGIN WARNING:  25001: there is already a transaction in progress
    BEGIN LOCATION:  BeginTransactionBlock, xact.c:3778

This commit fixes the logic to correctly strip the `begin` for files
that have the header lines.
2025-01-08 10:40:21 -05:00
846c849589 Worker Domain Refactor (#5338)
* feat(server): Refactor LookupWorkerByName to be a test method

* feat(server): Split worker tags table

* refact(worker): Export api and config tags

* refact(server): Return worker id from UpsertWorkerStatus

* refact(server): Create ListWorkerStorageBucketUpdates domain function

* refact(server): Use dedicated HCPb-worker list func

* refact(server): Create ConnectionRoute domain function

* refact(handlers): Move worker selection logic to internal/server package

This commit moves all the logic to select a worker to handle a session
to the internal/server package. Most functions were moved to this
package with no changes, however, there are a couple of notable
exceptions:

- Given that we don't use GRPC errors in repos, all errors were adjusted
  to use the internal/errors package instead.
- StorageBucketFilterCredIdFn is now used to prevent the internal/server
  package from importing internal/storage/plugin, which would cause a
  dep cycle. Callers of SelectSessionWorkers must implement this func
  which is responsible for returning a storage bucket's worker filter as
  well as its associated credential id.
- authorizeSessionWithWorkerFilter now receives an
  internal/server.(*Repository) object when called. This is transparent
  to SelectSessionWorkers callers as it is handled internally.

* feat(server): Add FilteredWithFeatures fn and new server options

* refact(server): create new list and lookup worker queries

* test(server): Add WorkerList unit tests

* feat(server): Implement WorkerList randomness using crypto/rand pkg

* chore(db): add index to server_worker table

* refact(server): prefix test method with Test

* refact(server): rename Downstreamers interface to Graph

* chore(server): unexport and rename method

* chore: add doc string to WorkerAddress (#5420)

---------

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
Co-authored-by: irenarindos <irena.rindos@gmail.com>
2025-01-08 15:18:03 +00:00
Timothy Messier 5329f926b6 fix(api): Correctly apply BOUNDARY_MAX_RETRIES env var (#5385)
The api.Client was first checking for the environment variable, and then
resetting the max retries to 2, thus overriding the environment variable
value. In addition, the cli would set max retries to zero if the
environment variable was not set. This would mean that by default the
max retries would be zero, and if the environment variable was set, the
max retries would be 2, regardless of the actual value for the
environment variable.

This fixes the order in which the environment variables are read, to
ensure they take precedence.
2025-01-08 10:07:09 -05:00
Michael Li 02fe1b42d3 test(e2e): Extend vault oidc test to authenticate using the OIDC auth method (#5409)
* refact(e2e): Rename file for consistency

* test(e2e): Extend test to authenticate using oidc auth method

* CR: Add checks for account attributes

* CR: Use any instead of interface

* CR: Use %q
2025-01-07 14:04:54 -05:00
Michael Li 5077463aa0 chore: Only use dependabot for internal action updates (#5414) 2025-01-07 13:57:21 -05:00
db03d545bd Docs: fix missing worker registration CLI steps (#5407)
* fixes missing CLI registration steps, adds an additional step for additional workers

* Update website/content/docs/install-boundary/configure-workers.mdx

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* Apply suggestions from code review

Co-authored-by: Dan Heath <76443935+Dan-Heath@users.noreply.github.com>

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Co-authored-by: Dan Heath <76443935+Dan-Heath@users.noreply.github.com>
2025-01-07 11:43:48 -07:00
Johan Brandhorst-Satzkorn 1cbe1ca463 internal/event: fix log processor race (#5401)
The cloud events formatter Process function would call
the signer without protecting it, which was racy with the Rotate
function.
2025-01-07 09:11:52 -08:00
Johan Brandhorst-Satzkorn ae916727e5 Dockerfile: bump alpine version (#5411)
Should hopefully resolve the wget warning
2025-01-07 09:10:45 -08:00
Michael Li ab94d5cf59 chore(e2e): Modify bucket policy to 7 days (#5410) 2025-01-06 17:29:03 -05:00
Johan Brandhorst-Satzkorn a21f0f109a mod: update golang.org/x/net dependency (#5405)
Fixes CVE-2024-45338, GO-2024-3333
2025-01-03 15:33:28 -08:00
David Kanney 3b637e068c docs(CHANGELOG): Add session connection limit fix (#5404) 2025-01-03 13:34:50 -05:00
Johan Brandhorst-Satzkorn 7b30697ddd internal/session: fix race condition in connection cleanup (#5402)
The totalClosed variable was accessed in both the Status and the Run
functions, which may be called from independent goroutines.
2025-01-03 10:28:21 -08:00
Jeanne Franco ff68e41013 Add artifacts manifest (automatically generated) (#4992)
* Add artifacts manifest (automatically generated)

* Add copywrite header
2025-01-03 12:12:46 -05:00
Michael Li 629d7a93ee chore(e2e): Modify gcp label to meet format constraints (#5400)
GCP label constraints include the following:

The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed.
2025-01-03 10:47:08 -05:00
hashicorp-tsccr[bot]andhashicorp-tsccr[bot] 47538bddcc Result of tsccr-helper -log-level=info gha update -latest .github/ (#5398)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2025-01-02 11:42:50 -05:00
Michael Li 3d0f667151 chore(e2e): Update vault addresses in AWS scenarios (#5395) 2025-01-02 09:42:23 -05:00
Damian Debkowski 868d7b8a2d test(daemon): remove tests with multihop (#5397) 2024-12-30 12:21:52 -08:00
David Kanney 2342e4b644 fix(target): Assign session connection limit to SessionAuthorization.ConnectionLimit (#5396)
* fix(target): Assign session connection limit to SessionAuthorization.ConnectionLimit

* test(target): Update TestAuthorizeSession & TestAuthorizeSessionTypedCredentials to check session connection limit
2024-12-30 14:16:39 -05:00
Michael Li 157c305753 chore: Install tools if cache restore fails (#5394)
On occasion, the cache restore fails, causing the test pipeline to fail due to not having tparse. This adds a failsafe in the event that there's something wrong with the cache restore.
2024-12-23 14:55:35 -05:00
Damian Debkowski dd1482b5ac test(cluster): check worker status multiple times (#5393) 2024-12-23 11:39:58 -08:00
Johan Brandhorst-Satzkorn 1a6320794e cmd: propagate keyring reading errors (#5360)
Reading a token from the keyring can sometimes fail for reasons
other than the token not being present in the keyring. This PR
introduces a new error used to indicate that the token requested
could not be found in the keyring and propagates errors from the
keyring up to the caller, so that the caller can act on them.

Additionally, this fixes a bug in the client cache where it would
incorrectly assume that a token had been removed from the
keyring, when in fact there was an error reading from the keyring.
2024-12-23 09:21:18 -08:00
Damian Debkowski 98bb4c8c31 test(cluster): split tests between parallel and sequential packages (#5390) 2024-12-20 13:53:37 -08:00
Johan Brandhorst-Satzkorn 1b6b22ef4f internal/daemon/worker: improve runtime and reduce noise (#5387)
TestRotationTicking would previously wait for 5 rotations, which is
pretty slow considering each rotation takes 20 seconds. Reduce
the number to 3, and use require instead of assert to remove
noise during flaky test runs.

This doesn't fix the flakiness of this test, but it should reduce the log spam.
2024-12-20 12:02:22 -08:00
Dan HeathandJohan Brandhorst-Satzkorn 833ddb21ad docs: Update 0.18.x release notes (#5382)
* docs: Update 0.18.x release notes

* docs: Update version numbers

* Apply batch of suggestions from code review

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* docs: Add issue link and minor edits

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2024-12-20 10:06:03 -07:00
Michael LiandJohan Brandhorst-Satzkorn 6ed077c69e test(e2e): Add test for vault oidc provider (#5384)
* test(e2e): Simplify vault address in docker network

* test(e2e): Add oidc test using vault

* Update enos/modules/docker_vault/main.tf

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2024-12-19 17:06:01 -05:00
Johan Brandhorst-Satzkorn 20f11ab01b Revert "internal/daemon: speed up multi-worker tests (#5370)" (#5386)
Unfortunately, this started causing the enterprise tests to break in
an unexpected way. Reverting to spend some more time testing the changes.
2024-12-19 09:29:48 -08:00
David Kanney 48e0289882 chore: bump boundary-plugin-gcp to latest version (#5381)
* chore: bump boundary-plugin-gcp to latest version

* chore: go mod tidy
2024-12-18 16:45:44 -05:00
Elim Tsiagbey e0eb393665 docs: Add docs for GCP DHC (#5364)
* docs: Add docs for GCP DHC

- Add documentation for GCP dynamic host catalog
- Add changelog for GCP dynamic host catalog
2024-12-18 15:20:19 -05:00
Dan Heath 3cb68b0afd docs: Rename directory (#5234) 2024-12-18 13:52:37 -05:00
Michael Milton ba08b8a5bc Update CHANGELOG (#5378) 2024-12-18 12:39:48 -05:00
adam buxtonandDan Heath 6e1ee86cbb add error #3001 (#5371)
* add error #3001

* Update website/content/docs/troubleshoot/common-errors.mdx

Co-authored-by: Dan Heath <76443935+Dan-Heath@users.noreply.github.com>

---------

Co-authored-by: Dan Heath <76443935+Dan-Heath@users.noreply.github.com>
2024-12-18 10:56:06 -05:00
Elim Tsiagbey 090c1df06e chore: update boundary-plugin-gcp dependency to latest version (#5374) 2024-12-17 15:31:41 -05:00
Dan HeathandRobin Beck b442c1fa60 docs: Update meta content - CLI (#5343)
* docs: Update meta content - CLI

* docs: Edits for consistency

* docs: More edits for consistency

* Apply batch of suggestions from code review

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

* Apply batch suggestions from code review

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

* docs: Remove given id references

* Update read.mdx

* Update read.mdx

---------

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
2024-12-17 14:13:18 -05:00
Elim Tsiagbey a4f2a704fd test(e2e): add GCP dynamic host catalog e2e tests (#5294)
* test(e2e): add GCP infra resources and tests for enos testing

- add 1 new `gcp_target` module that creates a GCP VM instance with labels for filtering
- add GCP dynamic host catalog e2e tests
2024-12-17 14:06:14 -05:00
Johan Brandhorst-Satzkorn 862a30c389 internal/daemon: speed up multi-worker tests (#5370)
Instead of sleeping, we can poll for the desired state. Also,
run shutdowns in parallel.
2024-12-17 09:18:27 -08:00
Dan Heath b2bcd8f7be docs: Update release notes (#5346)
* docs: Update release notes

* docs: Clarify affected versions, fix spacing
2024-12-16 15:29:37 -05:00
Irena RindosandDan Heath fd8f0c1cc6 chore(docs): Remove community-only notation for KMS keys (#5164)
* chore(docs): Remove community-only tag from kms keys

* docs: Clarify edition support

* docs: Minor edit, add `worker-auth` statement

---------

Co-authored-by: Dan Heath <76443935+Dan-Heath@users.noreply.github.com>
2024-12-13 09:12:53 -05:00
Johan Brandhorst-Satzkorn e5b655b9e5 Update CHANGELOG.md with 0.18.2 changes (#5361) 2024-12-12 15:54:17 -08:00
Johan Brandhorst-Satzkorn 87fc86847b all: update crypto dependency (#5356)
This resolves a vulnerability in the SSH package that we're
not vulnerable to.
2024-12-12 11:26:16 -08:00
dependabot[bot] aae9258f5b chore(deps): bump golang.org/x/crypto from 0.18.0 to 0.31.0 in /api (#5354)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.18.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-12 10:19:04 -08:00
Michael Li 8d7a9d7e08 Merge pull request #5347 from hashicorp/moduli-flake-worker-test
Observed one instance of a test failure when the test failed to connect to the target after changing an API tag on the worker.
2024-12-11 10:26:08 -05:00
Michael Li 4e59352ded Merge pull request #5340 from hashicorp/judith/edu-web-codeowners
* allow education to merge image prs and web to control the website source

* keep boundary team permissions to approve any PR

* let education approve PRs to the website nav too

* make spacing more reasonable
2024-12-11 09:49:09 -05:00
Michael Li 08c245cd00 test(e2e): Update test to mitigate timing flake
Observed one instance of a test failure when the test failed to connect to the target after changing an API tag on the worker.
2024-12-10 16:38:29 -05:00