Commit Graph
100 Commits
Author SHA1 Message Date
Jim 2e29894ca7 chore: upgrade deps (#3055) 2023-03-08 10:00:25 -05:00
Jim a2692e0a68 update the deps (#3054) 2023-03-03 20:51:51 -05:00
Jim e64163ad1d fix (controller): prevent panic when controller stops when there's no listener (#2793) 2023-01-18 16:46:45 -05:00
Jim 1c9ca14a8e fix (db): Improve error handling for commit errors. (#2728)
We were not capturing the errors which happen on commit.  We've changed
to a multierror so we should get the commit error and any subsequent
rollback errors in the same txn.
2022-12-20 07:41:31 -05:00
Jim 38b12394fd refactor (kms): add GetWrapperer for RewrapFn parameter (#2701)
* refactor (kms): add GetWrapperer for RewrapFn parameter

* tests (kms): add MockWrapper and MockGetWrapperer

Make it a bit easier to write unhappy path tests which depend on
a Wrapper or GetWrapperer
2022-12-13 05:38:14 -05:00
Jim b0bc6bd632 refactor: eliminate gorm references in favor of go-dbw (#2386) 2022-08-24 14:11:49 -04:00
Jim 2818bb65cd feature (downstreams): Add hooks for optional downstream workers/router (#2359)
This includes the required interfaces, factories, error codes, etc
2022-08-12 11:08:25 -04:00
Jim 7aa7deafa3 chore: update go-dbw dependencies (#2298)
* chore: update go-dbw dependencies

This update included an update of the upstream gorm dependency.

In the latest update, gorm appears to have become more sensitive when
a slice is passed into operations.  The ptr to slice must now
be a ptr to slice of ptrs.  This change required an update to how
boundary handles slices of PrincipalRole, which now must return a ptr
to PrincipalRole.   There were also some tests that needed to be
updated because of this change.

* fixup! chore: update go-dbw dependencies
2022-08-10 17:20:06 -04:00
Jim d269ebc630 chore: update go-kms-wrapping dependency (#2300)
Updated this dependency to fix a panic in boundary which occurred
when vault (transit) was unreachable. It was fixed in the pkg in this
commit:
https://github.com/hashicorp/go-kms-wrapping/pull/105/commits/f70fdac27c171ece4759cba7b731d92f3ef9c21c
2022-07-28 16:37:25 -04:00
Jim 6fdcccb953 feature (server): add additional option for downstream workers DAG (#2278) 2022-07-22 13:31:09 -04:00
Jim b3ec54e81b feature (server): add new error codes for downstream workers DAG (#2275) 2022-07-22 10:18:29 -04:00
Jim 3da78aa7e4 refactor (kms): Update dependency required a small refactor (#2253) 2022-07-11 11:40:03 -04:00
Jim aaf669a044 fix (API): check attributes missing appropriately. (#2219)
* fix (API): check attributes missing appropriately.
2022-06-19 10:55:37 -04:00
Jim 4114917d27 chore (changelog): add pki workers (#2218) 2022-06-18 16:46:33 -04:00
JimandJeff Mitchell bd167da7d1 fix (worker): send workerId when authorizing session (#2207)
* fix (worker): send workerId when authorizing session

Send the workerId returned from the last success worker status
when authorizing a session.

* fixup! fix (worker): send workerId when authorizing session

* fixup! fix (worker): send workerId when authorizing session

* refactor (worker): deprecate workerId in ActivateSessionRequest

It wasn't being used anywho

* fixup! fix (worker): send workerId when authorizing session

* Update LookupSessionRequest

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2022-06-16 09:30:04 -04:00
Jim d7aaa9f7e2 fix (byow): minor updates to UpsertWorkerStatus(...) on conflict (#2194) 2022-06-15 14:43:39 -04:00
JimandTodd 9997f1a7bd feature (workers): required schema changes (#2185)
* feature (workers): required schema changes

Changes required for consolidation of worker name, description
and address fields

* fixup! feature (workers): required schema changes

* fixup! feature (workers): required schema changes

* fixup! feature (workers): required schema changes

* Fixing up address constraint.

* last_status_time = now() on insert only if the worker is type = 'kms'

* update last_status_time for pki and kms based on different columns being updated.

* tweaking the constraints on last_status_time and address.

Co-authored-by: Todd <github@quaddi.com>
2022-06-14 14:51:56 -07:00
Jim 9dde83aea7 feature (byow): classify status msg data (#2181)
Classifying the data allows it to appropriately included in
audit events
2022-06-14 12:09:02 -04:00
Jim f6c4e3c896 feature (worker): add worker events around authentication (#2157) 2022-06-09 11:28:12 -04:00
Jim 37cc61e4c9 feature (worker): Add audit data classification to CreateWorker(...) api (#2153) 2022-06-09 06:43:58 -04:00
Jim 0425384b49 feature (events): add TestWithoutEventing(t) (#2137) 2022-06-07 12:23:01 -04:00
Jim fdf43fc4fe feature (worker): add CreateWorker(...) service (aka API) (#2143) 2022-06-07 11:50:30 -04:00
Jim c1445728e3 tests (servers): additional CreateWorker(...) unit tests (#2134) 2022-06-05 14:50:15 -04:00
Jim 5f66d8f2af feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker (#2131)
* feature (errors): add support fmt specifier with operands to WithMsg(...)

* feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker

* fixup! feature (worker): add WithFetchNodeCredentialsRequest to CreateWorker
2022-06-03 14:32:51 -04:00
Jim 9da0faabd7 refactor (servers/workerauth): add StoreNodeInformationTx(...) (#2125)
refactor to export StoreNodeInformationTx(...) which can be used
by other repositories within their transactions to store
node information.
2022-06-03 12:28:54 -04:00
Jim 6cbb36f2b1 chore (servers): update nodeenrollment dep (#2129)
The signature for registration.AuthorizeNode(...) changed
2022-06-03 12:04:33 -04:00
Jim 6ceda0e595 feature (errors): add support fmt specifier with operands to WithMsg(...) (#2126) 2022-06-03 10:38:32 -04:00
Jim 78ffd82581 fix (servers): return unhandled err from storeRootCertificates(...) (#2127) 2022-06-03 09:14:45 -04:00
Jim 70c5da1048 feature (workers): add repository CreateWorker(...) (#2105) 2022-05-26 13:32:21 -04:00
Jim 6635778765 chore (kms): upgrade extras/kms dep which no longer directly deps on sqlite (#2078) 2022-05-15 12:56:32 -04:00
Jim 785241237e refactor (kms): adopt the go-kms-wrapping/extras/kms package (#2027)
* feature (db): add Db.UnderlyingDB()

This is needed to allow for integration with bits that need a *dbw.DB

* feature (kms): add new go-kms-wrapping/extras/kms dependency

* refactor (kms): schema changes required to adopt extras/kms pkg

* refactor (kms/iam): rename to DeprecateCreateKeysTx(...)

* refactor (kms): remove deprecated test

* refactor (kms): refactor Kms type

This refactor includes renaming the existing type to DeprecatedKms
and then refactoring the Kms type to become a wrapper of
go-kms-wrapping/extras/kms

* refactor (kms): delete all the unneeded bits

All this stuff is not needed now that we're using
go-kms-wrapping/extras/kms

* refactor (db): fixup tests after kms refactor

* refactor (kms/tests): use testing.TB for test helpers

Our test helper packages were not possible to use
with benchmarks. This refactor switches to testing.TB
to allow both tests and benchmarks to use the helpers.

* tests (session benchmarks): refactor to use new Kms type

* refactor (schema): rm test which relies on deprecated Kms code

* refactor (kms): post rebase on main changes required

* chore (kms refactor): re-add unit test from main

* refactor (kms): uses migrations that don't include KMS schema changes
2022-05-13 13:53:22 -04:00
Jim addbfee593 chore: upgrade gofumpt to v0.3.1 (#2028) 2022-04-19 11:42:54 -04:00
Jim 4636efce8f refactor (tests): GetEventDetails(...) will stop returning nil (#2019) 2022-04-15 12:20:44 -04:00
Jim cb93c6bdfd chore: update auditResponseInterceptor const op (#2018) 2022-04-15 12:04:20 -04:00
Jim 8895bc08e0 fix (kms): properly reconcile DEKs for existing scopes (#1976) 2022-04-12 09:20:52 -04:00
Jim 0ca86c8a2c chore: remove unneeded ref to gorm.DB (#1971) 2022-04-06 09:17:17 -04:00
Jim 591ec476e7 refactor: Update internal/db and oplog to use go-dbw package for database operations. (#1785)
* chore: Add new dbw dependency

* refactor: Convert to use dbw.DB

* refactor (db): Change GetTicket(...) signature

* feature (db tests): Added TestDeleteWhere(...)
Adding this allows us to eliminate a leak of the gorm library

* refactor: Add ctx to ScanRows(...) signature
This is required to refactor all the deprecated errors pkg calls.
This refactor required adding a context to quite a few call chains
and in particular the job scheduler bits

* feature (db/tests): Add support for test opt: WithTestLogLevel(...)
This test only option allows callers to specify a log level for the
underlying db package (where supported/applicable) when calling
TestSetup(...)

* refactor (db): Simplify Db type
Only store the underlying *DB and create the *RW on demand when
needed.

* refactor (oplog): Port to using dbw pkg for db operations

* refactor (db): Remove gormDB(...) func

* tests (db): Add unit tests for TestDeleteWhere(...)

* chore: make fmt changes to formatting
2022-01-05 14:38:38 -05:00
Jim baa1d88f1f feature: Add client ip to inbound request information (#1678)
* feature: Add client ip to inbound request information
* feature (workers): Add the user's client IP to a session's connection information (#1749)
2021-12-09 20:41:08 -05:00
Jim 983f7b019c refactor (db): Remove unused gorm formatter (#1738) 2021-11-30 18:20:44 -05:00
Jim dba5bc88a0 chore: Upgrade gorm deps (#1747) 2021-11-27 18:38:46 -05:00
Jim 5232be905b fix (auth/oidc): Revert to working version of oidc acct upsert (#1719) 2021-11-16 19:32:50 -05:00
Jim ebea283421 fix (kms): Add kms.ReconcileKeys(...) to fix missing audit DEK scenario (#1711)
This fix addresses the situation where an existing boundary database
doesn't have the audit DEKs in the global scope.
2021-11-16 07:46:23 -05:00
Jim 1b6c9a25c8 Add more opts when using Create + WithOnConflict (#1706) 2021-11-14 09:52:18 -05:00
Jim c6d79bc911 feature (db): Add WithOnConflict support to CreateItems(...) (#1699) 2021-11-12 18:10:09 -05:00
Jim f46803d808 feature (authmethod): Add managed grps perms to auth collection actions (#1695) 2021-11-12 09:28:07 -05:00
Jim 1ac151100e docs (internal/db): Add docs Update/Delete operations using WithWhere (#1687) 2021-11-11 16:13:44 -05:00
Jim c047c4d89d refactor (db): Remove the internal/db test tables from the migrations (#1675) 2021-11-09 11:58:57 -05:00
Jim 048fceaf54 feature (workers): Add audit events for worker requests (#1681)
* feature (audit events): Add interceptor for auditing worker requests

* feature (events): Add default deny filter for worker status events

* feature (worker audit events): Add tags to SessionService req/resp
2021-11-09 11:43:41 -05:00
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
Jim eecd878b36 feature: Add signing (hmac-sha256) of audit entries (#1666) 2021-11-05 20:44:33 -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
Jim 4df3b40def feature (db): Add support for multi-column PKs (#1658) 2021-11-03 14:04:47 -04:00
Jim 8ae6e9892f feature (events/audit): Add auth info to audit events (#1644) 2021-10-28 21:14:39 -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
Jim 99d6da4121 feature (events): Add audit request interceptors (#1620) 2021-10-23 21:23:49 -04:00
Jim 1ce9a71b53 feature (db): Add on conflict support to db.Create(...) (#1612) 2021-10-21 11:11:56 -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
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
Jim 2ee2c50ba3 fix (Makefile): Add proper comment delimiter (#1577) 2021-10-04 13:37:07 -04:00
Jim c8b29ded1c Events: Add outbound detail protobufs, request status code, and update event encrypt filter. (#1569)
* feat (events): Add status code to audit events

* feat (events): Add the resp proto msg to every audit event

* chore (events): Update eventlogger dep

This latest version will redact any map and/or map field which isn't
explicitly classified via a Taggable interface

* feat (events): Begin to add tagging to response proto msgs
2021-09-30 12:55:47 -04:00
Jim 8d6dee09a9 refact: Add db.DB wrapper and refact all test fixtures to use it. (#1535)
* refact: Changes required for gorm v2

* refact: Add db.DB wrapper and refact all test fixtures to use it

Stop leaking the gorm abstraction within our unit tests.

* refact: Migrate direct calls to pq to pgx driver

The refactor will remove the remaining direct dependencies on
the pq driver which has been deprecated in favor of the pgx
driver.

It includes the addition of common.SqlOpen which is a wrapper around
sql.Open, which is needed to deal with the driver name changing from
"postgres" to "pgx" but in our code base the dialect and driver are
synonyms.
2021-09-30 09:17:27 -04:00
Jim 136ac00b49 refact: Changes required for gorm v2 (#1528) 2021-09-30 08:47:34 -04:00
Jim 0d74f8dbc9 Merge branch 'main' of https://github.com/hashicorp/boundary 2021-09-28 15:28:36 -04:00
Jim 744e08aaef chore: Update website version 2021-09-28 15:28:14 -04:00
Jim 07c5c00f55 chore: Update version to 0.6.2 2021-09-27 16:38:06 -04:00
Jim f9c043c866 chore: Update sdk and api deps 2021-09-27 16:32:42 -04:00
Jim 6c7333cbe0 chore: Update sdk dep 2021-09-27 16:28:51 -04:00
Jim 350b79be2d chore: Update go:build tags to new fmt 2021-09-27 16:24:00 -04:00
Jim 5312f7d042 fix (credential/vault): Correct typo in error msg (#1547)
* fix (credential/vault): Correct typo in error msg

* test (vault): Add missing assertion
2021-09-20 11:42:04 -04:00
Jim 2afac7348a fix (controller): Set controller CancelCtx (#1513) 2021-09-14 05:49:18 -04:00
Jim 02c0764e11 chore: update product version and make packages 2021-09-03 15:48:28 -04:00
Jim 6ad8333b97 chore: update sdk and api deps 2021-09-03 15:00:17 -04:00
Jim 48c6195829 chore (api): update sdk dep 2021-09-03 14:52:09 -04:00
Jim 5fe40bc7bd style (events): add changes from make fmt in prep for release. 2021-09-03 14:35:42 -04:00
Jim 5f46207e76 Events: add redact/encrypt node for audit events to Eventer (#1490)
* feat (events): Add new options needed for AuditConfig

WithAuditWrapper and WithFilterOperations all for optional paramters
when creating AuditConfig types.

* refactor (event): Change EventerConfig.Sinks to a ptr

We need to modify the SinkConfig.AuditConfig during the NewEventer factory, so we have to use a ptr not a ref.

* feat (events): Add audit configuration types

* feat (events): add audit config to sink configuration.

* feat (events): add redact/encrypt node for audit events to Eventer

Integrate the encrypt.Filter node from the eventlogger into the
event.Eventer, so audit events can be redacted/encrypted based
on data classifications.

* test (events) Add test protobufs for events

Add test protobufs along with a test service for testing
the audit event encrypt node
2021-08-30 19:02:48 -04:00
Jim 4d70c049c2 fix: Stop trying to re-write the resp header on event flush errors (#1463) 2021-08-16 11:52:28 -04:00
Jim 3bd6a209a4 prevent panic when hclog_formatter_node is operating on a struct (#1456) 2021-08-11 15:24:48 -04:00
Jim b3d8b50307 Sink documentation (#1449) 2021-08-05 19:31:02 -04:00
Jim 477b541bf0 Events: ongoing clean up of eventing (#1448) 2021-08-05 10:54:10 -04:00
Jim 00cb18efbe use parseutil.ParseDurationSecond(...) which allows a value without a suffix to be treated as seconds instead of nanoseconds (#1447) 2021-08-04 19:11:00 -04:00
Jim acc3dda2df parse the duration string specified in an event file config into a time.Duration (#1446) 2021-08-04 17:57:36 -04:00
Jim 3a3f956615 support new event formats of: hclog-text and hclog-json (#1440) 2021-08-03 15:06:19 -04:00
Jim 6785055a4d update to latest tagged version (#1436) 2021-08-02 09:01:46 -04:00
Jim 137729b0c0 Event log adpaters (#1434) 2021-08-02 07:47:17 -04:00
Jim 68dd2a66ba Remove unneeded hclog dependencies as we move forward with events (#1433) 2021-08-01 14:41:13 -04:00
Jim df42c71881 add events feature to changelog (#1431) 2021-07-30 15:20:18 -04:00
Jim be8c3cb1ea prevent panics when waitgroup == nil (#1423) 2021-07-28 11:46:41 -04:00
Jim 70ad081e39 Events: convert from hclog to events (#1409) 2021-07-28 06:31:16 -04:00
Jim 11124794bf Events: add node for formatting/filtering cloudevents (#1390) 2021-07-25 17:40:54 -04:00
Jim cab3dd6986 update eventlogger dep which should eliminate a possible panic with the gated.Broker is nil (#1411) 2021-07-22 14:05:28 -04:00
Jim 1daa3ebefe integrate events into the servers (#1355) 2021-07-08 15:50:25 -04:00
Jim 0b66464a3a fix typo in changelog 2021-06-30 18:08:47 -04:00
Jim a68f131089 update api dep 2021-06-30 18:07:14 -04:00
Jim b3a74584ca Add WriteSysEvent to the events package. (#1360) 2021-06-30 13:34:49 -04:00
Jim f483828286 update to 0.4.0 version 2021-06-29 07:19:00 -04:00
Jim 2ac5e0a6ad update sdk and api deps 2021-06-29 07:08:06 -04:00
Jim 4c0276b4af update sdk dep 2021-06-29 07:05:08 -04:00