Commit Graph
2403 Commits
Author SHA1 Message Date
Irena Rindos bd4f5f3801 update worker auth rotate (#2484) 2022-09-22 13:13:31 -04:00
Jamie Finnigan f6532c6cd6 tighten access to /boundary/config.hcl in container images (#2471) 2022-09-21 16:27:58 -07:00
Zhihe Li bbd006db85 Update changelog (#2482) 2022-09-21 16:04:22 -04:00
Louis Ruch b78d83e242 log(vault): Log formatted duration instead of nanoseconds (#2481) 2022-09-21 12:04:29 -07:00
Zhihe Li 423f3be251 Bump UI commitish (#2480) 2022-09-21 09:33:20 -04:00
Dharini Jeeva 8b71307556 add aws region website redirect (#2476)
* add aws region redirect
2022-09-20 12:59:44 -07:00
Johan Brandhorst-SatzkornandTimothy Messier 5dbcda512a Fix enos bats test errors (#2468)
* test(cli): Remove skips in CI for cli tests

* fix(enos): Fix enos bats tests

The tests still sometimes suffer from timing issues,
but I was able to run a successful run (setup, run, destroy)
of the tests from my machine at least once.

There were 2 issues:

- Some tests in groups.bats were hardcoding the default user id
- The default grants for a user in a project were missing
   the permission to connect to a target. We now add this
   explicitly.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2022-09-20 14:39:28 -04:00
Timothy Messier 01206eb586 chore(build): Allow for downloading pre-built admin ui assets (#2475)
The admin ui assets are built via a github workflow and published as
github a artifact. The artifact can be downloaded, avoiding the need to
build the assets again locally, and eliminating the need for front-end
build tools like yarn and npm.

This updates the `build-ui` target to use a new script that will attempt
to download the pre-built assets. Note that this script requires that
the `gh` cli is installed since an authenticated request is necessary to
download the workflow artifacts. If the artifact cannot be downloaded
either due to the lack of `gh` or because the artifact cannot be found,
it will fallback to using `git clone` (and will require yarn to build
the assets).

See:
    https://cli.github.com/
    https://docs.github.com/en/rest/actions/artifacts
    https://github.com/actions/upload-artifact/issues/51
2022-09-20 11:14:02 -04:00
Todd 06fd086004 Add health endpoint for worker (#2442)
* Return worker process information in the health endpoint.

Experimental:  The worker_info and returned worker_process_info fields are experimental and can change or be removed without notice.

When a user passes in "worker_info=1" or "worker_info=true" and a worker is running the returned json will be returned with a key named "worker_process_info" which value is a json object with information about the worker process.
2022-09-19 11:24:42 -07:00
Jamie Finnigan 54b3d36946 update Dockerfile to use more recent Alpine 3.13 releases (#2467) 2022-09-19 12:39:59 -04:00
Zhihe Li 309574b694 bump UI commitish (#2470) 2022-09-19 11:08:28 -04:00
Irena Rindos d951e1ebc1 Worker graceful shutdown (#2455)
* add graceful shutdown to worker
2022-09-19 09:59:18 -04:00
Timothy Messier a2ef14283b fix(org): Address bug that prevented deleting an org (#2465)
The schema changes introduced in 0.10.2 introduced a bug where an org
could not be deleted if there was a session for an org scoped user. It
would result in an error like:

    scope.(Service).deleteFromRepo: unable to delete scope: \
        iam.(Repository).DeleteScope: failed for o_VkNy46KwfS: \
        iam.(Repository).delete: db.DoTx: iam.(Repository).delete: \
        db.Delete: insert or update on table "session" violates foreign key constraint "target_fkey": integrity violation: error #1003

A worker around would be to first delete all projects in the org, then
finally delete the org.

This fix adds a regression test to the sqltests and updates several
constraints on the session table to be deferrable. Since the org delete
is a single transaction, this allows all of the necessary resources to
be deleted before attempting to enforce these constrains.

See: https://www.postgresql.org/docs/current/sql-set-constraints.html
Blame: 3a28ab614
2022-09-19 09:47:52 -04:00
Louis Ruch 42696d5da6 enos(smoke): Test brokered credential consumption instead of manually (#2456)
passing private key to boundary connect
2022-09-16 15:41:38 -07:00
Cameron Perera 3753f6d882 website: update host catalog redirects & add new host set redirects (#2466) 2022-09-16 17:05:57 -05:00
Damian Debkowski 546c5dc5be feat: static json credentials (#2423) 2022-09-16 15:00:04 -07:00
Michael Li 8c53d931aa Merge pull request #2425 from hashicorp/moduli-e2e-test-connect
Add "Connect to Target" tests to new end-to-end test suite
2022-09-16 16:12:25 -04:00
Michael Li 21e4b70e27 test(e2e): Add end-to-end tests (connect to first target)
This adds the initial end-to-end tests. These tests validate the admin workflow
of setting up their first target
2022-09-16 15:30:12 -04:00
Michael Li 172381f273 refact(enos): Move modules to its own file
Enos allows module definitions to be in any file. This keeps all of the modules
in one place (and also follows the model used by Vault)
2022-09-16 15:30:12 -04:00
Timothy Messier f19184ba72 Merge pull request #2462 from hashicorp/tmessi-cli-ui-dev
chore(cli): Run bats tests against boundary dev in CI
2022-09-16 15:25:22 -04:00
Johan Brandhorst-SatzkornandYoko Hyakuna 5dc7e7f55c doc: Add link to generated API docs on API page (#2460)
* doc: Add link to generated API docs on API page

This makes it easier to find the generated API docs from the API
description page.

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

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>

Co-authored-by: Yoko Hyakuna <yoko@hashicorp.com>
2022-09-16 12:02:15 -04:00
Timothy Messier f28bcd4aa7 chore(cli): Run bats tests against boundary dev in CI
Several of these tests are being skipped in the enos
run. This seems to be due to differences in the setup that is performed.
When these tests were run manually, `boundary dev` was used which
performs some setup of resources automatically. However since enos uses
a non-dev controller, a similar setup is performed via the enos modules.

Until the discrepancies between the setup can be investigated, this adds
a separate CI job to run the tests against `boundary dev`. These tests
are all passing, without any being skipped. This test suite can still be
useful even if the enos version is fixed, since this test suite will run
much faster, and therefore identify failures sooner.
2022-09-16 15:54:55 +00:00
Timothy Messier c41e31381d test(cli): Fix session read and cancellation test 2022-09-16 15:54:10 +00:00
Kevin Wang 4f69fcedbb fix(website/Makefile): mount /../internal/gen (#2461) 2022-09-16 11:18:30 -04:00
Irena Rindos 821d8317dc address op state review feedback (#2453)
* address op state review feedback
2022-09-16 09:13:37 -04:00
Louis Ruch c73a13aa3e scheduler: log details when starting scheduler (#2459) 2022-09-15 11:44:45 -07:00
Irena Rindos e588623ebd docs(vault): add Vault worker filter documentation (#2404)
* docs(vault): add Vault worker filter documentation
2022-09-15 13:18:22 -04:00
06370867c7 website: content updates for developer (#2426)
* chore(website/nav-data): sup to badge
```
            "badge": {
              "text": "OSS Only",
              "type": "outlined",
              "color": "neutral"
            }
```

* update previews to render developer UI

* Apply suggestions from code review

* update redirects

Co-authored-by: Kevin Wang <kwangsan@gmail.com>
Co-authored-by: HashiBot <62622282+hashibot-web@users.noreply.github.com>
2022-09-15 10:27:10 -04:00
Jeff Mitchell 53b5e532d5 Remove deprecated methods/fields on targets (#2393) 2022-09-15 09:20:08 -04:00
Dharini Jeeva 54cdaaada8 add worker tags redirect (#2447) 2022-09-14 12:48:39 -07:00
Louis Ruch 506fdfa5c3 cli(ssh): Do not print private key if consumed (#2451) 2022-09-14 12:46:34 -07:00
Damian Debkowski 5dfabe5f90 fix: show warning log when token will expire before it can be renewed (#2446) 2022-09-14 09:35:37 -07:00
Jeff Mitchell 37fb9815ce Add session endpoint test for #2448 (#2450) 2022-09-13 20:29:58 -04:00
Yoko Hyakuna fa619b0910 Address reported bugs (#2449) 2022-09-13 19:48:06 -04:00
Timothy Messier 2b994f3005 fix(perms): Properly resolve "only self" for permissions (#2448)
When generating permissions from the grants, if a single grant was
limited to the set of "self" actions, the permission would be marked as
only self, even if additional grants were given for non-self actions.
This would result in the generated permissions being more limiting then
they should be based on the grants. This only impacts the sessions list
endpoint. It would result in users that have been granted access to list
other user's sessions to be unable to see these results in the list
results.
2022-09-13 19:46:52 -04:00
Louis Ruch 50490d71ae chore(targets): Improve help and errors around ssh targets (#2445) 2022-09-13 13:05:36 -07:00
Damian Debkowski 2db6bee3e2 fix: return an error for vault tokens that will expire before the scheduler can run (#2444) 2022-09-13 10:43:49 -07:00
Louis Ruch b908cfb860 chore: prep for next release 2022-09-13 10:16:48 -07:00
Louis Ruch 5812a42ba3 feat(scheduler): set intervals from config (#2443) 2022-09-13 10:01:49 -07:00
Timothy Messier d0a61b29b8 chore: Add missing items to changelog (#2440)
Add items for SIGHUP database reload and performance improvements.
2022-09-13 07:55:39 -04:00
Irena Rindos fc0ead73e6 feat(workers): worker operational state (#2427)
* feat(workers): worker operational state
2022-09-12 16:10:03 -04:00
Hugo f3f0c55d91 Merge pull request #2422 from hashicorp/hugoamvieira-controller-dbswap
If the database url is updated on Boundary's config and then a SIGHUP
triggered, we now connect to the new database, ensure it's OK to use
and use that one going forwards instead.

This allows a controller to be deployed in a more dynamic infrastructure
where, for example, database credentials could change, without having
to restart the controller.

This operation is done atomically to prevent errors and inconsistency. 
A timeout is present so that if the object is swapped after the 
existing one has been looked up it isn't immediately invalidated. 
The timeout is a maximum; a ticker once a second that looks at
stats to determine how many database connections are still in use 
and then closes the driver as soon as none are in use.
2022-09-12 18:05:11 +01:00
Jeff Mitchell 9002930d65 Adapt shared lock skip logic to dbswap branch (#2437) 2022-09-12 17:55:32 +01:00
Hugo VieiraandJeff Mitchell bed6e1a0ff feat(server): Reload database on SIGHUP
If the database url is updated on Boundary's config and then a SIGHUP
triggered, we now connect to the new database, ensure it's OK to use
and use that one going forwards instead.

This allows a controller to be deployed in a more dynamic infrastructure
where, for example, database credentials could change, without having
to restart the controller. In this case only a database url config
change and a SIGHUP signal to all controllers would be required.

This uses an atomic.Pointer to store wrapped DB objects. This allows
atomically swapping to the new object. A timeout is introduced so that
if the object is swapped after the existing one has been looked up it
isn't immediately invalidated. The timeout is a maximum; a ticker once a
second that looks at stats to determine how many database connections
are still in use and then closes the driver as soon as none are in use.

This could be done with mutexes to avoid checking stats in a loop, but
that carries its own risk: if a write lock is attempted to be acquired
while a query is holding a read lock, the write lock will block, and any
subsequent read locks will also block since write locks take priority.
As a result, if a query is long-running or timing out, all other queries
in the system will become blocked. Our default user request timeout is
90 seconds and some jobs have no timeout at all, so this is not a purely
theoretical concern, even if it's unlikely.

Refs: #2435
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-09-12 17:55:32 +01:00
Hugo Vieira 8ab9ffbcac refact(cmd): Encapsulate some functionality on Command and Server
This commit extracts 3 separate pieces of functionality into their own
function/method:

- Extracts the database opening with the intention to have a function
  that performs all that functionality but returns the created database
  object rather than setting it to the Server structure.
- Extracts database validation logic, to provide a common code path for
  upcoming functionality.
- Expose schema manager on the Command struct as well as providing
  common functions to acquire shared lock/close.
2022-09-12 17:55:32 +01:00
Hugo Vieira 621f8a9ff2 fix(schema): Database connection not cleanly closed
This commit introduces closing the Schema Manager's underlying driver
connection. We were only releasing the shared lock but not actually
cleaning up the db connection and relied on the fact that the process
would exit to do that for us.
2022-09-12 17:55:32 +01:00
Jeff Mitchell 8e969787f9 Update CHANGELOG.md
Fix 0.10 -> 0.10.0.
2022-09-12 12:32:01 -04: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
Todd 0b942f4493 Only clear tags in set-worker-tags when "null" is set as the value of the -tag flag. (#2434) 2022-09-08 11:15:03 -07:00
Irena Rindos 18dff62b7b Merge BYOW GA branch to main (#2398)
* feat(workers): Add ability to read and reinitialize cert authority (#2312)

* feat(workers): Return Release Version on worker list and read (#2377)

* feat(cli): Read and reinitialize worker certificate authority (#2387)
2022-09-08 13:19:21 -04:00