Commit Graph
1489 Commits
Author SHA1 Message Date
Jim b96f57ec4e fix (events): Only "sign" audit events (#1677)
* chore: Update eventlogger dependency.

We need the latest version, so we can limit the type of events
that are signed.

* fix (events): Only "sign" audit events
2021-11-08 13:29:16 -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
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
Jim b6ad76e4d2 fix (db): Clean up tests a bit (#1669) 2021-11-05 08:51:12 -04:00
Jim f2ad4de554 fix (migrations): Adjust migration numbers to remove dups (#1667) 2021-11-04 15:34:56 -04: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
Jim dd2c3807cd refactor: Move functions from kms pkg to new libs/crypto pkg (#1650) 2021-11-04 08:55:30 -04:00
Kevin Wang a86ee59bcd chore: react-subnav (#1663) 2021-11-03 17:07:00 -04: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
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
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