Commit Graph
2084 Commits
Author SHA1 Message Date
b6df5693b5 Add generic read/update/delete commands (#3992)
* Add generic read/update/delete commands

This adds three generic commands that use the resource prefix to
determine the subcommand to run and pass through args over to that
subcommand. Since this occurs very early on and to avoid loading
essentially every internal resource package, I moved subtype definitions
to globals.

This replaces #3967

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

* De-duplicate Subtype code (#4031)

Co-authored-by: Timothy Messier <tim.messier@gmail.com>

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-11-15 19:55:46 -05:00
Sepehr 5c84a8861a Observation(event): adding op instead of type details paylaod (#4043)
* Observation(event): adding op instead of type details paylaod

* Observation(events): removing op check in details
2023-11-15 13:03:04 -08:00
Michael Li 4f262e7de5 test(bats): Use correct attribute for the test (#4033) 2023-11-10 16:45:19 -05:00
Jeff Mitchell cb1386932d Use sdk wspb library and remove internal (#4025) 2023-11-08 14:02:58 -05:00
Jeff Mitchell cf3900a906 Fix three minor issues: (#4022)
* If passing a private key without specifying it in URL syntax, give a
  proper error message (previously we were only making sure it was a
  scheme we knew how to handle, but we need to also be more informative
  if it's not a URL at all)

* If the handshake from the proxy fails, don't hang, just exit

* Update some error messages to use capitalization in line with our
  standard CLI error format
2023-11-08 12:30:54 -05:00
Damian Debkowski 12600617ba fix(plugin): remove unit test race condition (#4002) 2023-11-07 09:17:36 -08:00
Jeff Mitchell 92f7d8cfb2 Minor test fixes (#4004)
* Minor test fixes

The auth rotation test fix allows us to keep checking if we did not yet
see the expected bytes in case the call to lookup succeeds but we are
late in rotating due to parallelism.

The api credentials test fix allows us to check if at _least_ one
rotation has happened. That way if two rotations happen before we check
again due to parallelism, this is deemed a successful result.

* Add timeout to auth rotation test
2023-11-06 16:03:25 -05:00
Timothy Messier dd23f6fdbf Update websocket library (#3908)
The nhooyr/websocket library now has a release with the new default
behavior that removes the message size limit. This allows us to switch
off of the fork and back to the upstream.

In the same release that includes the fix we need for the boundary
client, the wspb helper package was removed from websocket. This package
contained some functions to read and write protobuf messages. However,
it was using the deprecated github.com/golang/protobuf/proto library. To
avoid this dependancy in the library they opted to just remove wspb.

Thus this provides a replacement implementation that uses
google.golang.org/protobuf/proto. Notably the newer proto library seems
to lack an equivalent of proto.NewBuffer so writes to the websocket and
not able to leverage a sync.Pool of byte.Buffers to reduce allocations.

Refs: 88bb253554
See: https://github.com/nhooyr/websocket/commit/ac385120c6e34fa6584f3856d5db949a21bbb65e
2023-11-06 14:59:11 -05:00
Michael Gaffney d638378d57 fix(vault): Set the Vault TLS client options if specified
Two Vault client settings were not being properly used when constructing
a Vault client.

The `TLS Skip Verify` setting was only being set if a `CA Cert` was also
configured. This fix sets the `TLS Skip Verify` when configured
regardless of other settings. Closes #3961.

The `TLS Server Name` setting was never being set. Bad programmers. This
fix now sets it on the Vault client if the Vault Credential Store has
been configured to use a value for this setting. Closes #3962.
2023-11-02 16:13:41 -04:00
Jeff Mitchell a9e372930d Revert 0bf60996c5 (#3990)
Post-merge some issues were discovered with the ways typing is used for
proto reflection. This will be reworked without moving the subtypes
around.
2023-11-02 16:03:47 -04:00
guangwu 8bb6632512 chore: remove refs to deprecated io/ioutil (#3811)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-11-01 16:54:54 -04:00
Sorawis Nilparuk (Bo) 45eb3b7b51 support remote-dev format for cluster ID (#3637) 2023-11-01 16:41:27 -04:00
Jeff MitchellandJohan Brandhorst-Satzkorn 0bf60996c5 Add generic read/update/delete commands (#3967)
* Add generic read/update/delete commands

This adds three generic commands that use the resource prefix to
determine the subcommand to run and pass through args over to that
subcommand. Since this occurs very early on and to avoid loading
essentially every internal resource package, I moved subtype definitions
to globals.

* Update main.go

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

* Update changelog and remove another deprecated command

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-11-01 16:24:16 -04:00
Jeff Mitchell de4ce93931 Update main module deps (#3971) 2023-11-01 16:21:17 -04:00
Michael Gaffney 90276b5e91 tests: Set a default job run interval based on the test deadline
The Vault Credential Store only accepts Vault tokens that have a TTL
greater than the internal job scheduler's run frequency. This prevents a
Vault Credential Store from being created with a Vault token that will
expire before Boundary can renew it.

The Vault test server, by default, creates Vault tokens with a TTL equal
to the duration of time remaining until `t.Deadline()` is reached.

This change sets the test controller's default job scheduler duration to
be half of time remaining until `t.Deadline()`. The default job
scheduler duration can still be overridden by setting a duration on
`TestConrollerOpts.SchedulerRunJobInterval`.

This change fixes the error received when running:

    go test -timeout 30s \
      -tags devlicense \
      -run '^TestList$' \
      github.com/hashicorp/boundary/internal/tests/api/credentialstores

Which returned this error:

    {"kind":"Internal",
    "message":"credentialstores.(Service).createInRepo: unable to create
    credential store: vault.(Repository).CreateCredentialStore: unknown,
    unknown: error #0: scheduler interval must be greater than token
    ttl. scheduler jobs interval value: 1m0s"}
2023-10-31 15:00:36 -04:00
Sepehr 4dce290aeb telemetry(observations): fix the details flag check (#3960)
* telemetry(observations): fix the details flag check

* telemetry(observations): fix the test names
2023-10-31 09:53:49 -07:00
Jeff Mitchell b000aa3068 Fix dev key generation (#3951)
In #2076 the refactor changed the position of a parenthesis, causing
the dev key to truncate the base64 representation instead of specifying
which bytes to base64 encode.

We don't need this slicing anymore anyways since we now do individual
key generation calls so just remove it.
2023-10-31 10:32:46 -04:00
Jim 75cef86a34 feat (authmethod/password): add additional telmemetry for passwd acct authen (#3958) 2023-10-30 18:23:23 -04:00
Johan Brandhorst-Satzkorn 6081b6c58d internal/credential: simplify TestObject test helper (#3899)
The TestObject test helper previously returned an error,
but it's easier to have it perform the error check itself,
as it conventionally done with test helpers.
2023-10-30 11:03:04 -07:00
Sepehr f9dee55e4d Telemetry(observations): add oidc and ldap observation events (#3945)
* telemetry(observations): Add observations for oidc and ldap authentications

* telemetry(observations): Add tests ldap and oidc observation events
2023-10-30 08:54:00 -07:00
Johan Brandhorst-Satzkorn 940eb61282 sqltest: fix typo (#3886) 2023-10-26 11:18:41 -07:00
Johan Brandhorst-Satzkorn 894927ffd2 internal/host: fix inconsistent receiver (#3894)
This is a lint error but wasn't caught because it was a
historic problem. It's appearing again now because we're
adding another method to this type as part of the
pagination workflow.
2023-10-26 11:16:59 -07:00
Jim 83e0e9b3f7 fix (auth/ldap): fix encoding of mTLS client key (#3929)
We need to encode the key as a PEM before initializing cap's
ldap client
2023-10-26 11:42:07 -04:00
dani c89777de41 Expose Valid Principals for Vault SSH Signed Certs (#3791)
* allow additional valid principals when creating vault ssh signed cert cred lib

* add additional_valid_principals field to credential libraries documentation page
2023-10-24 12:44:51 -04:00
Elim Tsiagbey 5741807b4a fix: monitorUpstreamConnectionState CPU consumption (#3884)
* fix: monitorUpstreamConnectionState CPU consumption

`monitorUpstreamConnectionState()` is a goroutine that listens for GRPC client connection changes using GRPC's `WaitForStateChange` method. `monitorUpstreamConnectionState()` was consuming the a lot of CPU. It was continuously running and not actually waiting for state changes. The `state` for `monitorUpstreamConnectionState()` was not getting correctly updated which caused the loop to continuously run instead of waiting for new state changes.

Update GRPC `WaitForStateChange` method to use the same `state` that gets updated.
2023-10-23 19:35:12 -04:00
Jim 1c330543a7 fix (oplog keys): fix issue with migration of oplog keys to new tables (#3868)
We inadvertently used
kms.GetWrapper(ctx, am.ScopeId, kms.KeyPurposeDatabase)
which resulted in the use of a database key for an oplog entry.
See:
https://github.com/hashicorp/boundary/pull/3665/files#diff-bcf83b5283886c98fc45b6435fdc94d87d545b2768c6beac8acd14eb9d6b13f1

This fixes the issue with the missing "Database" purpose key when
we converted the oplog keys into their own tables.

We chosen to truncate the existing oplog entries to eliminate any
references to a Database kms key in existing oplog entries.
2023-10-23 18:42:23 -04:00
Jeff MitchellandJohan Brandhorst-Satzkorn fb4a5a98dc Add some target fields and move some things around (#3879)
In preparation for putting proxy code in the api package this creates some necessary fields in the target output and it pre-moves credential parsing and proxy handshake code to their new places. This will make the diff for the actual proxy code move quite a bit smaller.

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-10-22 20:48:54 -04:00
Jeff Mitchell 20ac42c851 Add some useful dev flags (#3865) 2023-10-20 14:26:58 -04:00
Michael Li e089aa219d test(bats): Add list tests for other resource types (#3869) 2023-10-20 12:09:32 -04:00
Jeff Mitchell eb20b80c71 Migrate some credential bits around (#3864) 2023-10-18 17:48:44 -04:00
Michael Li 7f596bafa9 test(bats): Fix grant due to deprecation (#3853) 2023-10-17 13:42:11 -04:00
Jim 1ed0a13004 refact (kms): convert to the new stdlib slices pkg (#3836) 2023-10-11 20:45:50 -04:00
Devon Anderson 2180ad4241 Bump UI commit (#3804) 2023-10-06 08:12:14 -05:00
Jeff Mitchell 602bbcc43e Fix intermittent startup issues on slow systems (#3803)
With a suitably slow system -- say, if you're waiting on a Windows
Terminal to output text inside a virtual machine -- the expected order
of things can be thrown off. One specific way this can happen is that
the worker can attempt to dial and have its dial fail because of the
slowness causing the dial context to time out. If, because of the
slowness, we also haven't released the log gate yet, then the event with
the failure information will be queued, along with the context that was
used.

Unfortunately, in some of these error cases, the context that was used
was the dial context instead of the system base context. In many other
places in the function it was the system base context so this is just a
mismatch, probably from code written at different times.

Normally this wouldn't be a problem as we'd fall back to the underlying
logger, but when we release the log gate, things happen differently:
it's a synchronous function and on error it causes us to abandon
system startup entirely.

This commit fixes the issue with using the incorrect context. It's an
open question whether we should change the behavior around errors when
replaying queued events, falling back to the underlying logger instead
of erroring.
2023-10-05 20:34:57 -04:00
Devon Anderson 642ddc53c7 Bump UI commit (#3790) 2023-10-02 17:20:16 -05:00
Devon Anderson d2265a2ff3 Bump UI commit (#3787) 2023-10-02 09:36:43 -05:00
Devon Anderson 12b6f5faef Bump UI commitsh and update changelog (#3784) 2023-09-28 15:09:54 -04:00
Devon Anderson 75a103fc47 Bump UI commit (#3783) 2023-09-28 08:47:56 -04:00
Devon Anderson 790013a0cd Bump UI Commit (#3778) 2023-09-26 11:58:29 -04:00
Michael Li dc912e2a86 test: Update tests to account for deprecated features in 0.14.0 (#3776)
* chore: Fix comment typo

* test(e2e): Update to use new credential library type

* test(e2e): Update to use new field name

* test(bats): Remove tests that use deprecated subcommand

* chore: Update to 0.14.0

* test(credentiallibraries): Update to use new credential library type

* doc: Add deprecation notices for 0.14.0

* fixup! doc: Add deprecation notices for 0.14.0
2023-09-26 10:33:53 -04:00
Devon Anderson 32a036556b Bump UI Commit (#3774) 2023-09-25 12:21:01 -04:00
Jim 4ed675be16 feat (db): add Writer.IsTx(...) (#3770) 2023-09-25 04:35:40 -04:00
April Ayres f13a23eab7 fix (telemetry): ignore fields without public class 2023-09-22 14:15:23 -07: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
daniandDanielle Miu a7c1876d7b remove deprecated option application-credential-source (#3728)
Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com>
2023-09-22 15:58:18 -04:00
Sepehr 14b3237a69 fix (telemetry): filtering events: fix default deny filter behavior 2023-09-22 11:31:42 -04:00
Sepehr 167161448b Add write observation interceptors, add validation check, fix default deny filter 2023-09-22 11:31:42 -04:00
April Ayres 0216c51ffc (telemetry_filter): handle map / slice traversals of proto structs 2023-09-22 11:31:42 -04:00
April Ayres ee7c17d2dc (event_observation): use consts for request/response, code cleanup 2023-09-22 11:31:42 -04:00
April Ayres c7cd6eabf3 (telemetry_filter): handle core proto types atomically 2023-09-22 11:31:42 -04:00