Commit Graph
1474 Commits
Author SHA1 Message Date
Timothy Messier 35a7c4f6e7 feat(dbtest): Make test container name configurable 2021-11-03 07:44:51 -04:00
Timothy Messier decc3ec2cf test(targets): Change test to not depend on response order (#1653)
This test started failing when the order of the list response changed.
Since the order does not matter, this test was updated to not depend on
the order.
2021-11-02 15:38:37 -04:00
Timothy Messier f53772519c Merge branch 'tmessi-target-egress-api-cli' (#1648) 2021-11-02 10:25:48 -04:00
Timothy Messier 7d7d8af694 feat(cli): Add support for egress credentials for targets command 2021-11-01 13:33:54 -04:00
Timothy Messier 1da403a2d2 feat(api): Add support for egress credentials for targets endpoint 2021-11-01 13:33:54 -04:00
Timothy Messier 36f1ae75f7 feat(sdk): Add support for egress credentials to target service 2021-11-01 13:33:54 -04:00
Timothy Messier 66a1b996d0 Merge branch 'tmessi-target-egress' (#1594) 2021-10-29 10:30:27 -04:00
Timothy Messier 1b7cfb1704 feat(target): Add support for credential library validation
Target subtypes must now implement another repository hook to validate
any CredentialLibraries that are being added/set. This allows for
subtypes to determine the valid set of CredentialLibraries.

For tcp.Targets only CredentialLibaries with
credential.ApplicationPurpose are allowed. If any other purpose is
provided an error is returned.
2021-10-29 10:01:52 -04:00
Timothy Messier 2cc58ff901 refact(target): Change repository to take CredentialLibraries
This change removes the hard-coded credential purpose for the Credential
Libraries. It also moves the logic of creating CredentialLibraries from
CredentialSources out of the repository and into the targets.Service.
This refactor will allow for additional credential purposes to be
supported in both the service and the repository.
2021-10-29 10:01:52 -04:00
Jim 8ae6e9892f feature (events/audit): Add auth info to audit events (#1644) 2021-10-28 21:14:39 -04:00
Louis Ruch c9a189a18e test(kms): Add missing tests and fixup some log lines (#1645) 2021-10-28 09:45:58 -07:00
Jeff Mitchell 1782f6a4e4 Enhance worker connection security (#1641)
This stores worker connection nonces within the database to ensure
uniqueness of connections. Prior the connection required any attacker to
be able to decrypt the incoming encrypted authentication message in
order to replay (and if the attacker has access to the KMS you have
bigger problems), but with this change even if an attacker does have
access to the KMS key, they cannot reuse the same message. (If they're
able to encrypt against the KMS key, they can still act as a worker with
a new message, so this only really helps if they only have decryption
capabilities.)
2021-10-27 20:32:07 -04:00
Jim a679300b50 feature (events): Classify auth method request/resp messages for audit events. (#1640)
* refactor (oidc): Stop emitting error for not found token id

Stop emitting errors when authtoken repo.IssueAuthToken is called and
there's if no pending token.  It's not an "normal" state and not
an error condition.

* feature (audit tagging): Add tags for auth method requests/responses

Including testing functions for asserting audit events created
when a service is called
2021-10-27 09:37:14 -04:00
Jeff Mitchell 3de16b6e21 Fix TLS 1.2 support (#1637) 2021-10-26 16:30:02 -04:00
Timothy Messier 4ccdfd7b7e Merge branch 'tmessi-target-remove-unused-code' (#1631) 2021-10-26 08:45:37 -04:00
Timothy Messier 24c6c329fe chore(target): Remove unused option support from repo Create
For the target Repository's Create method, the options of
WithHostSources and WithCredentialSources where never used by the
targets.Service. As such the repository does not need to support these
options.

See: 51812ff779
2021-10-26 08:20:15 -04:00
Michael Gaffney c361e6ec22 fix(warehouse): Add primary key to credential group membership table (#1636) 2021-10-26 05:20:34 -04:00
Jim 99d6da4121 feature (events): Add audit request interceptors (#1620) 2021-10-23 21:23:49 -04:00
Louis Ruch 157bea08b9 test(vault): Register vault jobs for tests to reduce error spam in logs (#1630) 2021-10-22 15:53:18 -07:00
Jim 1ce9a71b53 feature (db): Add on conflict support to db.Create(...) (#1612) 2021-10-21 11:11:56 -04:00
Oleg Butuzov 5a2fa689a7 refactor: replace (*regexp.Regexp).Match on (*regexp.Regexp).MatchString (#1617)
This PR change one method of regexp.Regexp struct with a similar one,
as result code produce less allocations on heap.
2021-10-21 08:02:15 -04:00
Pete Pacent 324a00c07e Adding reference architecture docs (#1625) 2021-10-20 21:35:29 -07:00
Louis Ruch 95327b5e43 style: Run make fmt (#1626) 2021-10-20 19:16:14 -07:00
Brandon Romano 28e6fd591c Update HashiConf alert-banner expiration (#1623)
Updates the HashiConf Alert Banner expiration to 10/20 @ 11pm (PT)
2021-10-20 16:26:58 -07:00
Jeff Mitchell d58e7670f1 Make PG resource usage nicer for dev (#1615)
This overrides settings specifically in CI scenarios to the current
values but reduces the resource requirements for local dev work.
2021-10-20 15:12:09 -04:00
Zachary Shilton 3399ca30b3 website: use shared open-api-page component (#1519)
* website: use canary release of open-api-page

* website: bump to latest open-api-page pre-release

* chore: bump to latest open-api-page pre-release

* chore: refresh package files from main to avoid conflicts

* bump to stable open-api-page release
2021-10-20 11:29:54 -04:00
Timothy Messier b5fbf9608e refact(target): Remove old TargetType (#1618)
Now that subtypes are registered via sub-packages, this TargetType is
not needed and should not be used. This removes it and updates the
target.Repository and targets.Service to use the updated code.

This was missed in eac433f7ff.
2021-10-20 08:35:33 -04:00
Jim 769416c2ff refactor (controller): Use a grpc server for the grpc-gateway (#1576)
* refactor (controller): Use a grpc server for the grpc-gateway

This starts a grpc server for the grpc-gateway.  The new gateway
server uses an in-memory listener which also supports "dialing", so
the http proxy can connect to the in-memory listener.

This change allows us to use all grpc server features and was in part
motivated by a need for an interceptor of inbound requests.  With that
said, having a "proper" grpc server for the gateway will provide a lot
more flexibility and capabilities moving forward.

The request context will still be verified via middleware in the
http proxy (see wrapHandlerWithCommonFuncs).  This verified context
will be serialized into a protobuf and sent along to the grpc-gateway
via metadata where an interceptor will add the verified request
info to the request's context (see requestCtxInterceptor).  The
interceptor will verify the serialized request info via a shared ticket
with it's companion in-memory http proxy.  FYI: the ticket is simply
random base62 string (see db.NewPrivateId).

This change also necessitated a minor change to services.  We need to
return an empty response instead of nil, nil when there are no errors
and the response is empty.

* refactor (handlers): Rename gRPC Gateway filter

Originally, this was called an OutgoingInterceptor, which is an
unfortunate name since it's not an interceptor.  Now that we're
refactoring the gateway stuff and have proper interceptors, renaming
this should remove ambiguity

* refactor: Rework how 204 with empty msg is handled

Recent changes to grpc gateway has necessitated a change to how
204s are handled by the gateway

* tests (bats): Check status codes for delete operations
2021-10-19 17:21:41 -04:00
Timothy Messier 55ba24499a Merge branch 'tmessi-target-refact' (#1573) 2021-10-19 14:11:38 -04:00
Timothy Messier 02b2291375 feat(subtypes): Make Registry thread-safe 2021-10-19 10:44:51 -04:00
Timothy Messier eac433f7ff refact(target): Move tcp into subpackage
This moves all of the tcp target functionality into a tcp package. It
also establishes a Register function in the target package to allow
specific target types to be registered at initilazation time. When
registering, a target type needs to provide its Subtype, as well as some
RepositoryHooks that are used by the target Repository.
2021-10-19 10:44:51 -04:00
Brandon Romano b48f11dddb Prep Banner for HashiConf (#1610) 2021-10-19 06:55:38 -07:00
Timothy Messier 51812ff779 docs(target): Mark additional fields as output only (#1609)
When creating or updating a target, the following fields should have
been marked as output only:

- host_set_ids
- host_source_ids
- application_credential_source_ids
- application_credential_library_ids

This updates the protobuf and generated files including the swagger file
used by the docs site to correctly mark these are output only.

Fixes #1588
2021-10-19 09:37:32 -04:00
Noel Quiles 6fc9505378 website: Upgrade platform analytics package (#1606) 2021-10-15 16:42:05 -04:00
Timothy Messier 65f72ce3d0 Merge branch 'tmessi-hooks' (#1593) 2021-10-15 14:24:20 -04:00
Timothy Messier 4b6a16034e chore: Add ci job to trigger update to enterprise 2021-10-15 14:03:26 -04:00
Timothy Messier b9a393d10b chore: Add pre-push hook 2021-10-15 14:03:26 -04:00
5d527c5e99 Boundary documentation: created a boundary intro page (#1601)
* added an boundary intro page

* Update what-is-boundary.mdx

deleted an extra space

* added an image

* Apply suggestions from Robin's code review

Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>

Co-authored-by: Pete Pacent <ppacent@hashicorp.com>
Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
2021-10-14 17:03:25 -07:00
Jeff Mitchell c05324282f Rename the UI passthrough dir flag/env var (#1600)
This puts it more in line with other upcoming options that use "dir"
instead of "directory" (plus it's easier to type), and makes it clear
that this directory and the passthrough behavior is related to the UI as
opposed to other upcoming items.
2021-10-14 12:13:07 -04:00
Noel Quiles 08a0f32a6e website: Add Fathom analytics (#1579)
* Impl Fathom analytics

* Use analytics package instead of direct impl
2021-10-13 18:03:23 -04:00
Jeff Mitchell 3af3ceec3a Bump Go to 1.17.2 (#1596) 2021-10-13 17:46:02 -04:00
Robin Beck 204ff254ca fixed hcl config examples for sink (#1590)
* fixed hcl config examples for sink

* fixed observations_enabled parameter typo
2021-10-13 13:57:31 -06:00
Jim 3b99ded7ad refactor: Update gorm deps (#1591)
Our recent upstream PR was merged into gorm.  We needed to change
just a few bits to migrate our gorm dep back to the upstream source.
2021-10-13 11:10:11 -04:00
Michael Gaffney 7ccab48a3c style: Run make fmt 2021-10-11 16:00:32 -04:00
Bryce Kalow 43b4d69517 website: upgrade deps to fix search styles (#1586) 2021-10-11 11:28:53 -05:00
Timothy Messier b0b8375dc6 Merge branch 'tmessi-migration-editions' 2021-10-11 08:37:07 -04:00
Timothy Messier 06e6ab6c57 build: Fix build to support switch to embed for migrations
With the refactor to the schema package, and the switch to use embed,
the sql files need to be included in CI when compiling the boundary
binary.
2021-10-08 06:50:26 -04:00
Timothy Messier e3f7c263b0 refactor(sqltest): Update init script to support migration editions
This updates the docker image used for tests to support the new location
for sql migration files and the concept of editions. It continues to
process the old paths for now if the new directory does not exist, so
that the same image can be used during the transition.
2021-10-08 06:50:26 -04:00
Timothy Messier 2143940a4a refactor(dbtest): Support new paths for migration files
This updates the docker image used for tests to support the new location
for sql migration files and the concept of editions. It continues to
process the old paths for now if the new directory does not exist, so
that the same image can be used during the transition.
2021-10-08 06:50:26 -04:00
Timothy Messier 8caaf3e076 refactor(schema): Add support for migration editions
This refactors the schema package and subpackages to support editions.
An Edition is a collection of sql migrations. A given boundary binary
can have multiple migration editions. The `schema.Manager` is updated to
apply the necessary migrations in the correct order, leveraging an
Edition's priority to determine the order in which the separate Editions
are applied.

The sql migration files are now nested under a directory for the
edition.

This also switches from the generated code to using embed, which
eliminates the need for the `make migrations` target and the generated
code. As such this commit removes the target and generated code.

See:
    https://pkg.go.dev/embed
2021-10-08 06:50:26 -04:00