Commit Graph
112 Commits
Author SHA1 Message Date
Irena Rindos d951e1ebc1 Worker graceful shutdown (#2455)
* add graceful shutdown to worker
2022-09-19 09:59:18 -04:00
Louis Ruch 5812a42ba3 feat(scheduler): set intervals from config (#2443) 2022-09-13 10:01:49 -07:00
Timothy Messier 047a66e87d fix(worker): Improper reload when running as controller and worker (#2438)
In cases where the server was started with both a controller and worker
stanza, the reload of the config was not properly setting the initial
upstream value on the new config. In this case the value is derived from
other config values and not necessarily set directly.

This now properly initializes the new config so that initial upstream is
set in the same manner as the first load.

Blame: 5d0cdf680f
2022-09-12 09:37:13 -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
Louis Ruch dcccaf1bcf bug(cmd): Ensure RunShutdownFuncs is called when an early error occurs (#2333)
* bug(cmd): Ensure RunShutdownFuncs is called when an early error occurs
2022-08-08 09:13:47 -07:00
Jeff Mitchell 8800ec9c94 Reorganize logic to allow a poison pill (#2317) 2022-08-03 19:29:17 -04:00
Jeff MitchellandJim 7ab7c8eaf4 Have fallback eventing use json format (#2216)
* Have fallback eventing use json format

The server will initialize a logger via InitFallbackLogger(...)
after setting up the server's logging (and honoring the related
cmd flags).  This fallback logger will be used if when no eventer
is initialized.

If no fallback logger is initialized, then a event.defaultLogger() will
be used if no eventer is defined.

Co-authored-by: Jim <jlambert@hashicorp.com>
2022-07-11 16:12:02 -04:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
Jeff Mitchell 32d04b9ce7 Allow a worker to use KMS auth but accept PKI for proxy (#2206)
This essentially worked for non-dev mode before but would create storage
directories that weren't actually used or needed, and it didn't work in
dev mode because it made assumptions about the presence of a worker auth
kms or not. This fixes those behaviors.
2022-06-15 22:39:52 -04:00
Jeff Mitchell 9a4545e59e Fix eventing and worker name setup (#2204)
* Don't automatically create worker names, as this is now invalid for
  PKI workers
* Fix a check in dev that clears out name/description in exactly the
  wrong cases
* Change eventing setup to use a hostname-based ID instead of the name
  (which could change on every start anyways)
2022-06-15 20:01:03 -04:00
Jeff Mitchell 4efbce3112 Add description updating via worker status (#2197) 2022-06-15 15:50:36 -04:00
Haotian 40ba275759 feat(worker): add 'initial_upstreams' field to worker config to prepare to replace 'controllers' field. Update worker config description on website. 2022-06-13 15:45:03 -07:00
Jeff Mitchell 5a7291131f Make current key update on rotation 2022-06-10 09:33:09 -04:00
irenarindos 594e6e82b5 feat(worker): save workerAuth request to a file 2022-06-09 10:40:30 -04:00
Jeff Mitchell 9736b79d4e Remove temporary node authorization functions (#2147) 2022-06-07 14:56:04 -04:00
Jeff Mitchell d1b3b2441f Add node rotation (#2142) 2022-06-07 14:26:33 -04:00
Jeff Mitchell aa0afd325a Remove 'ephemeral' from KMS auth method bits (#2141) 2022-06-06 14:52:47 -04:00
Jeff Mitchell 4117841cf9 Use persistent storage for worker auth credentials (#2139) 2022-06-05 22:50:44 -04:00
Jeff Mitchell caf19f867e Rename some variables to remove Nodee 2022-06-03 17:47:44 -04:00
Haotian 631c174f47 feat(worker): implements WorkerAuthStorage wrapper for worker credential encryption (#2076)
* Adds WorkerAuthStorage wrapper for worker credential encryption using nodeenrollment library.

* Adds AuthStoragePath field in worker config and dev mode to specify directory to store credentials.
2022-06-03 13:25:58 -07:00
Jeff Mitchell 46e97a2b91 Update to new nodee lib bits (#2120) 2022-06-01 13:35:46 -04:00
Jeff Mitchell f6ef708466 Update against new nodeenrollment registration cache 2022-05-20 10:25:54 -04:00
Jeff Mitchell 0581e164f1 Update nodeenrollment dep 2022-05-16 09:02:09 -04:00
Todd d8a443e238 Merge branch 'main' into llb-byow
# Conflicts:
#	internal/daemon/controller/handlers/targets/target_service.go
#	internal/daemon/controller/handlers/workers/multihop_service.go
#	internal/daemon/controller/handlers/workers/worker_proxy_service.go
#	internal/daemon/controller/handlers/workers/worker_service.go
#	internal/daemon/worker/status.go
#	internal/daemon/worker/worker.go
2022-05-09 14:14:52 -07:00
Todd b58dada40d Move the server daemons into their own package (#2061)
* Move the server daemons into their own package

With this change the internal/server package now is dedicated to the server domain (workers and controllers) and not to the server daemons.
The hope is that this will make it easier to keep the daemons decoupled from the representation of the servers in the database.
2022-05-09 12:45:10 -07:00
Jeff Mitchell f748af7b02 Initial BYOW auth PoC (#29) 2022-05-09 13:28:17 -04:00
Hugo Vieira 61e310998f refactor(worker): Decouple listeners/servers shutdown
This change is the Worker-side counterpart to the change in
eebdfb88dc.
2022-03-29 16:46:02 +01:00
Hugo 244237cd2f feat(controller): Add health endpoint (#1882)
* feat(controller): New health service and server

This change also implements a new listener purpose, `ops`.

`ops` (short for operations) is a new listener purpose that is
responsible for serving Boundary's operations endpoints, like health
and possibly metrics.

At Startup: `ops` listeners get configured as late as possible to catch
any errors with the startup process;

At Shutdown: If the health endpoint has been set-up, we introduce a
configurable delay in the process. This is to enable the health endpoint
to report unhealthy for that amount of time. `ops` listeners are also
the last listeners to be shutdown.
2022-03-28 17:16:39 +01:00
Hugo Vieira eebdfb88dc refact(controller): Decouple listeners/servers shutdown from Worker
In general, these changes were introduced in the same vein of the
changes to controller `startListeners`.

Specifically, these changes also decouple the Controller and the Worker
shutdown processes. Currently, a call to `stopListeners` on an instance
that is running as both a Controller and a Worker would stop the
listeners for both.

Lastly, we also add unit/integration tests to the shutdown code.
2022-03-25 15:04:23 +00:00
Jeff Mitchell e596daf34d Add hclog adapter and gating to eventer (#1915)
This contains to related things:

1. An adapter allowing an hclog interface to take in information and send them to the eventer
2. A gate on the eventer, which is the analogue to the behavior prior to eventing where we'd ensure logs were not printed prior to the startup information. Without this, plugin logs using the hclog adapter will start showing up too early.
2022-03-16 17:25:34 -04:00
Jeff Mitchell 7eb29261b2 Update to go-kms-wrapping version 2, and plugin-based KMS (#1901) 2022-03-16 17:04:07 -04:00
Jeff Mitchell dc2148496b Actually enable loopback plugin in dev (#1742) 2021-11-24 20:58:41 -05:00
Jeff Mitchell 95568ef07f Fix tests using multiple controllers (#1734)
The previous PR only initialized plugins if they were required, which
meant that there may not actually be a plugin manager running because a
second node would not actually create the dev database, which is where
the plugin was being added. The assumption that a plugin manager is
running is still a fine one at the moment, but we just need to make sure
it's running in _all_ cases.
2021-11-18 16:01:15 -05:00
Jeff Mitchell 5559cf54d3 Don't always assume plugins should be activated (#1732) 2021-11-18 11:53:45 -05:00
Jeff Mitchell 8cd8453113 Update dev loopback host plugin flag name 2021-11-15 14:45:48 -05:00
Jeff Mitchell 48ac8b8f0b Merge branch 'main' into plugin-hostcatalogs 2021-11-07 18:47:28 -05:00
Jim eecd878b36 feature: Add signing (hmac-sha256) of audit entries (#1666) 2021-11-05 20:44:33 -04:00
Jeff Mitchell b9269ce93c Update available actions for host resource (#1659) 2021-11-03 12:39:41 -04:00
Jeff Mitchell 0fd906d964 Merge branch 'main' into plugin-hostcatalogs 2021-10-21 11:47:13 -04:00
Timothy Messier eac433f7ff refact(target): Move tcp into subpackage
This moves all of the tcp target functionality into a tcp package. It
also establishes a Register function in the target package to allow
specific target types to be registered at initilazation time. When
registering, a target type needs to provide its Subtype, as well as some
RepositoryHooks that are used by the target Repository.
2021-10-19 10:44:51 -04:00
Jeff Mitchell f01a8060a0 Merge branch 'main' into plugin-hostcatalogs 2021-10-14 12:14:07 -04:00
Jeff Mitchell c05324282f Rename the UI passthrough dir flag/env var (#1600)
This puts it more in line with other upcoming options that use "dir"
instead of "directory" (plus it's easier to type), and makes it clear
that this directory and the passthrough behavior is related to the UI as
opposed to other upcoming items.
2021-10-14 12:13:07 -04:00
Jeff Mitchell 1c8e0ed1e1 Add scaffolding for external host plugins and convert aws/azure over (#1581) 2021-10-14 11:56:08 -04:00
Jeff Mitchell 70e6536919 Swap server interface for client (#1580) 2021-10-07 11:56:39 -04:00
Jeff Mitchell 158ab09952 Merge branch 'main' into plugin-hostcatalogs 2021-10-05 16:27:28 -04:00
Jim 8d6dee09a9 refact: Add db.DB wrapper and refact all test fixtures to use it. (#1535)
* refact: Changes required for gorm v2

* refact: Add db.DB wrapper and refact all test fixtures to use it

Stop leaking the gorm abstraction within our unit tests.

* refact: Migrate direct calls to pq to pgx driver

The refactor will remove the remaining direct dependencies on
the pq driver which has been deprecated in favor of the pgx
driver.

It includes the addition of common.SqlOpen which is a wrapper around
sql.Open, which is needed to deal with the driver name changing from
"postgres" to "pgx" but in our code base the dialect and driver are
synonyms.
2021-09-30 09:17:27 -04:00
Jeff MitchellandTodd 7d71618df0 Add more host-catalog and host-set CLI support (#1567)
Add more host-catalog and host-set CLI support

Co-authored-by: Todd <T.Alan.Knight@gmail.com>
2021-09-28 09:40:12 -04:00
Jim 3a3f956615 support new event formats of: hclog-text and hclog-json (#1440) 2021-08-03 15:06:19 -04:00
Jim 68dd2a66ba Remove unneeded hclog dependencies as we move forward with events (#1433) 2021-08-01 14:41:13 -04:00
s-christoffandJim 6b78108ecf Update primary error functions to take a context, deprecate old functions (#1358)
* add new error funcs which take a ctx and deprecate existing funcs

* use context where available when writing error events

* remove circular internal/errors pkg dep

* suppress some chatty errors using errors.WithoutEvent()

* convert auth oidc funcs to take context where needed to write events

Co-authored-by: Jim <jlambert@hashicorp.com>
2021-07-29 20:52:56 -04:00