Commit Graph
1573 Commits
Author SHA1 Message Date
Todd Knight 772bb88d8d Updating the aws plugin dependency. 2021-11-10 15:42:51 -07:00
Todd Knight b14302e762 Updating the azure plugin dependency. 2021-11-10 15:30:40 -07:00
Jeff Mitchell 3a5f0a2981 Update plugin 2021-11-10 15:20:48 -05:00
Jeff Mitchell 5c09db5e4a Update plugin 2021-11-10 15:18:45 -05:00
Jeff Mitchell 962c9463fd Update SDK/API modules 2021-11-10 15:11:57 -05:00
Jeff Mitchell 3f3f6d974c Update API go.mod to require Go 1.17 2021-11-10 15:10:18 -05:00
Jeff Mitchell 0ea3ff03c4 Update SDK go.mod to require Go 1.17 2021-11-10 15:09:55 -05:00
Todd 2229d1a819 Call OnCreate or OnUpdate on the plugin after db constraints are checked (#1683)
* Only call the Plugin at create/update time after the db has been partially updated. This allows more constraints to be checked prior to calling the plugin.
2021-11-10 09:04:29 -07:00
Todd 050553ffcf Add update catalog support for plugin based catalogs in handler and go sdk (#1673)
* Create catalog service handler for updating plugin.  Add tests for handler and run make fmt. Silently drop attributes where the value is nil when creating the catalog or set.
2021-11-09 14:42:48 -07:00
Jeff Mitchell 48ac8b8f0b Merge branch 'main' into plugin-hostcatalogs 2021-11-07 18:47:28 -05:00
Jeff Mitchell b0642344b9 Update Go version to 1.17.3 (#1674) 2021-11-06 11:32:29 -04:00
Jim eecd878b36 feature: Add signing (hmac-sha256) of audit entries (#1666) 2021-11-05 20:44:33 -04:00
DevOps Rob 55ab75f364 updating db init without generated resources example (#1493) 2021-11-05 17:18:43 -04:00
Chris Marchesi 157f1a091b internal/host/plugin: add update catalog test for empty/same description (#1672)
This is to mainly get coverage on the empty description case, but it
follows the same logic as the "update name to same" test.
2021-11-05 14:05:52 -07:00
Timothy Messier 242e353f18 fix(schema): Prevent duplicate versions per edition (#1670)
This should help prevent issues like the one fixed in
f2ad4de554.

A version for a particular edition should only exist once, previously
which ever file was read last for a version would be included, which
would lead to some migrations not running.
2021-11-05 14:57:10 -04:00
Chris MarchesiandTodd 0670e272e3 internal/host/plugin: Add UpdateCatalog (#1634)
* internal/host/plugin: Add UpdateCatalog

This adds support for updating plugin-based host catalogs.

The workflow is:

* The existing catalog is fetched.
* Any attribute changes are patched against it, along with other changes
  such as name and description.
* Both the existing catalog, and the state of the catalog as it will
  exist post-update, along with any persisted secrets, are sent to the
  plugin via an OnUpdateCatalog request.

Upon success, the following is done:

* The record is updated if non-secret updates need to be made.
* Secrets are updated if they still exist.
* If an empty secret set was sent back, secrets are instead deleted.
* If the secrets field was instead null, secret update is skipped
  altogether.

There has also been a lot of helper code added to the tests to help make
the update tests more readable and reduce boilerplate. While the create
tests have not been updated to use these new helpers, it might be a good
idea to do so for consistency.

* move secret/persisted state closer to plugin call

* Update internal/host/plugin/repository_host_catalog.go

Co-authored-by: Todd <T.Alan.Knight@gmail.com>

* Update internal/host/plugin/repository_host_catalog_test.go

Co-authored-by: Todd <T.Alan.Knight@gmail.com>

* move all test helpers for UpdateCatalog inline

* WIP - transparent attributes struct/wire conversion

* Revert "WIP - transparent attributes struct/wire conversion"

This reverts commit 31af1b1b7e535119aa23bd0aa936da1a80eb5aa2.

* deal with multiple attribute masks

* Note TODO for upsertQuery for HostCatalogSecret

* add version check guard

* Update internal/host/plugin/host_catalog_secret.go

Co-authored-by: Todd <T.Alan.Knight@gmail.com>

* remove redundant JIRA reference

* don't separate number of updated catalogs and secrets

* increment version when secrets is the only thing being updated

* add another test for updating both catalog and secrets at once

* correct comment for mock plugin manager section

* add first-part path matching for secrets

* update plugin lookup error to return errors.Internal

* only add name/description to plugin request if they are non-empty

* update duplicate tests to use two project scopes

* remove unused test checks

* return plugin record along with host catalog in update

* move away from using passed in catalog after patching newCatalog

* use t.Cleanup() instead of defer

Co-authored-by: Todd <T.Alan.Knight@gmail.com>
2021-11-05 10:43:58 -07:00
Jim b6ad76e4d2 fix (db): Clean up tests a bit (#1669) 2021-11-05 08:51:12 -04:00
Chris Marchesi 165cc5ef1b fix ineffectual assignment to err in DeleteCatalog (#1664)
Was being caught by my linters. Looks like the error wasn't being
checked after getCatalog.
2021-11-04 17:09:32 -07:00
Jim f2ad4de554 fix (migrations): Adjust migration numbers to remove dups (#1667) 2021-11-04 15:34:56 -04:00
Todd 54bccf3674 Mask manager can now include mask paths w/ a specified prefix which would be filtered otherwise (#1654)
* Update the mask manager to always allow fields containing a prefix which matchs a passedThroughPrefix.

This will be useful when updating plugin based host catalog and sets since attributes and secrets cannot be contained in the mask manager mapping.
2021-11-04 10:43:08 -07:00
Jim f63ca1313c feature (kms/audit): Add base audit key type (#1651)
* feature (db): Add the ability to enable debug output for a connection

* refactor: Use scope.Global instead of "global"

* feature (db/migrations): Add kms audit keys

Add schema changes to support a new DEK for audit crypto operations.

* feature (kms/audit): Add audit key type

All the bits required to define a new DEK concrete type for
operating on audit entries.

* refactor (db): Remove deprecated migration unit tests.

We added a new audit DEK to kms.CreateKeysTx(...).  Unfortunately,
unit tests like TestMigrations_UserDimension,
Test_PrimaryAuthMethodChanges and TestMigrations_CredentialDimension
have an indirect dependency on a specific historical set of DEKs via
an indirect call kms.CreateKeysTx.  This of course fails because the
new DEK's tables is not a part of pinned migration versions that these
tests depend on.
2021-11-04 09:34:01 -04:00
Jeff Mitchell 80d41b9044 Merge branch 'main' into plugin-hostcatalogs 2021-11-04 09:02:39 -04:00
Jim dd2c3807cd refactor: Move functions from kms pkg to new libs/crypto pkg (#1650) 2021-11-04 08:55:30 -04:00
Jeff Mitchell a37e4f08c8 Update aws plugin 2021-11-03 21:22:57 -04:00
Kevin Wang a86ee59bcd chore: react-subnav (#1663) 2021-11-03 17:07:00 -04:00
Chris Marchesi 1bc9a07316 populate correct field for host catalog secret (#1661) 2021-11-03 13:16:45 -07:00
Jeff Mitchell 03de1c4b21 Pass namespace to the Vault client (#1660)
The namespace was plumbed all the way through the API but isn't actually
set on the client when it is created.

Fixes #1597
2021-11-03 14:52:11 -04:00
Jim 4df3b40def feature (db): Add support for multi-column PKs (#1658) 2021-11-03 14:04:47 -04:00
Jeff Mitchell b9269ce93c Update available actions for host resource (#1659) 2021-11-03 12:39:41 -04:00
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
Hugo 8d3f666bba docs: include boundary-ui dependencies for make dev (#1657) 2021-11-03 13:55:58 +00:00
Timothy Messier ee88e863a3 Merge branch 'tmessi-docker-test-config' (#1652) 2021-11-03 07:45:24 -04:00
Timothy Messier 1a24a0fc2f feat(sqltest): Make container name configurable 2021-11-03 07:44:51 -04:00
Timothy Messier 35a7c4f6e7 feat(dbtest): Make test container name configurable 2021-11-03 07:44:51 -04: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
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
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
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
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
Louis Ruch c9a189a18e test(kms): Add missing tests and fixup some log lines (#1645) 2021-10-28 09:45:58 -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