Commit Graph
70 Commits
Author SHA1 Message Date
dani 1a77e4da86 Boundary Plugin MinIO (#4621)
feat(storage): Add storage support for MinIO via new built-in plugin
2024-04-12 11:28:40 -04:00
Elim Tsiagbey a23c57e7c6 feat: add storageEventListener nil check
Only shutdown the storageEventListener if the storageEventListener is not nil
2024-04-05 17:27:20 -04:00
Elim Tsiagbey 3f94c900f0 feat: Add worker event listener
- add worker event listener
- add worker event handler
- start event listener when a worker starts
2024-04-05 16:46:22 -04:00
Elim Tsiagbey 8506ed3e2c feat: Report Local Storage State Status
- add `LocalStorageState` to worker status reports
- update worker service handler to process `LocalStorageState`. If is empty for workers older workers, we set the `LocalStorageState` to `unknown`
- update field mask paths to support `LocalStorageState`
2024-04-05 16:46:06 -04:00
Damian Debkowski aea473c77b feat: new worker config for minimumAvailableCapacity 2024-04-05 16:45:52 -04:00
Jeff Mitchell 9408b2b299 Add some more fixes caught by race detector (#4488) 2024-03-07 14:46:10 -05:00
Jeff MitchellandDamian Debkowski 014a5a7aae Vet/race fixes (#4421)
This addresses all found vet/race fixes in community edition.

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-02-21 16:32:26 -05:00
Jeff Mitchell 8e71caa2e3 Address some review feedback 2024-01-26 18:24:27 -05:00
Jeff Mitchell 9332179a01 Remove the deprecated old KMS worker auth mechanism (#3935)
This has been superceded by the nodeenrollment-based KMS worker auth
mechanism. This commit only removes the ability to connect with this
mechanism; some upgrade logic will remain intact for a bit and
can be removed later.
2024-01-12 11:58:12 -05:00
Jeff Mitchell 20ac42c851 Add some useful dev flags (#3865) 2023-10-20 14:26:58 -04:00
daniandDanielle Miu 9413837b6a pass storage an empty context so it can close cleanly (#3653)
Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com>
2023-09-22 16:00:10 -04:00
Irena Rindos 9733a250fa refact(event): move observability/event to event (#3704) 2023-09-12 08:15:34 -04:00
Elim Tsiagbey fabd4093de feat: Worker Connectivity Health Check (#3650)
* feat: Worker Connectivity Health Check

Add worker upstream connection state. API calls to the worker's ops `/heath?worker_info=1` endpoint should now return a new filed called `upstream_connection_state`

```
{
   "worker_process_info":{
      "state":"active",
      "active_session_count":0,
      "upstream_connection_state":"READY"
   }
}
```

The states returned will be GRPC connection states: https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html

There could be multiple upstream addresses but GRPC manual resolver determines the state of the connection.
2023-09-01 13:42:41 -04:00
hashicorp-copywrite[bot]andJohan Brandhorst-Satzkorn 29da0bcb92 [COMPLIANCE] License changes (#3567)
* Adding explicit MPL license for sub-package.

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUS-1.1

* Rerun make gen

This will pick up the last of the license changes

* Revert "Rerun make gen"

This reverts commit dbe0968bffd92745d8663c6940debae098395a6b.

* Remove copywrite from generation script

The current version of copywrite is not sophisticated enough
to only apply the copywrite changes to certain subdirectories,
so to avoid accidentally relicensing our api and sdk modules,
we will stop running the copywrite script until such time
that it can do the right thing.

* License protobuf API as MPL

The protobuf API files are used to generate the SDK,
since we want the SDK to be MPL, the protobuf files
must also be MPL. This extends to all protobuf files
whose sources end up in the SDK directory, including:

- internal/proto/controller/api
- internal/proto/controller/custom_options
- internal/proto/plugin

It also includes the generated service directory in
internal/gen/controller/api/services, since they are
generated from the protobuf sources used for the SDK.

* Change website license file name

This makes the naming scheme consistent with the rest
of the repository.

* Add note on licensing to README

* Set copywrite license to BUSL

* Revert "Add note on licensing to README"

This reverts commit 4d865a91a7a4f11605f0dc4609355d7e3c3cfffe.

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-08-11 10:31:53 -07:00
Todd 5a68d789ec Initialize base context when creating New worker and not at start (#3294) 2023-06-07 11:42:16 -07:00
Louis Ruch 281f217dcc feat(plugins): Refactor host plugins to boundary plugins (#3262) 2023-06-02 08:04:50 -07:00
Todd 59ae4b5901 Expand the recorder manager interface 2023-05-31 12:18:15 +00:00
Todd feb87e717e Add Closed error code and rename recorder cache to manager 2023-05-31 12:18:14 +00:00
Louis Ruch 798a1f952a feat(storage): Add support for storage plugins 2023-05-31 12:18:12 +00:00
Jim 410bec1e00 feature(worker/controller): register UpstreamMessageServiceServer 2023-05-31 12:18:10 +00:00
Louis Ruch def8e47f32 feat(storage): Add pluginInfo to storageBucket 2023-05-31 12:18:10 +00:00
Louis Ruch 52fbc6410c feat(storage): Add interface, options and errors 2023-05-31 12:18:09 +00:00
Todd bd2bca987d Add the first iteration of the recorder cache and wire it in 2023-05-31 12:18:09 +00:00
Jeff Mitchell e8559d142a Fix worker auth rotation test (#3243)
Most of the changes here are changes or enhancements that are useful for
tests. The crux of the issue was that I had pulled up one var to the
package level so it could be read from tests, but that var was not being
reset between tests. It's not even used in tests anymore, so I put it
back to function-local.
2023-05-24 23:33:51 -04:00
Jeff Mitchell 163ce184b8 KMS-PKI Workers (#3101)
This adds a new mechanism for worker authentication that uses the
third-party arbitration of the original KMS flow by leveraging
recently-added capabilities in nodeenrollment to support a registration
wrapper. This allows for workers to be registered to the system with
just a name and a matching wrapper, while at the same time allowing
these workers to be used for private Vault access and multi-hop as they
contain per-worker encryption keys and support rotation.

Nodes using this mode will generate and rotate credentials in-memory
(using another recently added nodeenrollment capability) so will have a
new set of keys on every startup. This has the side effect of ensuring
that there is never a conflict or re-use of these credentials.

Note that the normal test worker flow was using the now-deprecated KMS
method; there is still a test that uses this (explicitly) but all other
tests using test workers that did not specify a specific PKI flow now
actually use this mechanism. This means there is fairly decent test
coverage in a general sense, plus the specific tests updated/added for
this feature.

This also adds a new KMS type that can be used to have
distinct KMSes for upstream authentication vs. accepting from
downstream.
2023-03-30 16:20:28 -04:00
Jeff Mitchell b76b24a4ad Move prefixes for many packages into the globals package (#3069)
This is a prerequisite for some enhancements to grant validation
2023-03-10 15:06:39 -05:00
Johan Brandhorst-Satzkorn 3c29308673 chore: Add license headers to all files 2023-02-03 15:54:27 -08:00
Todd 87b09d5e27 Rename router to receiver for secondary connections (#2816) 2023-01-20 10:43:57 -08:00
Todd bc409bc7d4 Graceful shutdown blocks on running proxy handler connections (#2789) 2023-01-17 08:54:01 -08:00
Irena Rindos d3d1fa0b55 initial commit (#2768) 2023-01-10 08:10:54 -05:00
Irena Rindos 173e1587d0 Append initial worker upstreams if current upstreams are unresponsive (#2698)
* Append initial worker upstreams if current upstreams are unresponsive
2022-12-12 13:48:28 -05:00
Irena Rindos 5b162a4433 add worker version to network graph (#2672)
* add worker version to network graph
2022-12-02 12:36:10 -05:00
Johan Brandhorst-Satzkorn 8908dccf6d Forward port some release fixes (#2631)
* fix(worker): Verify contents of loaded session (#2629)

* fix(worker): Verify contents of loaded session

Previously, it was possible for an empty private key to be used
when the session had no user or project associated with it.
The new checks guarantee that we will fail gracefully in these
cases.

* Check against len instead of nil

* Add CHANGELOG

* fix(session): Always invoke all parts of session cancel trigger

The session cancelation trigger would not set the key_id to null
appropriately if another one of the fields on the session was
already null, since that case statement would be matched first.
The new structure matches all statements, in case any of them have
special logic (such as in the project case).
2022-11-17 18:21:20 -05:00
Irena Rindos 70e20b5cf5 revert merge llb-multihop-sessions (#2628) 2022-11-17 14:51:29 -05:00
Irena Rindos 011a7cf640 Dataplane routing (#2623)
* addition of dataplane routing
2022-11-16 15:34:39 -05:00
Jeff MitchellandTodd 0c96c6ff6c Split grace period into multiple config values (#2578) (#2603)
Co-authored-by: Todd <github@quaddi.com>
2022-11-10 13:14:57 -05:00
Todd 2a4ce02de6 Disconnect PKI workers from upstreams when they are no longer authorized (#2515) 2022-11-03 14:50:48 -07:00
Haotian 3be8b6efed refactor(metric): move common metrics functions out of 'internal' directory (#2536) 2022-10-12 11:04:32 -07:00
Todd 412e7a2418 Add interfaces and error codes for processing downstream router connections (#2511)
* Add interfaces and error codes for processing downstream router connections
2022-10-04 11:07:50 -07:00
Irena Rindos d951e1ebc1 Worker graceful shutdown (#2455)
* add graceful shutdown to worker
2022-09-19 09:59:18 -04:00
Irena Rindos fc0ead73e6 feat(workers): worker operational state (#2427)
* feat(workers): worker operational state
2022-09-12 16:10:03 -04:00
Jeff MitchellandIrena Rindos 01fb949d0b Add controller-led worker auth flow (#2413)
This adds an action to the API that allows pulling out an activation
token that can be given to a worker in its config (directly or via env
or file). The worker can pass this along with its normal request in
place of its normal nonce and the server will automatically accept it.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2022-09-02 14:32:41 -04:00
Timothy Messier 5d0cdf680f feat(worker): Support reloading of initial upstreams on SIGHUP (#2417)
On a SIGHUP, if the worker's `initial_upstreams` config option has
changed, it will use the new values as the address to send its status.
Any previously discovered upstream addresses from previous status
requests are dropped. Once a successful status request is made to the
new addresses, the worker will resume its normal behavior of using the
addresses from the response to the status request.

This allows a worker to be deployed in a more stable way in a dynamic
environment where controller IPs could change. In particular this helps
with a case where all controllers are replaced with new controllers
running on new IPs.

To illustrate with an example, suppose there is an instance group of
controllers instances. And there are worker instances that have their
config rendered from consul-template that sets `initial_upstreams` to
the IPs of the controller instances. If all controller instances are
restarted or replaced at the same time and assigned new IPs, a new
config will be rendered for the worker. Previously the only way for the
worker to use the new value would be for the worker process to be
restarted. Otherwise the worker would only know about the previous IPs
and would fail to connect to the new controllers. However, a restart
would mean any active sessions and session connections on the worker
instance would be terminated. With this update, consul-template can send
a SIGHUP to the worker, the worker will connect to the new controllers
and resume normal status reporting, allowing the sessions and session
connections to remain.

The same principles would apply for other examples of dynamic
environments such as nomad and kubernetes.

See:
    https://github.com/hashicorp/consul-template
    https://www.nomadproject.io/docs/job-specification/template
2022-09-01 14:13:42 -04:00
Jim 2818bb65cd feature (downstreams): Add hooks for optional downstream workers/router (#2359)
This includes the required interfaces, factories, error codes, etc
2022-08-12 11:08:25 -04:00
Jeff Mitchell 8800ec9c94 Reorganize logic to allow a poison pill (#2317) 2022-08-03 19:29:17 -04:00
Todd 1aad2627c8 OSS side of second downstream connections (see enterprise PR 69) (#2292) 2022-07-25 12:52:21 -07:00
Todd 155c5f578b Create session manager for workers to use to interact with sessions (#2235) 2022-07-06 13:37:49 -07:00
Todd 9af6c09c36 Move generated pb.go file in to the internal/gen directory (#2225) 2022-06-23 12:16:16 -07:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
JimandJeff Mitchell bd167da7d1 fix (worker): send workerId when authorizing session (#2207)
* fix (worker): send workerId when authorizing session

Send the workerId returned from the last success worker status
when authorizing a session.

* fixup! fix (worker): send workerId when authorizing session

* fixup! fix (worker): send workerId when authorizing session

* refactor (worker): deprecate workerId in ActivateSessionRequest

It wasn't being used anywho

* fixup! fix (worker): send workerId when authorizing session

* Update LookupSessionRequest

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-06-16 09:30:04 -04:00