Commit Graph
1530 Commits
Author SHA1 Message Date
Todd 1ff2968409 Warehouse contains "Unsupported" host_address for plugin based hosts (#1656)
* Populating the warehouse with the host_address from a plugin basd host is unsupported.

* Adding test for plugin hosts in the datawarehouse.
2021-11-03 07:24:53 -07:00
Todd ec36528e97 Updating dependencies since the host plugins were updated. (#1649) 2021-11-02 20:49:04 -04:00
Todd 808b986834 Read and List Plugin based Hosts (#1655)
* Add ability to read and list hosts.  Tests to follow.

* Add tests for reading and listing as well as validation checks to not modify hosts.

* Add IpAddress and DnsNames to the api resource.  Populate the plugin info.

* Adding go sdk tests for reading and listing hosts and ensuring update and deleting is disallowed.
2021-11-02 14:06:20 -07:00
Todd 1312628a1e Add plugin set sync and orphaned host cleanup jobs (#1647) 2021-11-01 09:07:56 -07:00
Jeff Mitchell 5e782b6ecc Update view to return host IDs in a set on set lookup (#1646)
This removes the optional call to the plugin.
2021-10-29 15:35:06 -04:00
Todd 6eba8a4787 Lookups Catalogs and Persisted data together (#1643)
* Fixed a number of TODOs:
1. Create a catalog/persisted data view.
2. Pass all sets to the plugin when deleting a catalog.
2021-10-28 12:46:42 -07:00
Jeff MitchellandTodd b64761f38f Add repository and functions around plugin host set membership (#1629)
Co-authored-by: Todd <T.Alan.Knight@gmail.com>
2021-10-28 10:09:43 -04:00
Jeff Mitchell b1a72bd445 Merge remote-tracking branch 'origin/main' into plugin-hostcatalogs 2021-10-27 21:57:30 -04: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
Chris Marchesi 86f2535aaf internal/libs/patchstruct: add package for patching structpb (#1592)
* internal/libs/patchstruct: add package for patching structpb

This adds a small helper package for patching *structpb.Struct values
using the same patterns that our APIs use for updating records. The
intent of this package is to provide a fallback mechanism for working
with these values when said record update behavior is unavailable, such
as when working with plugin-based host subtypes where the exact
structure of the subtype's attributes is unavailable.

patchstruct.Patch follows the following logic:

* The source (src) map is merged into the destination map (dst).
* Values are overwritten by the source map if they exist in both.
* Values are deleted from the destination if they are set to null in the
  source.
* Maps are recursively applied, meaning that a nested map at key "foo" in
  the destination would be patched with a map at key "foo" in the
  source.
* A map in the destination is overwritten by a non-map in the source,
  and a non-map in the destination is overwritten by a map in the
  source.

Patch returns the updated map as a copy, dst and src are not altered.

* Add doc comment for patchstruct.Patch

* vim snafu

* Premature commit of repository_host_catalog.go

* add nil cases

* internal/libs/patchstruct: add PatchJSON

* small comment formatting fix

* Change PatchJSON to PatchBytes

PatchJSON wasn't what was needed here - we need a helper to patch the
protobuf encoding of structpb.Struct.

* remove equality for original src/dst for patchbytes
2021-10-25 10:36:58 -07:00
Todd 8795b20fe2 Delete actions for plugin based catalogs and sets (#1622)
* Add ability to delete plugin based host catalogs and host sets

* Add plugin host catalog and set tests for API.
2021-10-25 09:37:05 -07: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
Jeff Mitchell 804cb22699 Remove priority values from host_ip_address/host_dns_name (#1633) 2021-10-22 15:45:46 -04:00
Jeff Mitchell 1cf94d0e3e Fix merge issues 2021-10-21 13:47:46 -04:00
Jeff Mitchell 0fd906d964 Merge branch 'main' into plugin-hostcatalogs 2021-10-21 11:47:13 -04: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
23baaac36b Add DB changes for host, set members, and host addresses for plugins. (#1584)
* Add DB changes for host, set members, and host addresses for plugins.

* Add priority, address review feedback, update tests, naming, protos

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-10-20 12:20:28 -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
Jeff Mitchell e8313146f6 Update plugin dependencies 2021-10-20 13:49:46 -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 f01a8060a0 Merge branch 'main' into plugin-hostcatalogs 2021-10-14 12:14:07 -04: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
Jeff Mitchell 1c8e0ed1e1 Add scaffolding for external host plugins and convert aws/azure over (#1581) 2021-10-14 11:56:08 -04:00
Jeff Mitchell f6efde041d Merge branch 'main' into plugin-hostcatalogs 2021-10-14 10:09:58 -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