Commit Graph
100 Commits
Author SHA1 Message Date
Jeff Mitchell dc74e725d4 Some clarity updates to comments in ACL code (#5136) 2024-09-27 12:24:33 -04:00
Jeff Mitchell 62d4f8453b Don't explode grants from the DB (#5104)
This removes the Cartesian product in the DB for GrantsForUser in favor
of returning the actual grant scope information and dealing with it in
application code.

(cherry picked from commit 913cd536823d73994acc4f4d833208c1cc05f91b)
2024-09-24 14:18:53 +00:00
Jeff Mitchell 3a4ee032d9 Paginate targets in cache (#5101)
* Update Go API to support pagination
* Implement pagination of targets in cache

(cherry picked from commit cd25fad42f325fc050b7ea3bec3336780d2b5e16)
2024-09-24 14:18:53 +00:00
Jeff Mitchell 829ea02e6f Ensure only one refresh is running for a user/resource at a time (#5054)
This ensures we don't have competing update processes running. When doing the
inline RefreshForSearch, a specific error will be returned so we can hint in
the API that we're in the middle of a refresh.

(cherry picked from commit 54776091e32af2f2f110f2bf10d0617bd5677aba)
2024-09-24 14:18:53 +00:00
Jeff Mitchell b04de5ac4b Add implicit-scopes resource type to cache (#5053)
This allows getting a list of scope IDs known by the cache via cached
targets and sessions. It is not refreshed from the controller. The name
contains `implicit` in case we ever want e.g. `scopes`.

(cherry picked from commit c0a318c58367d8ec55365447f41cf007eab64ce3)
2024-09-24 14:18:53 +00:00
Jeff Mitchell 384fc332be Restrict cache results to 250 entries by default (#5049)
A query parameter `max_result_set_size` can be specified to set a
per-request limit, with `-1` meaning all values. If there were more
entries than the max size used for the request, an `incomplete` boolean
is set in the response.

(cherry picked from commit 3cdd07889be5e4e6f21d044cb60fad1face4be08)
2024-09-24 14:18:53 +00:00
Jeff Mitchell b120a03f43 Fix tests (#5114) 2024-09-18 11:09:15 -04:00
Jeff Mitchell 66af7dba98 Allow reloading some server timings (#5071)
Allows changing grace period and a few other things timing-related via
HUP instead of just a restart.

Tested manually via config changes and HUP.
2024-09-04 15:40:44 -04:00
Jeff Mitchell 35d1df7388 Two fixes in our Go API code: (#5066)
* Replace `interface{}` with `any`
* For options that are bools, don't always set true; set to the actual
  value passed in (some options already behaved this way, but they all
  should)
2024-09-04 11:40:43 -04:00
Jeff MitchellandJohan Brandhorst-Satzkorn 4e0c2d79ac Add grant scope IDs to role list (#4893)
This adds grant_scope_ids in the output of role listing. The lookup for grant scope IDs was changed to allow taking in a set of roles instead of just a single role, and the results are collated afterwards.

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2024-06-25 13:05:52 -04:00
Jeff Mitchell d547e0d459 Add test ability to reinitialize worker auth roots on startup (#4895) 2024-06-17 12:26:55 -04:00
Jeff Mitchell 986328db2c Fix some changelog issues 2024-04-26 15:25:01 -04:00
Jeff Mitchell d396a33930 Fix controller-only in dev not showing events (#4594) 2024-04-03 20:56:51 -04:00
Jeff Mitchell 446b790f02 Make WrappableCommand input be a func (#4590)
When wrapper.Wrap was put into place, the argument going into it was no
longer part of a closure but was instead evaluated at function call
time. As a result this would create 197 extra goroutines and
channels on startup - one for each command using wrapper.Wrap. Among
other things this made stack traces much more difficult to parse.
2024-04-03 20:43:20 -04:00
Jeff Mitchell 6afa50d9c7 Update changelog entry for coalescing 2024-03-18 13:36:56 -04:00
Jeff Mitchell b4f2b2ae80 Update changelog 2024-03-15 15:34:21 -04:00
Jeff Mitchell 7e214026af Fix issue with workers connecting in high latency conditions (#4535)
At some point we migrated to grpc ConnectParams to control how often
retries were happening. One value that we didn't set was the
MinConnectTimeout. It turns out that if you don't set this, it won't use
the default; instead if will actually use a value of zero, which gRPC
internally ups to something that seems to be around 25ms to meet a
minimum threshold. This is not documented in the function comments.

This commit simply sets the value of MinConnectTimeout to the unexported
gRPC default.
2024-03-15 15:31:07 -04:00
Jeff Mitchell a4bafdf9f4 Remove unintended log statements (#4533) 2024-03-15 10:34:51 -04:00
Jeff Mitchell 4542eef22b Add templating coalesce function (#4492) 2024-03-15 10:33:10 -04:00
Jeff Mitchell 7105270cd5 Make TestServer_ReloadWorkerTags non-parallel
This will hopefully help with flakiness.

Note: this was tested on the Ent side
2024-03-14 14:25:17 -04:00
Jeff Mitchell 19b19d6756 Comment out parallel statements causing test failures (#4528)
It hasn't been investigated why this is happening (getting a number of
403 errors) but for now removing parallel fixes it.
2024-03-13 21:12:26 -04:00
Jeff Mitchell 7a1f0018a0 Fix races introduced in alias merge (#4496) 2024-03-07 15:14:37 -05:00
Jeff Mitchell 9408b2b299 Add some more fixes caught by race detector (#4488) 2024-03-07 14:46:10 -05:00
Jeff Mitchell c3297bb96f Remove worker type from CLI output (#4396)
This does not currently remove the field from the message on the API but
since it will now always show `pki` it's meaningless and causing
confusion for some users.
2024-02-23 10:33:57 -05:00
Jeff MitchellandDamian Debkowski 014a5a7aae Vet/race fixes (#4421)
This addresses all found vet/race fixes in community edition.

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-02-21 16:32:26 -05:00
Jeff MitchellandDamian Debkowski 35cef97bd4 Linter fixes PR 3 (#4415)
* Linter fixes

* fix(bsr): update test to register TEST protocol once

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-02-16 08:30:16 -05:00
Jeff Mitchell 4068829509 Merge pull request #4401 from hashicorp/jefferai-linter-fixes
Fix linter warnings, parts 1 and 2
2024-02-14 17:55:41 -05:00
Jeff Mitchell 49803e653c Linter fixes numero 2 (#4408) 2024-02-14 17:14:31 -05:00
Jeff Mitchell 25bce9e8ff Fix linter warnings 2024-02-13 15:50:11 -05:00
Jeff Mitchell c4effc078b Remove some no-longer-needed x/crypto refs (#4371) 2024-02-06 16:17:32 -05:00
Jeff Mitchell 483f13226e Adjust tofu token check 2024-02-06 15:04:02 -05:00
Jeff Mitchell 18f863514e Finish sqltests for multi grant scopes (#4320) 2024-01-30 11:04:05 -05:00
Jeff Mitchell 025fce6f95 Change error message and add beginnings of sql tests (#4319) 2024-01-29 16:02:16 -05:00
Jeff Mitchell 8e71caa2e3 Address some review feedback 2024-01-26 18:24:27 -05:00
Jeff Mitchell 296639e484 Add new GrantsForUser test (#4289)
* Add new GrantsForUser test

This exercises a wide array of granting possibilities and ensures that
we see all of the desired grants and none that we don't expect.

* Address review feedback
2024-01-26 11:59:40 -08:00
Jeff Mitchell 84c0e94097 Add a bit more useful worker auth output (#4308) 2024-01-26 14:54:00 -05:00
Jeff Mitchell e91c4cbfe2 Remove support for 'id' field in grants (#4290) 2024-01-25 15:58:55 -05:00
Jeff Mitchell 5563a7c2d4 Update id/ids notice in changelog 2024-01-24 15:50:30 -05:00
Jeff Mitchell 03825a5b8f Address some extra review feedback on multi scope grants (#4272) 2024-01-24 15:43:49 -05:00
f5dd457b34 Multiple grant scope IDs (#4251)
Co-authored-by: Timothy Messier <tim.messier@gmail.com>
Co-authored-by: Todd <github@quaddi.com>
2024-01-23 14:33:09 -05:00
Jeff Mitchell 3414e09cbb Remove announced deprecated code allowing ports in target addrs (#4265)
We made it an error in the API to do this a while back; this cleans up
the logic to disallow it for existing targets too.
2024-01-22 13:49:17 -05:00
Jeff MitchellandJohan Brandhorst-Satzkorn fff5f9506f Migrate proxy logic to the API package (#4216)
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>
2024-01-21 22:34:33 -05:00
Jeff Mitchell 253d79116c Swap id field in grants to ids since that's now standardized (#4250)
* Swap id field in grants to ids since that's now standardized

* Fix some tests I missed

* Update generated resource table
2024-01-17 23:54:49 -08:00
Jeff Mitchell 8c1bdb2190 Fix Unix listener causing 500s on Mac (#4243)
Some platforms use `@` for a Unix socket address, and some leave it
empty. In the empty case this causes the rate limiting code to throw a
500 error. This commit standardizes on using `@` for incoming
connections over a Unix socket.
2024-01-17 11:38:53 -08:00
Jeff Mitchell e07503add4 Remove some long-standing commented code (#4242)
This actually was implemented elsewhere for eventing but the commented
code wasn't removed. We can finally be free.
2024-01-17 09:29:31 -08:00
Jeff Mitchell 1885624e0f Add deprecated KMS removal note to CHANGELOG 2024-01-12 12:00:27 -05:00
Jeff Mitchell 9332179a01 Remove the deprecated old KMS worker auth mechanism (#3935)
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.
2024-01-12 11:58:12 -05:00
Jeff Mitchell 263660a7cb Add support for templating key_id (#4215) 2024-01-04 21:19:36 -05:00
Jeff Mitchell fe4c43305c Move and export ExpectWorkers (#4207)
This is a useful test function and keeping it in the cluster package
means it can't be used by api/cli tests.
2024-01-03 10:41:12 -05:00
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
Jeff Mitchell 046d2c4be6 Bump azure kms wrapper version (#4041) 2023-11-14 12:06:36 -05:00
Jeff Mitchell cb1386932d Use sdk wspb library and remove internal (#4025) 2023-11-08 14:02:58 -05:00
Jeff Mitchell 71e685b276 Copy wspb into sdk in preparation for moving it out of main (#4023) 2023-11-08 12:41:08 -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
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
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
Jeff Mitchell d98523be9f Fix failing test (#3984) 2023-11-02 13:13:21 -04:00
Jeff Mitchell 66c0f152d9 Revert "test(globals): Fix failing tests" (#3983)
This reverts commit 274aca755f.
2023-11-02 13:12:20 -04:00
Jeff Mitchell 9e07609560 Add node update due to EOL node version (#3975) 2023-11-01 17:41:54 -04:00
Jeff Mitchell 48082535e5 Bump plugin deps (#3976) 2023-11-01 16:29:03 -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
Jeff Mitchell 34b558fdc0 Update api deps (#3970) 2023-11-01 14:17:45 -04:00
Jeff Mitchell a6c8057244 Update sdk deps (#3969)
* Update sdk deps

* Use main eventlogger versions
2023-11-01 14:11:46 -04: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
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
Jeff Mitchell eb20b80c71 Migrate some credential bits around (#3864) 2023-10-18 17:48:44 -04:00
Jeff Mitchell d7e44f6822 Bump nodeenrollment to remove multierrors (#3809) 2023-10-07 14:45:05 -04: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
Jeff Mitchell fc0d43459c Bump password dep to fix issue entering password in Windows CLI (#3800) 2023-10-05 12:32:35 -04:00
Jeff Mitchell b64eadedbf Fix flaky TestServer_ReloadInitialUpstreams (#3758)
With the KMS changes this should never have worked at all (because the
different databases means the credentials conveyed after the KMS-based
authentication would never be valid). However, it was sometimes passing
because of a race condition: the worker could be found in the database
before the new credentials were returned to the worker, causing the
worker to start at the KMS step with the second controller.

This changes the test to use the same database for two controllers, but
to only ever have one running at a time, and uses a sequence of two
changed (or unchanged, depending) status updates from the worker to
ensure that the reload was successful.
2023-09-21 14:25:53 -04:00
Jeff Mitchell 69bafbd4e0 Mention that SIGHUP affects the database URL (#3612) 2023-09-06 11:57:22 -04:00
Jeff Mitchell be8e9fc61c Fix address not returning on 10001+ list value (#3644)
Fixes ICU-10786
2023-08-30 13:40:43 -04:00
Jeff Mitchell 3a9903a836 Don't attempt session teardown if the session is expired (#3312)
This avoids a situation where teardown results in an error due to the
worker not accepting the connection (since the credentials are invalid).
Teardown is a best-effort way to avoid sessions that have long lifetimes
ending up having to wait for expiration before cleanup, but if we're
near expiration it doesn't really matter.

Fixes ICU-9633
2023-06-14 21:55:24 -04:00
Jeff Mitchell 8322916fb4 Remove all deprecated Err/Wrap/E calls (#3286) 2023-06-14 21:55:24 -04:00
Jeff Mitchell feb3aea38f Support multiple IDs in grants (#3263)
This allows specifying multiple IDs in grants via an `ids` field, which
will eventually become the normal way to specify IDs. Internally, each
grant with multiple IDs turns into multiple ACL grants each with a
single ID; to make this distinction clearer and allow for better
separation of concerns an AclGrant type has been introduced, so really
multiple IDs in a Grant turn into multiple AclGrants.

The nice thing about doing it this way is that it becomes purely a
parsing concern; no actual validation logic has changed.

For backwards compatibility with grants already stored in roles, we do
not error out if `id` is specified. However, eventually we will simply
not support grants with `id` coming via the API; they will fail API
validation, such that new grants will require the use of the updated
`ids` field.

A follow-on PR will plumb this through the service handlers/API/CLI, but
I decided to do it in separate chunks to make reviewing easier, given
that they are easily separable into the internal and external aspects of
the change.

* Add CLI/API checks around using ID in grants (#3264)

* Plumb through some contexts to remove a lot of deprecated errors (#3268)
2023-06-14 21:55:24 -04:00
Jeff Mitchell 8b7d063a6d Revert "Add multiple IDs in changelog"
This reverts commit c4f8a77ad8.
2023-06-12 14:11:30 -04:00
Jeff Mitchell c4f8a77ad8 Add multiple IDs in changelog 2023-06-12 14:03:11 -04:00
Jeff Mitchell 929ede1c18 Modify some tests to expose error cases that weren't being exposed (#3302) 2023-06-09 11:13:15 -04:00
Jeff Mitchell 74e8491f85 Disallow updates on all types of KMS workers (#3295)
This also slightly changes delete logic and ensures authorized actions
match what is allowable.
2023-06-08 12:17:45 -04:00
Jeff Mitchell 1b0330ad8e Update dev worker auth flag names (#3265)
This brings it in line with the updated names that have been settled on
in light of deprecating the old KMS method.
2023-06-02 12:47:59 -04:00
Jeff Mitchell 3d5bed9ce8 Don't allow managed workers to be deleted (#3254)
This also adds checks to ensure the tag cannot be added to workers via
the API.
2023-05-31 14:23:57 -04:00
Jeff Mitchell 18e59998e9 Add storage bucket worker filter handling 2023-05-31 12:18:18 +00:00
Jeff Mitchell b73d4bd0d2 Add note about 0.12.3 not having an OSS tag 2023-05-30 21:40:02 -04:00
Jeff Mitchell 7bdbe8ab8e Update changelog (#3250) 2023-05-30 16:16:31 -04:00
Jeff Mitchell c149bc4a79 Allow slashes in authorize-session when using target name (#3249)
This requires specifying `**` as the selector in the proto, which will
match any segments and simply requires that the verb is the last part of
the URL, which it already is.
2023-05-30 16:03:27 -04:00
Jeff Mitchell 769a7c9e1c Remove cleanup calls for test controller/worker (#3245)
A previous commit added a call to t.Cleanup in the
NewTestController/NewTestWorker commands; as a result these statements
are no longer needed.
2023-05-26 14:57:32 -04:00
Jeff Mitchell e8559d142a Fix worker auth rotation test (#3243)
Most of the changes here are changes or enhancements that are useful for
tests. The crux of the issue was that I had pulled up one var to the
package level so it could be read from tests, but that var was not being
reset between tests. It's not even used in tests anymore, so I put it
back to function-local.
2023-05-24 23:33:51 -04:00
Jeff Mitchell d5ad1f078a Fix test timing (#3241) 2023-05-24 15:37:22 -04:00
Jeff Mitchell 5b98aecaba Bump deps (#3240)
These are deps either maintained by the Boundary team or approved by
members of the team. A few specific notes on some of the non-HC and
non-DB ones:

github.com/fatih/color: fixes some windows issues
github.com/zalando/go-keyring: fixes a windows crash
2023-05-24 14:36:17 -04:00
Jeff Mitchell c8f37ca4dc Perform mod tidy 2023-05-23 15:56:45 -04:00
Jeff Mitchell 5a7cbaa989 Bump gkw dep 2023-05-23 12:41:45 -04:00
Jeff Mitchell bec9e80586 Bump internal deps
These have been checked with the various owners to ensure they should be
fine.
2023-05-23 12:41:10 -04:00
Jeff Mitchell 4c024858c4 Bump nodeenrollment dep 2023-05-23 01:44:27 -04:00
Jeff Mitchell e0787f4de0 Simplify worker auth rotation timing logic (#3237)
* Simplify worker auth rotation timing logic

* Add some jitter
2023-05-20 21:05:19 -04:00
Jeff Mitchell 6f4f51cc9f Fix display of next rotation time (#3236) 2023-05-20 08:25:16 -04:00
Jeff Mitchell 5716a30813 Update nodeenrollment to fix TLS issue; add debug (#3231)
* Add more logging to worker auth rotation and test flags

This makes it much easier to figure out when and why rotation is
happening and control it for tests/debugging.

* Update auth rotation logic

Because we were looking at validity period of client certs, which may
not have matched the actual rotation interval, it was possible (mostly
in test scenarios) for the rotation to happen multiple times on the
roots before we actually hit the worker rotation interval.

This changes how the interval is calculated by looking at the difference
between not-after values on the certs to understand the rotation
interval being used by the controller. We then use that as the starting
point for calculating a next-rotation time.
2023-05-19 17:18:26 -04:00
Jeff Mitchell 77fd51fb12 Add more logging to worker auth rotation and test flags
This makes it much easier to figure out when and why rotation is
happening and control it for tests/debugging.

Remove cert skew

Cherry-picked from release/0.12.x
2023-05-19 17:14:33 -04:00
Jeff Mitchell 33ccb121c8 Bump nodeenrollment version 2023-05-17 17:33:02 -04:00