Commit Graph
403 Commits
Author SHA1 Message Date
David Kanney f62e67584e chore: Clarify GrantHash behavior when there are no GrantTuples (#5334)
* chore: Simplify appending

* test(grants): De-dupe hash comparison

* chore(grants): Remove TODO & add clarifying comment

* test(grants): Add test cases to enforce empty grants behavior
2024-12-06 16:45:38 -05:00
Johan Brandhorst-Satzkorn a2be306eb4 More managed groups limit fixes (#5245)
* internal/handlers/managed_groups: ensure membership lookup is unlimited

Previously, we would only show the first 10,000 members in the group,
giving the impression that a complete list was performed. Now we
list all members.

* internal/handlers/accounts: ensure group lookup is unlimited

Previously, we would only show the first 10,000 managed group
memberships. Now we list all group memberships of an account.
2024-11-15 10:27:20 -08:00
Elim Tsiagbey 514bcc19f6 feat(gcp): add GCP plugin (#5229)
Add GCP as a supported plugin for dynamic host catalogs
2024-11-08 11:09:29 -05:00
Hugo f227020b67 feat(scheduler): Use job table to select jobs to run
This commit changes the logic around selecting jobs to run. Before this,
Boundary used a view "job_jobs_to_run" which was a collation of all jobs
that were not running and scheduled to run. When jobs were requested to
run, Boundary would look at this view, grab a certain amount of jobs and
insert them into the "job_run" table. Importantly, while the amount of
jobs to be scheduled at once defaulted to 1 in the scheduler package,
this was entirely overriden in the controller package to -1 (no limit,
run all jobs that the query would return).

With this commit, Boundary now looks at the "job" table directly for
jobs to run, regardless of job run status. This was done to improve DB
performance as the view (which queried all "job_run" rows) was causing
significant DB contention.

Additionally, the option to limit job runs is now removed since it was
already hardcoded to -1 and not user-configurable anyways.

Should the need arise to implement this limit again, this will have to
be done in a different way since the new query does not account for
running jobs and limiting the rows returned after jobs are already
running would yield a no-op (the new query inserts nothing into
"job_run" if any given job is already running).
2024-11-06 16:15:49 +00:00
Hugo 27c432a748 feat(scheduler): Drop completed job runs as they complete
Before this change, upon the completion of a job run, the scheduler
would update a job_run entry with the completed status as well as the
number of objects affected by the run. Additionally, we then had a
cleaner job whose scope was deleting these completed entries from
job_run.

This commit changes this design to drop the cleaner job the and rolls
its functionality directly into the scheduler. Now, when any given job
run is complete, the scheduler will automatically delete it from the
job_run table itself.

In addition, the completed status has been removed as a valid status as
it is not set anymore.

This change follows a decision that given the data in these job_run
entries is already being deleted by the cleaner job, updating its state
when a job completes just to have it deleted is not efficient.
Additionally, no use-case for this data was surfaced.
2024-11-05 17:10:39 +00:00
daniandDamian Debkowski 62c41191ff [fix] allow IPv6 controllers, workers, and targets (#5221)
Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-11-01 13:27:40 -04:00
Irena Rindos 36158056d9 feat(workers): add VerifyKnownWorkers repo function (#5189) 2024-10-23 13:41:44 -04:00
Hugo b8046a3ef3 feat(handlers/host_catalogs): Support plugin host catalog worker filter 2024-09-30 21:24:18 +01: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
Timothy Messier fe129b4268 fix(metrics): Fix matching logic for authorize session endpoint (#5121)
The target authorize session endpoint allows for alternative target
identifiers besides the public id. For this to function correctly, the
grpc gateway path definition for the endpoint deviates from the common
pattern used for other endpoints that include ids. When this change was
done, it was not accounted for in the logic used to capture the
prometheus metrics for api requests to this particular endpoint,
resulting in the metrics never incrementing for the authorize session
endpoint.

This fix updates the matching logic used for the metrics to ensure that
the metrics are incremented for this endpoint.

See: c149bc4a79
2024-09-19 14:02:41 -04:00
Johan Brandhorst-Satzkorn 41de35f2b1 internal/daemon/controller+worker: propagate downstream timeout (#5083)
Propagate the downstream worker timeout into the
downstream receiver and downstream ticker
so we have a configurable consistent timeout
value to use for worker to worker interactions.

Also change the atomic.Pointer to an atomic.Int64
for consistency with other values.
2024-09-11 12:19:11 -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
David Bond 660e2063a4 Return HTTP 400 status for inactive OIDC auth methods (#5048)
This commit modifies the OIDC authentication start method to return a 400 (Bad Request) error
if a client attempts to start the authentication flow against an OIDC auth method that is set to
inactive. This is something we noticed in our error logs in HCP Boundary that is impacting our
SLOs.

Previously this returned its own error code which is mapped to a 500 response. Tests have been updated
to catch this new scenario.

Signed-off-by: David Bond <davidsbond93@gmail.com>
2024-08-30 16:33:18 +01:00
Elim Tsiagbey 306c722750 feat: Add support for capturing URL actions in request info (#5044)
* feat: Add support for capturing URL actions in request info

- Pass request context to services to validate actions.
- Validate actions for auth methods during authentication. `/v1/auth-methods/{{AUTH_METHOD_ID}}:authenticate:callback` is currently only supported on `OIDC` auth methods. An error is thrown if `:callback` is not supported
2024-08-29 17:14:42 -04:00
Elim Tsiagbey 84707c04cb feat: Disable path length fallback (#5050)
Add `WithDisablePathLengthFallback()` runtime option to the grpc-gateway mux HTTP server. This prevents the issue where the request method can be overridden with a `X-HTTP-Method-Override` header.
2024-08-28 09:30:05 -04:00
Johan Brandhorst-Satzkorn 96688b36d5 internal/daemon: simplify time update tests (#5041)
Using time.After makes the intent clearer
2024-08-27 11:00:04 -07:00
Elim Tsiagbey 123286cf94 feat: Validate LDAP URL port number (#5046)
Add validation for the port number in LDAP URLs. If a port number is provided, it is checked to ensure it is a valid integer and within the valid range. This validation helps prevent errors when configuring LDAP authentication.
2024-08-27 11:27:14 -04:00
Elim Tsiagbey e6d355b65a fix: constant-time comparison of grpc-gateway tickets (#5031)
Update GRPC Gateway tickets to compare tickets in constant-time
2024-08-21 12:26:22 -04:00
Sorawis Nilparuk (Bo) 350ac90a57 implement configurable getDownstreamWorker timeout (#5007)
* implement configurable getDownstreamWorker timeout

* add parsing test

* typos

* fix tests

* fix worker tests

* 0 is a valid value
2024-08-13 14:27:39 -07:00
Hugo 903039e885 fix(daemon): Return 404 if alias interceptor ResolveRequestIds fails (#5006) 2024-08-13 14:24:01 +01:00
Damian Debkowski c0cf5c4e1b feat(api): return remote storage states for worker 2024-07-17 14:23:11 -04:00
Damian Debkowski 00e4c5448b feat: workers filtered by sbc state 2024-07-17 14:23:11 -04:00
Damian Debkowski 9bc5e492f6 feat(sbc): add upsert worker storage bucket job 2024-07-17 14:23:11 -04:00
Damian Debkowski 162a857a29 feat(sbc): Add domain changes for SBC 2024-07-17 14:23:11 -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
Johan Brandhorst-SatzkornandJeff Mitchell c6f3c375f3 api: remove deprecated grant_scope_id field (#4886)
* api: remove deprecated grant_scope_id field

The grant_scope_id field was deprecated in 0.15.0, so we can remove
it for 0.17.0.

* Fix tests

* Fix more tests

* Remove an option and some related code that stuck around

* Fix bats tests

---------

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2024-06-17 12:09:33 -07:00
Jeff Mitchell d547e0d459 Add test ability to reinitialize worker auth roots on startup (#4895) 2024-06-17 12:26:55 -04:00
Irena RindosandDanielle Miu 61e7ab4738 Allow descriptions to contain newlines and other whitespace (#2599)
* Allow names and descriptions to contain newlines and other whitespace

* separate validate name from validate description

* update changelog

---------

Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com>
2024-06-06 13:03:42 -04:00
David Bond 0c25dbad13 Use appropriate gRPC error codes for OIDC (#4877)
This commit makes modifications to the OIDC request handlers to return appropriate gRPC
status codes on errors. Before this change, boundary presents the internal error codes to
clients. This causes problems for reverse proxies, as these status codes are mapped to
non-standard HTTP response codes which are ultimately all turned into 500 responses when
4xx status codes are more appropriate and descriptive of the error returned.

Some modifications in this commit include calls to `event.WriteError` so that the
internal error is written to the controller log for visibility. Comments about
potential duplicate logs are now removed as `event.WriteError` is not called when using
functions from the `handlers` package.

Signed-off-by: David Bond <davidsbond93@gmail.com>
2024-06-06 14:59:43 +01:00
Michael Li e18e3ab783 test: Fix tests due to time (#4855)
* test(billing): Calculate time deltas from a fixed time

Some time calculations are impacted when using the current day vs. the start of the month.

* test(db): Conditionally skip tests at end of month

Certain tests fail when run on the last day of the month because of edge cases in the setup of test data (for example, if today is May 31 and NZ time is June 1). This adds conditional logic to skip those tests when run on the last day of a month.

* CR: typo
2024-05-31 17:08:57 -04:00
Timothy Messier a2c529b9d1 fix(controller): Use max request duration cluster listener (#4805)
The cluster listener supports a `max_request_duration` option, and
defaults to 90 seconds. However, this configuration was not being use
when processing grpc requests from the listener. This meant that
requests from worker to controller could hang indefinitely and
contributed to the recently fixed issue with database connections being
stuck in `idle in transaction`.

This commit adds a grpc interceptor that ensures each request has a
deadline set to the max request duration for the listener.

Refs: 29cd7bc9d6
2024-05-17 11:59:50 -04:00
Irena Rindos 16d23fa55f bug(scopes): scopes list returns 500 without perms (#4731) 2024-04-26 11:55:30 -04:00
Todd 7df9144fbf Fix typos in request validation errors for aliases (#4671)
* Fix typos in request validation errors for aliases

* Add format validation for destination id field.
2024-04-19 07:49:11 -07:00
Todd 0d67b86543 Add ListResolvableAliases to the user service (#4609)
* Add ListResolvableAliases to the user service

There are a few non common ways this method uses our ACL
and grant system. A user is able to list resolvable
aliases for another user if they are granted permission
to do so. That means we had to load the grants for
the user being listed for and not the requester when
determining if an alias is able to resolve to a destination
for which the requested user has permission.

Similarly, the grant hash used for the list pagination
is required to be that of the user being listed and not
the requester.
2024-04-17 08:26:46 -07:00
dani 1a77e4da86 Boundary Plugin MinIO (#4621)
feat(storage): Add storage support for MinIO via new built-in plugin
2024-04-12 11:28:40 -04:00
Louis Ruch c376d06355 feat: Add support for correlationId 2024-04-11 09:08:45 -07:00
Elim Tsiagbey 2c140b1e09 feat: Local Storage State API & CLI
- add `local_storage_state` value to API & CLI
2024-04-05 16:47:22 -04:00
Elim Tsiagbey 3bef063c72 feat: Filter workers by local storage state function
- add functionality to filter worker by local storage state.
- add feature constraint for local storage state
2024-04-05 16:47:10 -04:00
Louis Ruch e9e3d7cad5 feat(session): Include session recording id in auth-session resp (#4593) 2024-04-03 17:54:37 -07:00
ToddandJohan Brandhorst-Satzkorn 55fe70e643 Change 404 errors for aliases to 401s (#4575)
* Change 404 errors for alias resolution to 401s
---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2024-03-27 16:14:49 -07: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
Todd 868228847d Add handler and API support for alias creation with target (#4508)
* Add handler and API support for alias creation with target
2024-03-12 13:57:47 -07:00
Todd f7631edcab rename target2 import alias to talias (#4482) 2024-03-05 07:41:38 -08:00
Todd 4bd38037b3 fixup! Create the alias service and resource (#4276) 2024-02-29 15:52:27 -08:00
Todd 240f86f0a9 fixup! Resolve aliases prior to subtype attribute transforming interceptor (#4379) 2024-02-29 15:52:27 -08:00
Todd ce250cbc57 fixup! Create the alias service and resource (#4276) 2024-02-29 15:52:27 -08:00
Todd deab1d5f17 fixup! Create the alias service and resource (#4276) 2024-02-29 15:52:27 -08:00
Irena Rindos e80e9a6da5 feat(dev): create initial alias targets for boundary dev (#4433)
* feat(dev): create initial alias targets for boundary dev
2024-02-29 15:52:27 -08:00
Irena Rindos 48d958e395 fix(aliases): check target alias host id on create and update (#4435)
* fix(aliases): check target alias host id on create and update
2024-02-29 15:52:27 -08:00