Commit Graph
132 Commits
Author SHA1 Message Date
Jeff Mitchell 2c61bd4963 Fix recursive listing when the ingress scope lacks permissions (#1478)
The existing logic was to ignore Forbidden errors when recursively
listing in favor of looking for downstream scopes with appropriate
permissions. The problem is that when there is actually no
authentication token at all, what comes back is an Unauthenticated
error. Therefore if you didn't have permissions on the ingress scope
(e.g. the default of `global`) but did downstream for the anonymous
user, you'd get back an error.

I don't think there's any security issue with doing this; the user could
always have simply started the search at a downstream scope to begin
with so nothing more is being revealed, this just fixes behavior to
match expectations in this case.

A test was added for one of the services; the code is exactly the same
across them. The reason that the existing tests that were added with the
output fields testing didn't catch this is that even though they were
specifying `u_anon` as the user, the disabled test context skipped the
logic that would return a 401 in this case. It turns out that fixing
this is very complicated because we don't have a great way in most tests
of defining grants to put onto the generated scopes, so even if a true
anonymous context was added each test would require the anonymous user
to have list permissions on whatever resource was under test, requiring
a lot of role and grant and principal finagling. This is probably a good
longer-term TODO but not one that seemed worth it for this fix.

Fixes ICU-2301
2021-09-02 12:55:04 -04:00
Jeff Mitchell 781871c30d Properly accept grant format type=<type>;output_fields=<of> (#1474)
Although we document that this is allowed, and the ACL code handles it,
some of the validation code did not. This would cause a semi
intermittent problem because that validation code is used only in some
code paths; specifically we skip it (for now) to avoid erroring out on
some deprecated grant string formats when reading grants from the DB,
but we use it to error out when validating incoming grants.
2021-09-02 12:54:02 -04:00
Louis Ruch 030c09c6b9 bug(targets): Fix panic in authorize-session (#1496)
When renaming credential libraries -> credential sources
the target service added the credential library information
to the SessionCredential response, while the target cmd was
parsing the credential source.

This prevents a panic like the following:

    boundary targets authorize-session -id ttcp_5PS2dktESb
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x1f99a31]

    goroutine 1 [running]:
    github.com/hashicorp/boundary/internal/cmd/commands/targetscmd.printCustomActionOutputImpl(0xc00046c0a0)
    	/Users/louisruch/boundary/internal/cmd/commands/targetscmd/funcs.go:822 +0x9d1
    github.com/hashicorp/boundary/internal/cmd/commands/targetscmd.(*Command).Run(0xc00046c0a0, {0xc000134030, 0x2, 0x2})
    	/Users/louisruch/boundary/internal/cmd/commands/targetscmd/targets.gen.go:324 +0x188b
    github.com/mitchellh/cli.(*CLI).Run(0xc0001c6500)
    	/Users/louisruch/go/pkg/mod/github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x5f8
    github.com/hashicorp/boundary/internal/cmd.RunCustom({0xc000134010, 0x60, 0x0}, 0x0)
    	/Users/louisruch/boundary/internal/cmd/main.go:186 +0x9d6
    github.com/hashicorp/boundary/internal/cmd.Run(...)
    	/Users/louisruch/boundary/internal/cmd/main.go:92
    main.main()
    	/Users/louisruch/boundary/cmd/boundary/main.go:13 +0xc9

Fixes #1488
2021-09-01 09:16:47 -07:00
Todd Knight c79daab68c Update to version 0.5.1 2021-08-16 13:11:30 -07:00
Michael Gaffney ef051135b2 Add data warehouse changes for OIDC to the Changelog (#1465) 2021-08-16 13:21:40 -04:00
Jeff Mitchell f7894811f5 Update go-bexpr to allow colons in paths; add a test (#1453) 2021-08-11 15:27:56 -04:00
Jim 3bd6a209a4 prevent panic when hclog_formatter_node is operating on a struct (#1456) 2021-08-11 15:24:48 -04:00
Jim 3a3f956615 support new event formats of: hclog-text and hclog-json (#1440) 2021-08-03 15:06:19 -04:00
Todd Knight 6b578c0e30 Update to versions 0.5.0 2021-08-02 13:36:07 -07:00
Chris MarchesiandJeff Mitchell 947dc96b30 server: Add back controller shutdown on worker startup failure (#1432)
* server: Add back controller shutdown on worker startup failure

This adds back the controller shutdown call on worker failure.

This was added in a15961e4 to address a panic discovered in testing, and
was mistakenly thought to be unnecessary. This, however, covers
multi-role scenarios where we have already started the controller, which
needs to be shut down gracefully if possible if we can't start the
worker.

A nil check has been added to ensure the panic does not resurface.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-08-02 12:35:57 -04:00
Jim 137729b0c0 Event log adpaters (#1434) 2021-08-02 07:47:17 -04:00
Jim df42c71881 add events feature to changelog (#1431) 2021-07-30 15:20:18 -04:00
Chris MarchesiandJim 29ea10c6f8 Add session cleanup changes to CHANGELOG.md (#1426)
* Add session cleanup changes to CHANGELOG.md

* Shorten controller-side connection cleanup entry

* Update CHANGELOG.md

Co-authored-by: Jim <jlambert@hashicorp.com>

Co-authored-by: Jim <jlambert@hashicorp.com>
2021-07-30 08:55:01 -07:00
Jeff Mitchell f8a51b987c Migrate target host sets -> host sources (#1424)
This follows the same model as https://github.com/hashicorp/boundary/pull/1413

See there and CHANGELOG for more details.
2021-07-30 08:48:03 -04:00
Jacob Mammoliti fc998b7034 Adding support to build multi-arch Boundary images (#1395)
* updated dockerfile to support multi-arch; added new section in Make for multi-arch

* adding a line to changelog

* switching base image to hashicorp mirror
2021-07-28 11:52:15 -07:00
ab6f3eaeb4 Migrate credential-library nomenclature around targets to credential-source (#1413)
See the CHANGELOG entry for more information.

Co-authored-by: Jim <jlambert@hashicorp.com>

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-07-27 12:48:36 -04:00
Jeff Mitchell 528d54b4ad Add token/userinfo claims to account read output (#1419)
This is very useful when trying to write managed groups filters as you
can directly look at the structure of the claims for the accounts you're
trying to filter.

The output of the claims in text format on the CLI currently leaves
something to be desired. I started revamping some of the formatting
functions and it quickly got very fragile. Fundamentally at this point
we're likely better off -- now that we have a good idea what our output
format/standards are like -- rewriting the formatting code. I'll take
that as a tasker as I have a lot of ideas...
2021-07-26 17:52:18 -04:00
Jeff Mitchell c9e4c877b8 Update shared-secure-libs for kms block fix (#1384)
Fixes #1305
2021-07-07 22:54:57 -04:00
Joe Thompson e41ffb0b28 Add additional logic to entrypoint to handle more subcommands. (#1350) 2021-07-07 19:22:15 -07:00
Jim 0b66464a3a fix typo in changelog 2021-06-30 18:08:47 -04:00
Jeff Mitchell 89dfbbe41e Update changelog (#1362) 2021-06-29 11:40:20 -04:00
Jim f483828286 update to 0.4.0 version 2021-06-29 07:19:00 -04:00
Chris Marchesi 9f9acce972 [Merge to main] internal/servers/worker: Controller failure connection cleanup (#1330) (#1357)
This commit adds some rudimentary functionality for cleaning up
connections on controller failure, or more specifically, a failure to
communicate with the controllers.

In this scenario, when a status cannot be sent for any reason for longer
than 30 seconds, the worker will close all connections that are normally
not cleaned up (so for sessions that currently are *not* in the progress
of being canceled or terminated). Status requests now time out after 10
seconds if they are not made successfully.

Session status is not touched during this process, but natural cleanup
or connectionless sessions will still occur. This should be okay, as the
session should be added on re-connect if need be.

A few other changes are made to cancelConnections: first, error logging
has been moved to the function so that we can handle errors requesting
cancellation directly within the function; this entails simply just
locally marking these connections as closed with a warning. Second,
there was a minor logging bug where closed connections were not properly
being noted in the last trace log, this has been fixed.

Additional changes:

* Circle: Set acceptance test no_output_timeout to 30m
2021-06-28 17:32:13 -07:00
Louis Ruch 8e4323c31c Scheduler run jobs failure (#1310)
* Drop wt_private_id from job table

* Add server id len constraint on job_run table
2021-06-15 15:32:23 -07:00
Jim Lambert 4d367a477c update version to 0.3.0 2021-06-08 13:26:24 -04:00
Jeff Mitchell e958a77280 Merge remote-tracking branch 'origin/main' into ICU-1573 2021-06-08 12:34:49 -04:00
Jeff Mitchell 054c0aa538 Update password generated account IDs (#1290) 2021-06-08 12:31:58 -04:00
Joe Thompson cc843dd796 Add a Docker entrypoint script and modify Dockerfiles to mimic Vault, to enable mlock inside Docker containers (#1269)
* Add a Docker entrypoint script and modify Dockerfiles to enable mlock
2021-06-07 20:42:28 -07:00
Jeff Mitchell 33716f1af5 Add changelog 2021-06-04 10:59:13 -04:00
Jim Lambert ed5e34082c staging release 0.2.3 required version changes 2021-05-21 14:08:09 -04:00
Jeff Mitchell 765829be6e Update CORS to have an allowed_origin of * by default (#1249)
* Update CORS to have an allowed_origin of `*` by default

* Update changelog
2021-05-21 13:33:02 -04:00
Jeff Mitchell a0c1f69ae2 Already-canceled sessions return 200 (#1243)
If a session is already canceled or terminated, attempting to cancel it
will return the current session state and a 200, instead of an error.
2021-05-20 21:07:22 -04:00
Jeff Mitchell 13545e3171 Revert "internal/cmd/config: allow explicit origin list w/implicit CORS toggle (#1247)" (#1248)
This reverts commit 579fc621ec.
2021-05-20 21:06:38 -04:00
Chris Marchesi 579fc621ec internal/cmd/config: allow explicit origin list w/implicit CORS toggle (#1247)
This ensures that cors_allowed_origins can be set when cors_enabled is
not explicitly specified and allowed to be its default (currently true).

The current behavior is to clobber this value when cors_enabled is not
explicitly set, ultimately setting it to the default of
"serve://boundary" only.
2021-05-20 17:11:56 -07:00
Jim 9a11ef3525 document bug fix for aud claim handling (#1240) 2021-05-19 12:08:20 -04:00
Jim Lambert a87fe5f803 Merge branch 'main' of https://github.com/hashicorp/boundary 2021-05-17 19:13:59 -04:00
Jim Lambert 5aef5cc8dd staging 0.2.2 2021-05-17 19:13:04 -04:00
Jim d9439fd32a Revert "chore: bump UI version and add changelog entry (#1229)" (#1233)
This reverts commit 8e0c3ea46f.
2021-05-17 19:04:57 -04:00
Randall Morey 8e0c3ea46f chore: bump UI version and add changelog entry (#1229) 2021-05-17 14:02:41 -07:00
Jeff Mitchell edb3a2602f Add some missing Changelog bits 2021-05-17 12:00:09 -04:00
Jeff Mitchell 7ee8ddba6a True up some spelling 2021-05-14 16:26:25 -04:00
Jeff Mitchell b54be8ee9a Add missing API-level state checks during session cancel (#1223)
* Add missing API-level state checks during session cancel

This validates it's not already canceled or in terminated state.
2021-05-14 15:57:30 -04:00
Jeff Mitchell 6f34da8923 Add cleanup of dead connections no longer reported by a worker (#1220) 2021-05-14 13:23:12 -04:00
Jeff Mitchell 569d59fbe5 Remove some linter annoyance around trailing spaces in the changelog 2021-05-07 12:37:20 -04:00
Jeff Mitchell 3c994f66f8 Update changelog 2021-05-05 11:51:00 -04:00
Jeff Mitchell c22631fbca Fix boundary database init respecting format flag (#1204)
The output was ready for json format but the flag wasn't included.
2021-05-05 11:49:06 -04:00
Jim Lambert f7e7e54fd8 updated for 0.2.1 release 2021-05-04 22:04:31 -04:00
Jeff Mitchell 22d5c88a0b Add Output Fields support (#1192) 2021-05-04 20:57:35 -04:00
Jeff Malnick 1948984ca2 Update CHANGELOG.md (#1200) 2021-05-04 19:24:23 -04:00
Jeff Mitchell f32e7f9144 Add ability for the controller/worker name to be read from env/file (#1181) 2021-05-04 09:37:56 -04:00