This allows arbitrary programs to have an easy mechanism to make
connections through Boundary using Go. Internal cluster tests and test
helpers have been migrated to use this package, as well as the `connect`
command.
---------
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
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.
The commands added are:
boundary daemon start
boundary daemon stop
boundary daemon add-token
boundary daemon status
boundary search
If these actions are performed on a platform that doesn't support sqlite
natively in go an error is returned.
Besides some hooks into the cmd package all the significant logic
resides in internal/clientcache
feat (cmds/authenticate): output the token name when storing token
feat: update go-dbw which now uses pure go sqlite driver
refact (base.Command): export FlagOutputCurlString
Exporting FlagOutputCurlString allows other commands that embed
the base.Command to access the flag as needed
feat: add a cache Repository to manage cache storage
feat: add a "cache" CLI command
This new command will support both managing and searching the
local CLI cache daemon.
feat: start cache daemon as needed when issue CLI commands
Move files to new directories and add persona table (#3526)
* Add persona table and move files to new directories
Client daemon now uses unix sockets and update pathing (#3535)
* Add unix socket listen and dialers with file permissions applied
* Update the pathing to match RFC
Cache refreshing now uses all stored personas. (#3545)
Updating headers for LLB files
Decouple daemon and cache server (#3566)
* Separate daemon from server
* Add persona handler to daemon server (#3579)
Moved search to use mql and added tests for the search command (#3589)
* search uses hashicorp/mql
Windows support for client side daemon (#3618)
* exec.Command for background process
* Log to stderr when in foreground and file always
* Use pid files across platform for start and stop
Requests with version info must match the daemon's version (#3640)
* requests with version info must match daemons
Update dependencies and breakout cgo/pure go sqlite drivers (#3657)
upgrade go-dbw deps and add cgo build tags
Enable graceful shutdown in windows (#3695)
* Enable graceful shutdown in windows
Co-authored-by: Jim <jlambert@hashicorp.com>
Targets delete when a persona changes address or user id (#3673)
* Handle cache refresh in repo
Add sessions to the client side cache (#3682)
* Add sessions to repository
* Search command supports sessions
* adding session related tests to db and refresh
Change cache schema from personas to tokens+users (#3737)
* Change from personas to tokens+users
* Separate keyring tokens from auth tokens
Add support for keyringless auth tokens (#3765)
* Add support for keyringless auth tokens
Remove expired auth tokens from cache (#3768)
* Remove expired auth tokens from cache
Complete the TODO of checking for inflight tx (#3779)
Delete tokens that the controller says are invalid (#3782)
fix search test with boundary token check (#3799)
Collect resource info in repository_<resource>s.go (#3769)
* Collect resource info in repository_<resource>s.go
* Move search logic into the domain (#3794)
Daemon and search restricted to supported platforms (#3801)
* Daemon and search restricted to supported platforms
Reorganize the clientcache packages (#3814)
* Refactor for self contained domain logic
* Put clientcache stuff under internal
Previously this would truncate to the nearest integer, which could
result in clients retrying before the quota has reset, and getting rate
limited again. This also includes an update from go-rate that will round
up when reporting the reset time for the RateLimit header.
Note that in the case of a 503, the Retry-After header was already being
set correctly.
See: https://github.com/hashicorp/go-rate/pull/8
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
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>
gRPC v1.58.3 fixes a vulnerability in the HTTP stack where a malicious
HTTP/2 client which rapidly creates requests and immediately resets them
can cause excessive server resource consumption.
See https://github.com/grpc/grpc-go/pull/6708 for more details.
When the boundary client establishes a connection to the websocket used
to communicate with a worker, it was configured with a max websocket
message size of 32KiB. This was the default behavior for v1.8.7 of
nhooyr/websocket. However, there are cases where the worker can send
messages to the client that are larger than 32KiB. When this happens the
client returns an error and terminates the connection.
Notably this seems to only currently impact sessions made to SSH
Targets, although it could theoretically impact any target type
depending on the details of how the worker performs the writing of the
messages. The issue can be reproduced by attempting to scp a large
enough file from an SSH Target to the client. In this case the
connection gets terminated and results in a partial transfer of the
file.
This message size limit appears to be unnecessary, and the default
behavior is changing in v1.8.8 of nhooyr/websocket to make the message
size unlimited. Since this version is not yet released, this commit
switches the dependency to a fork with a version that is v1.8.7 plus the
patch to disable the limit. Once v1.8.8 is release this dependency can
be set back.
See:
https://github.com/nhooyr/websocket/pull/254https://github.com/nhooyr/websocket/pull/256
* fix (events): convert multierror to stdlib error
multierror errors will be converted to a stdlib error (because
multierror doesn't support json marshaling).
* refact (errors): convert from multierror to stdlib errors.Join(...)
* refact: convert from pkg/errors to stdlib error wrapping
* fix (auth/ldap): fix which DEK is used for oplog during authenticate
* chore: update go-kms-wrapping dep for new extras/kms changes
The latest version supports setting a table name prefix for a kms
which is needed to fix our oplog DEK problem
* chore: update extras/kms dep
This latest version supports an optional TableNamePrefix which is
required to fix our existing oplog DEK issue.
* fix (oplog): schema oplog DEK fix
These changes will allow use to store the oplog DEK in it's own
set of tables, so they won't get deleted when a scope is deleted
* fix (kms): move oplog DEK into its own internal kms
* tests: update tests to be compatible with oplog fix
* tests: remove migration tests which are incompatible with oplog fix
These tests no longer work because they are missing the required
schema changes for the oplog fix
* feat (auth/ldap): add Repo support for max page size and deref aliases (#3670)
* chore: update cap/ldap dependency
This latest version of cap/ldap adds support for MaxPageSize and
DerefAliases
* feat (auth/ldap): add MaxPageSize and DerefAliases to storage proto
* feat (api/authmethods): add new ldap fields.
Add support for maximum_page_size and dereference_aliases
* feat (auth/ldap): schema changes to support new LDAP attributes
* feat (auth/ldap): add Repo support for max page size and deref aliases
* feat (handlers/ldap): add support for new fields (#3674)
Added API support for new ldap fields: MaximumPageSize and
DereferenceAliases
* chore: add CHANGELOG entry for new api auth ldap fields
Occasionally, we see an error from the gldap test directory reported
during the shutdown/close of the directories listener. This update
should fix that issue.