Commit Graph
2328 Commits
Author SHA1 Message Date
Louis Ruch d7c4c648ec bug(vault): Correctly handle credential stores with expired tokens (#2399)
* bug(vault): Correctly handle credential stores with expired tokens

Boundary makes use of a database view to perform CRUD operations on
Vault credential stores and libraries. This view did not include
credential stores with tokens that have expired in Vault, causing
errors when attempting to perform any action against them.
2022-09-06 07:50:15 -07:00
Jeff Mitchell ef4000fe08 Update AWS plugin (#2420)
This adds region information to IAM calls in AWS plugin and hopefully
fixes #2233
2022-09-02 14:40:54 -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
Jeff Mitchell a1be125f5b Pull in updated AWS plugin to fix #2224 (#2419) 2022-09-01 15:27:24 -04:00
Ryan Cragun 6983bb7d41 enos: don't fail fast in enos integration matrix (#2416)
Disable the fail-fast feature for the matrix strategy. This prevents a
single failure to cascade to all jobs in the matrix. This prevents cases
where other jobs fail before they're able to clean up resources.

Signed-off-by: Ryan Cragun <me@ryan.ec>
2022-09-01 13:16:56 -06: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
Johan Brandhorst-Satzkorn de2c40fa77 Fork pgtap-docker to support arm64 (#2411)
* feat(sql): Fork pgtap to support arm64

This forks pgtap-docker and builds the image locally,
and updates our references to use our forked image.

* fixup! feat(sql): Fork pgtap to support arm64
2022-09-01 11:33:10 -04:00
Zhihe Li a73d85472f chore: Add redirect docs for worker (#2383) 2022-09-01 10:28:07 -04:00
Irena Rindos db21ead31c Vault proxy supporting code (#2415)
* Vault proxy supporting methods
2022-08-31 12:40:35 -04:00
Damian Debkowski 3f70644978 fix(db): update host_plugin_set to set project_id value (#2410) 2022-08-30 16:37:16 -07:00
Jeff Mitchell 9b271d7dd8 Fix error about unimplemented HcpbWorkers call (#2361)
Although there is a compile time check on the type, it will always
succeed due to the Unimplemented embedding requirement.

As a result, this PR also changes Unimplemented calls to Unsafe calls,
which were added later "for those that prefer their code to break"; the
comments on these state:

// UnsafeXServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to XServiceServer will
// result in compilation errors.

See https://github.com/grpc/grpc-go/issues/4500#issuecomment-852597871
for some more context.

I think we're fine with compilation errors though; we own both the
server and client side of things and generally are going to add new
methods only when we intend to also add them on the client side.
Notably, what the comment does not indicate is that it will break at
runtime; already it should return a suitable (404 or 405) error if the
client requests a method that does not exist.
2022-08-30 14:22:10 -04:00
Haotian 17ddc301a8 feat(cli): add/set/remove worker tags (#2266)
* adds CLI commands for add/set/removing worker tags, and respective tests
* adds StringSliceMapVar Flag to convert a string from the CLI to a map[string][]string value
2022-08-26 13:37:26 -07:00
Irena Rindos 547e7a5970 docs(workers): add documentation for pki worker cred encryption (#2397)
* docs(workers): add documentation for pki worker cred encryption
2022-08-26 13:08:18 -04:00
Jeff Mitchell 1cb287bdbe Update README.md 2022-08-25 14:59:23 -04:00
Irena Rindos b4b95e0f0e refactor(vault): add context and remove deprecated errors (#2396)
* refact(vault): add context and remove deprecated errors
2022-08-25 14:37:22 -04:00
Johan Brandhorst-Satzkorn aef9073fa6 Upgrade to Go 1.19 (#2347) 2022-08-25 12:12:24 -04:00
Danielle 07a4082aa1 Add SQL Migration 05 From go-kms-wrapping (#2371)
* adding sql migration 05 from go-kms-wrapping

* rename file from 05 to 01 to match boundary standards

* move key rewrap to folder 47
2022-08-25 12:06:43 -04:00
Johan Brandhorst-Satzkorn d709b97e18 fix(schema): Panic with error rather than function (#2391) 2022-08-24 20:42:21 -04:00
Johan Brandhorst-Satzkorn ac591d8283 fix(managed_groups): Fix validation function panic (#2390)
The logic would panic if no attributes were specified. Ensure
that attributes are non-nil before checking any sub fields.
2022-08-24 18:01:54 -04:00
Renato Costa ec3d2ef360 Fix incorrect use of loop variable in parallel tests (#2389)
This fixes occurences of a loop variable being captured in parallel
tests. With the previous code, only the last test case is actually
exercised. To work around this problem, we create a local copy of the
range variable before the parallel test, as suggested in the
documentation for the `testing` package:

https://pkg.go.dev/testing#hdr-Subtests_and_Sub_benchmarks

Issues were found automatically using the `loopvarcapture` linter.
2022-08-24 16:46:29 -04:00
Irena Rindos b43e61c8c7 bug(workers): Create worker-led panics on invalid token (#2388)
* Check for error before returning result
2022-08-24 14:43:15 -04:00
Jim b0bc6bd632 refactor: eliminate gorm references in favor of go-dbw (#2386) 2022-08-24 14:11:49 -04:00
Louis Ruch 929a385fdb fix: move 'drop target_all_subtypes' after whx views 2022-08-24 09:33:37 -07:00
Irena Rindos 4aa09242ab Fix dev Docker build (#2380)
* Fix dev Docker build
2022-08-24 09:05:25 -04:00
Irena Rindos dde0c35f23 Update request data in session manager (#2369)
* bug(session): Update request data in session manager
2022-08-24 09:03:29 -04:00
Louis Ruch 564affa294 chore: Add 0.10.2 changelog 2022-08-23 15:36:27 -07:00
Josh Brand 8c0efb9715 Enos: add additional guards before authentication (#2382)
* Enos: add additional guards before authentication

Previously, we would see failures when the ALB in front of a
cluster was alive and passing healthchecks, but the database behind
had not been initialized yet.  This adds a check with an unauth'd
call to `auth-methods list` to validate the DB is up before auth.
2022-08-23 14:46:24 -04:00
Damian Debkowski 27e9f775be feat: add initial migration hook 2022-08-22 12:15:20 -07:00
Timothy Messier 79866a287f feat(schema): Add support for migration hooks
This adds the ability to define hooks that will run prior to a schema
migration. The hooks should only be used when a migration would fail due
to data being in an invalid state, likely due to a bug in the previous
schema definition. For example if a column was missing a constraint, and
a new migration is attempting to add the constraint, there might already
be values that violate the new constraint. In such cases, we would want
the user to make a decision to address the data, and need to provide
them with details about what data is problematic in case they want to
manually address the problem. To help the user, if there is a sane way
to address the data, we should provide an option to automatically
"repair" the data, allowing the migration to continue. However, this
still should be an explicit opt-in from the user, and we need to clearly
describe what the repair option would do to the user so they understand
the consequences of opting in.

To accomplish this each migration can be provided a hook that contains a
CheckFunc, RepairFunc, and RepairDescription. These functions must
operate at the point-in-time of the migration immediately preceding the
current migration, as as such they should not use and domain packages or
repositories, instead they should use direct sql with the sql library.
The description is used to explain what the RepairFunc will do.

Hooks should be defined in `internal/db/schema/migrations/oss/oss.go`
and registered with the schema edition.

See the example in `internal/db/schema/manager_example_test.go` for more
details.
2022-08-22 12:15:20 -07:00
Michael Gaffney 1fa79e9aa1 test(db): Add tests for inserts into target_host_set 2022-08-22 12:15:20 -07:00
Michael Gaffney 0512ddb060 test(db): Add tests for inserts into target_credential_library 2022-08-22 12:15:20 -07:00
Damian Debkowski c4aa9a0358 test(sql) add tests to validate project scope for target_static_credential 2022-08-22 12:15:20 -07:00
Jeff Mitchell a56d7aa4d0 Ensure that "null" can only be specified in "set-" commands (#2363)
This allows a check function to be set to determine whether it is
allowed to be set. This also ensures that if null is allowed it is
either the only value or not set.
2022-08-22 14:53:49 -04:00
Jeff Mitchell a7bde08eee Pull in AWS plugin v0.1.1 (#2379)
This adds normalization to the filter field.
2022-08-19 13:37:16 -04:00
Jeff Mitchell 7364d84835 Add mechanism for plugin to normalize attributes (#2376)
* Add mechanism for plugin to normalize attributes

This introduces a new normalization call to the plugin RPC service. If
implemented, the plugin will be given the attributes prior to saving
them in a create/update call, and can perform any normalization needed,
e.g. ensuring that a parameter passed in is represented in a canonical
way. As an example, the CLI allows a user of the AWS plugin to pass in a
string, but canonically it is a string slice, and should be returned
that way as well. Not by chance, this is the exact behavior of the
testing implementation of this function.

This does not update any individual plugin, but rather sets the
controller-side logic up for plugins to support this functionality.
2022-08-18 15:39:30 -04:00
Johan Brandhorst-Satzkorn d4fce6fbe1 fix: Move enos job attribute into enos-run workflow (#2374)
Maybe this will fix it? This doesn't make any sense.
2022-08-17 20:39:12 -04:00
Johan Brandhorst-Satzkorn 91e6857631 fix: Use correct yaml (#2373)
Didn't notice this until it failed on main
2022-08-17 20:27:26 -04:00
Johan Brandhorst-Satzkorn b6445adff0 feat: Stop enos jobs from failing CI pipelines (#2372)
Enos jobs are still a bit unstable, we should use them as
advisory for now. When they have gained more stability,
we can let them fail pipelines again.
2022-08-17 19:56:06 -04:00
Johan Brandhorst-Satzkorn e8b2104a80 fix: Update Dockerfile to use new PRODUCT_VERSION arg (#2370)
This is necessary since the merge of https://github.com/hashicorp/actions-docker-build/pull/25
2022-08-17 16:02:29 -04:00
Jeff Mitchell b89430772b Update azure host plugin (#2368)
Fixes #2348
2022-08-17 15:23:02 -04:00
Jaymala 369f818f4c Update Enos run (#2326)
* Rotate the credential used for the Enos SSH Key
* Use the enos provider from TFC

Signed-off-by: Jaymala Sinha <jaymala@hashicorp.com>
2022-08-16 11:07:19 -06:00
Adam Bouhmad e1a6a60cce 0.10 release notes (#2352)
* 0.10 release notes

This PR proposes the addition of the 0.10.0 release notes to the Boundary Docs page

* update nav structure to include 0.10.0

* Update v0_10_0.mdx

Added link to HCPb Credential Injection Tutorial
2022-08-15 14:29:31 -07: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
Johan Brandhorst-Satzkorn 222a935223 Update grpc-gateway dependency (#2311)
* chore(deps): Update grpc-gateway dependency

This fixes an issue which would allow an attacker to trigger a
(recovered) panic in the gateway handler.

* fix(server): Use cmp.Diff instead of assert.Equal

Testify is not great at handling protobuf types, and
was for some reason returning a diff here when in
reality there is none. Switch to go-cmp for the
comparison to remove the error.
2022-08-11 20:24:14 -04:00
Louis Ruch 66d536eb5d chore: prep for next release 2022-08-11 15:59:11 -07:00
Louis Ruch 5b3672536e chore: prep for next release 2022-08-11 14:34:00 -07:00
Zhihe Li 4e9f4ff0cc chore: Bump UI commitsh and update changelog (#2356) 2022-08-11 16:33:42 -04:00
Jeff Mitchell 94dd7d9305 Update to latest sdk tag 2022-08-11 15:18:18 -04:00
Jeff Mitchell f1b737c62e Fix error validation code in attr parsing (#2353)
For a flag type used for attributes/secrets, values have always been
able to be used with env:// or file:// format, but the error check to
see whether the value was successfully parsed was doing a simple string
equality rather than `errors.Is`. As a result a value containing a colon
would trip up this check and cause an error, rather than allowing it to
be used as a bare value.
2022-08-11 14:39:32 -04:00
Louis Ruch d01f374490 bug(db): Fix credential purpose migration (#2351)
* bug(db): Fix credential purpose migration
2022-08-11 10:41:48 -07:00