Commit Graph
1675 Commits
Author SHA1 Message Date
Irena Rindos 1821cb4631 Use tofu token from controller (#3064)
* initial commit
2023-03-08 13:49:57 -05:00
Jeff Mitchell b2bab45c13 Port over changes (#3061) (#3062) 2023-03-07 16:29:34 -05:00
Jim a2692e0a68 update the deps (#3054) 2023-03-03 20:51:51 -05:00
Zhihe Li 21e73e4b17 Update changelog and UI commitish (#3052) (#3053) 2023-03-02 17:34:50 -05:00
Irena Rindos ab0a2ad689 Fix hcp billing test (#3045)
* fix test failure
2023-03-02 12:02:16 -05:00
Irena Rindos 860af44556 Fix sql tests failing on the first of the month (#3042)
* initial commit
2023-03-01 19:14:57 -05:00
Timothy Messier 5e0957eb24 ci(test): Use docker mirror (#3018) 2023-02-24 14:49:16 -05:00
Timothy Messier b69d1c2e2e fix(cli): Fallback parsing of un-typed credentials (#2989)
The `boundary connect` subcommands attempt to parse the credentials to
use for brokering. This allows the subcommands to insert the credentials
automatically into the process called by the subcommand, i.e. `ssh` or
`psql`. There is some fallback logic to try a best attempt at parsing
the credential in cases where a credential type has not be set on the
credential source.

The bug was introduced with the recent change to the vault credential
library subtype being renamed from `vault` to `vault-generic`. This
fallback logic would only run if the credential source type was "vault"
or "static", so if the vault credential library was created without
specifying a credential-type, the credential would not be parsed and
automatically passed to the sub-process.

This fix removes the additional check on the credential source's type,
instead it will attempt to parse the credential, relying just on the
structure of the credential.

This also fixes a similar bug in the table output of secrets when using
`boundary connect` without a subcommand. The parsing of the credentials
for display in the table was only running for `vault` or `static`.

Blame: db42eafd7a
2023-02-21 16:38:42 -05:00
Hugo 41b1b5b4b7 feat(db): Introduce migrations for ssh targets (#2960)
Adds the schema for ssh targets. This also changes the target listing
func to not error out when it encounters a target with an unknown type.
Instead, it now ignores it and continues to the next one.
2023-02-21 16:31:22 -05:00
Johan Brandhorst-Satzkorn 18eed58ec5 fix(targets): Use correct error string in enterprise (#2984)
In enterprise the error is different, so we need a different
test error string to compare against. Create a variable
that can be overwritten in the enterprise repo.
2023-02-16 20:34:25 -05:00
Johan Brandhorst-Satzkorn 8a0ee97f3b fix(targets): Readd WorkerFilterDeprecationMessage (#2982)
This variable is updated in the enterprise repo and needs to stay.
2023-02-16 17:56:18 -05:00
Timothy Messier 5c19dba3c9 ci(sqltest): Add github action workflow for sql tests (#2977) 2023-02-16 14:37:48 -05:00
Johan Brandhorst-Satzkorn ac3543bdfb fix(targets): Use correct field name in deprecation warning (#2978) 2023-02-16 14:36:23 -05:00
Todd fe5b554370 AuthorizedDownstreamWorkers now separated from AuthorizedWorkers to maintain API compatibility (#2957)
* AuthorizedDownstreamWorkers now separated from AuthorizedWorkers to maintain API compatibility
2023-02-13 13:52:25 -08:00
Todd 3461caee41 fix downstream manager test (#2950) 2023-02-13 13:52:00 -08:00
Johan Brandhorst-Satzkorn cf412b95a2 fix: Support streaming HTTP responses (#2956)
* all: Upgrade listenerutil dependency

The new listenerutil implements http.Flusher, which is necessary
for streaming responses from the grpc-gateway to work.

* daemon/controller: Remove newline delimiter in streaming responses

The default gRPC-Gateway HTTPBody marshaler uses newlines
as a delimiter. This introduces newlines in our streamed responses.
Wrapping the default marshaler lets us define a nil delimiter, which
ensures our streaming responses are unaffected by the server side
chunking.
2023-02-13 14:56:53 -05:00
Todd 1e89be1b1a Downstream worker connections are tracked by worker id (#2949)
When possible downstream workers will include their worker id information in
the connections they establish with the upstream using the nodeenrollment
library.  The tracking listener now tracks connections that are connected in
this same way instead of just connections of type *tls.Conn.
2023-02-10 15:27:42 -08:00
Johan Brandhorst-Satzkorn 4146c0c55d Upgrade Go version to 1.20 (#2898)
* chore: Upgrade Go version

* fix: Upgrade golangci-lint to support 1.20

* fix: Don't use t.SetEnv in parallel tests

This is a panic in Go 1.20 and it sounds like a recipe
for distaster in general.
2023-02-10 11:16:03 -05:00
Eng Zer Jun 6403b0f389 test: use t.TempDir to create temporary test directory (#2922)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests [complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-02-07 16:23:30 -05:00
Damian Debkowski cabe362534 fix(handler): return targetId as hostId for cli edge case support (#2920) 2023-02-07 10:14:01 -08:00
Haotian f88547bbf5 fix(cli): update plural resource mentions in generated help texts (#2918) 2023-02-07 09:28:18 -08:00
Jeff Mitchell 1e9057d8a3 Update KMS references 2023-02-06 18:23:54 -05:00
Damian Debkowski 84b410974b fix(handlers): return error when updating json cred w/ empty obj (#2903)
* fix(handlers): return error when updating json cred w/ empty obj

* chore(handlers): split cond stmt & refactor func name
2023-02-06 08:20:12 -08:00
Timothy Messier e25b0e7888 fix(credentiallibraries): Fallback logic to support 0.11.x cli (#2910) 2023-02-06 11:00:34 -05:00
Cameron Perera 42858c4c0d chore: bump ui commit (#2913) 2023-02-06 09:40:29 -06:00
Johan Brandhorst-Satzkorn 48e4fcce25 fix: remove file number dependency from test
This was failing because of the added comments.
This isn't a crucial part of the test, so remove it.
2023-02-03 15:55:38 -08:00
Johan Brandhorst-Satzkorn 3c29308673 chore: Add license headers to all files 2023-02-03 15:54:27 -08:00
Cameron Perera 80774077d6 chore: bump ui commit for 0.12.x release (#2904) 2023-02-03 14:32:35 -06:00
Timothy Messier 718e183a1e fix(credentiallibraries): Correctly populate attrs for vault-generic (#2901) 2023-02-03 14:21:08 -05:00
Timothy Messier f9a2f44f5b test(cli): Add tests for vault-ssh-certificate credential library
This adds tests for updating specific fields of the credential library.
2023-02-03 17:00:34 +00:00
Timothy Messier e66ea15fef fix(cli): Status code on api error
When using the json output of the cli (`-format=json`), a successful
call to the controller API would place the HTTP status code in the JSON
as `status_code`. However, if there was an error from the API the status
code would be placed in the JSON as `status`. In order to be consistent,
this adds a `status_code` field to the error response case. For
backwards compatibility it still populates `status` in the error case.

This inconsistency was missed partially due to a bug in the CLI tests.
The assertion on status code was not valid and would always be
successful. Thus this also fixes the assertions and tests.
2023-02-03 17:00:34 +00:00
Irena Rindos 4114b41527 Filter managed workers from egress workers when the host address is unsafe (#2899) 2023-02-03 11:40:41 -05:00
Hugo e455e31f9e fix(target): Incorrectly allowing whitespace on Target's address field (#2862) 2023-02-02 10:51:39 -08:00
Timothy Messier 32dd7f07d0 fix(vault): Only persist revokable credentials
When issuing credentials from vault credential libraries, only persist
the vault credential if it is revokable. A credential that is revokable
has a valid lease id that can be used to revoke the lease in vault. If
the credential is not revokable it is also not renewable since renewing
also requires a lease id.

See: https://developer.hashicorp.com/vault/docs/concepts/lease
2023-02-02 17:43:17 +00:00
Timothy Messier 12a53bbfa9 feat(target): Allow vault ssh cert library as credential source
This allows the new vault ssh certificate credential library to be used
as an injected application credential source.
2023-02-02 17:43:17 +00:00
Timothy Messier 1aaaf4af1d feat(controller): Translate ssh certificate credentials for worker 2023-02-02 17:43:17 +00:00
Timothy Messier 6a41bf1237 feat(wh): Support vault ssh certificate credentials
This expands the wh_credential_dimension to include fields for the new
vault ssh certificate credential library.
2023-02-02 17:43:17 +00:00
Timothy Messier 89a55632ba feat(cli): Add vault ssh certificate credential library 2023-02-02 17:43:17 +00:00
Haotian 43f0ba89cf feat(credentiallibraries): support vault ssh certificates 2023-02-02 17:43:16 +00:00
Danielle 3a78a74571 feat(vault): Support Issuing SSH Cert Credentials
Allows the new credential library type to be pulled from the db and used
for issuing ssh certificate type credentials. The ssh cert library
interfaces with vault's ssh secrets engine to either issu certificates
directly from vault, or to generate them within boundary and have vault
sign them as a certificate authority for authentication.

See:
  https://developer.hashicorp.com/vault/api-docs/secret/ssh#sign-ssh-key
  https://developer.hashicorp.com/vault/api-docs/secret/ssh#generate-certificate-and-key
2023-02-02 17:43:16 +00:00
HaotianandTimothy Messier 823b8cdfc6 feat(vault): Add CRUDL methods for ssh certificate cred library (#2765)
This defines a new credential library type for ssh certificates.
It adds new repository methods to support CRUDL of the new ssh
certificate credential library.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-02-02 17:43:16 +00:00
Danielle 7833dd73c0 refact(vault): Create issuingCredentialLibrary Interface
Allows for new issuing credential library implementations in the future.
Moved db and decrypt logic to privateCredentialLibraryAllTypes from
issueCredentialLibrary.

This also removes sessionId from retrieveCredential, it was not needed
and removing allows retrieveCredential to be reused for credentials
issued outside current workflow.
2023-02-02 17:43:16 +00:00
Cameron Perera f4951c385f chore: bump ui commit to include vault ssh cert feature (#2883) 2023-02-01 14:42:15 -06:00
Todd d8aea569c5 Only return live workers in ListHcpbWorkersResponse (#2876) 2023-02-01 10:24:56 -08:00
Irena Rindos a030c15403 Support HCPBInt in hcpb_cluster_id field (#2880)
* initial commit
2023-02-01 13:20:07 -05:00
Johan Brandhorst-Satzkorn 55259029f1 Add job run cleaner (#2866)
* chore: remove duplicate import

* feat: Add job run cleaner

The new job cleans job runs older than a configured interval.
Configure the job to clean jobs older than 1 minute.
2023-01-31 20:41:33 -05:00
Cameron Perera bc332541c3 chore: bump ui commit for host set link fixes (#2875) 2023-01-31 18:33:01 -06:00
Cameron Perera e64b8eaef1 chore: update UI commit to include onboarding updates (#2870) 2023-01-31 16:46:57 -06:00
Irena Rindos ed9f2b2730 bug(workers): Check initial upstreams for an HCBP environment (#2869) 2023-01-31 15:53:11 -05:00
Jeff MalnickandJeff Mitchell a3c4cef648 Use primary auth method if no auth method ID is provided (#2725)
* feat: default to using primary auth method with authenticating

* Add ability to specify scope ID flag in authenticate method

---------

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2023-01-31 10:07:10 -08:00