Commit Graph
221 Commits
Author SHA1 Message Date
Louis Ruch 1662445e8e feat(storage): Wire up storage buckets in session recording 2023-05-31 12:18:14 +00:00
Louis Ruch 8ea61054cd feat(storage): Add support for Storage Bucket API 2023-05-31 12:18:14 +00:00
Danielle Miu a4a14fc7fc merged commit for plugin rework, storage bucket sql and proto, storage bucket secret rewrapping, storage bucket repository 2023-05-31 12:18:13 +00:00
Johan Brandhorst-Satzkorn ad62df6b36 cluster: pass controller ext to authorize conn
Make the controller extension availalbe to the protocol
context constructor.
2023-05-31 12:18:13 +00:00
Johan Brandhorst-Satzkorn 5837d6f387 target: add PostSessionAuthorization callback
The callback is called for any steps that need to be performed
after a successful authorization but before returning to the user.
2023-05-31 12:18:13 +00:00
Johan Brandhorst-Satzkorn 13e1196797 target: add error handling to authorize session
Attempt to undo operations if there are failures during
session authorization.
2023-05-31 12:18:13 +00:00
Johan Brandhorst-Satzkorn 517fc91ebf target: return selected worker when authorizing 2023-05-31 12:18:13 +00:00
Johan Brandhorst-Satzkorn 6d219bd5d1 target: add controller extension to service handler
The controller extension can be used to access types unavailable
in OSS.
2023-05-31 12:18:13 +00:00
Todd bc48f2d0e0 Add monitor session job proto and controller changes
This adds a new Job type that is for generic session state monitoring.  Monitoring sessions does not include any information about specific connections.
2023-05-31 12:18:12 +00:00
Jim 4d60f42210 feat(bsr): add bsr kms support in config, dev and tests 2023-05-31 12:18:12 +00:00
Louis Ruch 798a1f952a feat(storage): Add support for storage plugins 2023-05-31 12:18:12 +00:00
Damian Debkowski 9ef94892f4 test(plugin): Support storage service in loopback plugin 2023-05-31 12:18:12 +00:00
Louis Ruch 351444f1bd refact(plugin): Move host loopback plugin into internal/plugin/loopback 2023-05-31 12:18:12 +00:00
Jim c4b31313a6 feat (controller): define a ControllerExtension 2023-05-31 12:18:11 +00:00
Johan Brandhorst-Satzkorn 7632143861 add session recording API definitions 2023-05-31 12:18:10 +00:00
Jim f9b45ca5b7 refact: extend registerControllerUpstreamMessageService to reg hdrs
Extend registerControllerUpstreamMessageService to register upstream
message handlers
2023-05-31 12:18:10 +00:00
Jim 410bec1e00 feature(worker/controller): register UpstreamMessageServiceServer 2023-05-31 12:18:10 +00:00
Jim 20cf521cc0 feat(bsr): add bsr kms support in config, dev and tests 2023-05-31 12:18:10 +00:00
Michael Milton 9ae2bdfae6 feat: license util config (#3248)
* feat: license util config

* address comments

* introduce census job

* add job

* fix import groups

* remove pointers
2023-05-30 18:20:49 -04:00
Jeff Mitchell 769a7c9e1c Remove cleanup calls for test controller/worker (#3245)
A previous commit added a call to t.Cleanup in the
NewTestController/NewTestWorker commands; as a result these statements
are no longer needed.
2023-05-26 14:57:32 -04:00
Hugo dba7d88523 fix(handlers/scopes): Whitespace on Name and Description fields (#3235)
This commit fixes the behaviour of scopes where whitespace was allowed
(and thus persisted) in the Name and Description fields.

It also adds some more tests for scope Create and Updateto cover more
error cases.

For scope update, `handlers.ValidateUpdateRequest` exists, however this
was not used as it does not work properly for requests where the
`global` scope is updated.

In `ValidateUpdateRequest`, an ID check is performed and it assumes
there's always a resource prefix (eg: "p", "o") and an identifier
(random numbers and letters) after the prefix. This fails for `global`.
See `handlers.ValidId`.
2023-05-25 15:43:52 +01:00
Jeff Mitchell e8559d142a Fix worker auth rotation test (#3243)
Most of the changes here are changes or enhancements that are useful for
tests. The crux of the issue was that I had pulled up one var to the
package level so it could be read from tests, but that var was not being
reset between tests. It's not even used in tests anymore, so I put it
back to function-local.
2023-05-24 23:33:51 -04:00
Jeff Mitchell e0787f4de0 Simplify worker auth rotation timing logic (#3237)
* Simplify worker auth rotation timing logic

* Add some jitter
2023-05-20 21:05:19 -04:00
Jeff Mitchell 77fd51fb12 Add more logging to worker auth rotation and test flags
This makes it much easier to figure out when and why rotation is
happening and control it for tests/debugging.

Remove cert skew

Cherry-picked from release/0.12.x
2023-05-19 17:14:33 -04:00
Jeff Mitchell 037dc0cf18 Add missing nil check in test 2023-05-05 11:56:28 -04:00
Jeff Mitchell f9f7ee2cc4 Fix build 2023-05-05 11:52:41 -04:00
Jeff Mitchell bbe9719e19 Add tracking of worker used for injection (#3204) 2023-05-05 09:22:54 -04:00
Elim Tsiagbey a2f8d87bfb Add support for setting, adding & deleting LDAP account assoicated to a user (#3198) 2023-05-03 09:45:29 -04:00
Jeff Mitchell c6d7dc01a0 Exit before filtering if no workers are listed (#3196)
This is just an early error message to avoid running the filtering
function if there are no workers to begin with.
2023-05-01 14:20:27 -04:00
Jim 667ea285be feature (boundary dev): add support for dev ldap auth method (#3192) 2023-04-28 11:35:54 -04:00
Jeff Mitchell e7bf134710 Enhance tcp client port vet logic (#3175) 2023-04-21 09:34:59 -04:00
Jeff Mitchell 20391e3503 Add default client port to targets and use in connect command (#2767) 2023-04-21 06:50:53 -04:00
Damian Debkowski c5b1b7bbc7 fix(handler): return human readable error for json cred w/ empty object (#3109)
* fix(handler): return human readable error for json cred w/ empty object

* fix(handler): sync error messages for create/update json cred

* fix(handler): sync error logic for create/update json cred
2023-04-19 10:17:07 -07:00
Jim a4f54cb98f refactor (events): QOL fix: turn off events for tests. (#3163) 2023-04-14 20:01:14 -04:00
Hugo Vieira 45dc8251ec feat(api): Support plugin host external_name field 2023-04-04 18:51:04 +01:00
Jeff MitchellandIrena Rindos bdf7bf7702 Do not allow PKI-KMS workers to have names updated via API (#3143)
Do not allow PKI-KMS workers to have names updated via API

This would cause their public IDs to change, which we do not want.

Descriptions are also disallowed, since those come from the config file.

This also adds logic to allow upgrading from old KMS method to new, with
a test.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2023-04-03 17:44:41 -04:00
Haotian 5b26634b8a feat(ui): serve controller metadata from ui handler (#3120)
* adds noop metadata function to OSS UI handler
* removes old-style build tags for UI handler files
2023-03-31 13:09:48 -07:00
Jeff Mitchell 163ce184b8 KMS-PKI Workers (#3101)
This adds a new mechanism for worker authentication that uses the
third-party arbitration of the original KMS flow by leveraging
recently-added capabilities in nodeenrollment to support a registration
wrapper. This allows for workers to be registered to the system with
just a name and a matching wrapper, while at the same time allowing
these workers to be used for private Vault access and multi-hop as they
contain per-worker encryption keys and support rotation.

Nodes using this mode will generate and rotate credentials in-memory
(using another recently added nodeenrollment capability) so will have a
new set of keys on every startup. This has the side effect of ensuring
that there is never a conflict or re-use of these credentials.

Note that the normal test worker flow was using the now-deprecated KMS
method; there is still a test that uses this (explicitly) but all other
tests using test workers that did not specify a specific PKI flow now
actually use this mechanism. This means there is fairly decent test
coverage in a general sense, plus the specific tests updated/added for
this feature.

This also adds a new KMS type that can be used to have
distinct KMSes for upstream authentication vs. accepting from
downstream.
2023-03-30 16:20:28 -04:00
Elim Tsiagbey 16f48686a7 Refactor Target Repository (#3092)
- Refactor the Target domain repository functions so that they no longer return 4 different types.

`Target` struct now contains `HostSource` & `CredentialSources` with Getters & Setters

- Extending `Target` to contain `HostSource` & `CredentialSources` enables `funcs` to just return `Target` instead of multiple return types.
This also allows easy future refactors and extensions of `Target`
2023-03-30 15:19:30 -04:00
Jeff Mitchell fc664eb35f Improve grant validation (#3081)
This adds several relationships into the resource package that are then
made use of to improve the grant validation that runs during Parse. By
understanding mappings between ID and resource type the validation
checks can far better align with actual allowed grant formats so we can
find several common misunderstandings before they simply result in an
authorization failure.

In the future some of these functions could be used in the logic in the
actual ACL checks but it's not currently necessary and I don't want to
lump that change in with this.

Note that the tests have not meaningfully changed, but they _have_ had
to be updated because the stricter validation is actually catching
issues.
2023-03-16 10:11:55 -04:00
Jim 86192f75eb feature (auth/ldap): add LDAP auth method along with associated accounts and managed groups (#2912)
* feature (auth): required schema changes for auth ldap method (#2669)

chore (auth/ldap): move schema changes to next avail migration number

* feature (auth/ldap): define AuthMethod and all its value objects (#2703)

* feature (auth/ldap): storage protos
* feature (auth/ldap): define AuthMethod and all its value objects

* feature (auth/ldap): add repo and reading an auth method (#2718)

* feature (auth/ldap): add Repository.CreateAuthMethod(...) and Repository.DeleteAuthMethod(...) (#2724)

* feature (auth/ldap): add Repository.UpdateAuthMethod(...) (#2739)

* feature (auth/ldap): add Account

* feature (auth/ldap): add AuthMethod.EnableGroups

* fix (auth/ldap): refactor AuthMethod.oplog to enforce proper constraints

* feature (auth/ldap): add Account repo functions

* refactor (auth/ldap): remove entry attributes from account

Realized the entry attributes could have absolutely anything in them
(including binary data) and since we absolutely don't have to have them
there's just no reason to take on the risk.

* feature (auth/ldap): add AuthMethod.UseTokenGroups

* feature (auth/ldap): add Authenticate(...)

* refactor (auth/ldap): ensure options take a context as the 1st parameter

* feature (auth/ldap): add Account attribute maps

* chore (auth/ldap): make fmt deltas

* feature (auth/ldap): add managed groups (#2760)

* tests (auth/ldap): add missing unit test to Repository.DeleteAccount(...)

Add bits to test the delete operation when you're not able to generate
oplog metadata

* feature (auth/ldap): add managed groups

fixup! feature (auth/ldap): add managed groups (#2760)

* feature (auth/ldap): service proto definition (#2761)

* feature (handlers/authmethods): add handlers for ldap auth method operations (#2794)

* feature (auth/ldap): add Account attribute maps

* chore (auth/ldap): update cap/ldap to latest version

* feature (auth/ldap): add ldap api generation definitions

* feature (authmethods): add ldap repo NewService(...)

* feature (authmethods/ldap): add proper mask_mapping to protobufs

* feature (authmethods): add support to get an ldap auth method

* refactor (auth/ldap): export TestGenerateCA(...)

* feature (authmethods): add support to create an ldap auth method

* feature (authmethods): add support to delete an ldap auth method

* feature (authmethods): add support to list ldap auth methods

* refactor (auth/ldap): make urls optional for NewAuthMethod(...)

* refactor (auth/ldap): export ldap.TestInvalidPem

* chore: make fmt changes

* fix (auth/ldap): properly handle group search config

Add constraints and tests to ensure when an ldap AuthMethod.EnableGroups
is true, and UseTokenGroups is false; that there's a GroupDn configured
for finding a user's associated groups

* feature (authmethods): add support to update an ldap auth methods

* chore (db/ldap): tmp mv migrations so there's no conflict with ongoing work

* feature (verifier): add ldap auth method to verifier bits

* fix (controller): prevent panic when controller stops when there's no listener

* feature (authmethods): add support to authenticate via ldap auth methods

* chore (migrations): fix whitespace in stmt

* chore: fmt fixup

* tests (auth/ldap): invalid err msg

* feature (cli/authmethods): add support for ldap auth-methods CRUD and authenticate (#2810)

* feature (authmethods): add CLI support for ldap auth methods CRUD

* tests (api/auth): ldap auth method classification tests

* feature (authmethods): add CLI support for ldap auth authenticate

* feature (auth/ldap): set request timeouts for ldap server connections

* feature (handlers/authmethods): handle u_anon listing properly.

* feature (account/handers): ldap account and managed group CRUDL APIs (#2852)

* feature (auth/ldap) add repository Listing of ManagedGroupMemberAccount

* feature (controller/handlers): add ldapRepoFn to accounts service

* feature (auth/ldap) register ldap managed group subtype

* feature (account/handlers): ldap account CRUDL APIs

* feature (controller/handlers): add ldapRepo to managed groups service

* feature (account/handlers): ldap managed group CRUDL APIs

* docs (domain): add LDAP accounts, auth-methods and managed groups (#2857)

* feature (ldap/cli) add ldap accounts and managed groups CRUDL commands (#2856)

* fix (handlers/authmethods): fix ldap authorized actions (#2892)

* feature (cli/ldap/authenticate): use primary auth method if none is provided (#2890)

* fix (auth/ldap): support setting the state attribute

* feature (cli/ldap/authenticate): use primary auth method if none is provided

* feature (wh/ldap) add tests for new ldap auth method and accounts (#2919)

* refactor (migrations/ldap): mv to correct directory

* chore: add copyright headers

* fix (api/authmethods/ldap): renumber new LdapAuthMethodAttributes field

* fix (auth/ldap): allow the auth method state to be updated (#2951)

* chore: update sdk and api versions for llb - this is tmp until merging

* tests (managed groups): add required errContains for new test
2023-03-15 11:40:40 -04:00
Jeff Mitchell b76b24a4ad Move prefixes for many packages into the globals package (#3069)
This is a prerequisite for some enhancements to grant validation
2023-03-10 15:06:39 -05:00
Todd 6adc0c86b5 Rename downstream router to receiver (#3068)
This was done previously but these were missed.
2023-03-10 09:33:09 -08:00
Jeff Mitchell b2bab45c13 Port over changes (#3061) (#3062) 2023-03-07 16:29:34 -05:00
Johan Brandhorst-Satzkorn 18eed58ec5 fix(targets): Use correct error string in enterprise (#2984)
In enterprise the error is different, so we need a different
test error string to compare against. Create a variable
that can be overwritten in the enterprise repo.
2023-02-16 20:34:25 -05:00
Johan Brandhorst-Satzkorn 8a0ee97f3b fix(targets): Readd WorkerFilterDeprecationMessage (#2982)
This variable is updated in the enterprise repo and needs to stay.
2023-02-16 17:56:18 -05:00
Johan Brandhorst-Satzkorn ac3543bdfb fix(targets): Use correct field name in deprecation warning (#2978) 2023-02-16 14:36:23 -05:00
Todd fe5b554370 AuthorizedDownstreamWorkers now separated from AuthorizedWorkers to maintain API compatibility (#2957)
* AuthorizedDownstreamWorkers now separated from AuthorizedWorkers to maintain API compatibility
2023-02-13 13:52:25 -08:00
Johan Brandhorst-Satzkorn cf412b95a2 fix: Support streaming HTTP responses (#2956)
* all: Upgrade listenerutil dependency

The new listenerutil implements http.Flusher, which is necessary
for streaming responses from the grpc-gateway to work.

* daemon/controller: Remove newline delimiter in streaming responses

The default gRPC-Gateway HTTPBody marshaler uses newlines
as a delimiter. This introduces newlines in our streamed responses.
Wrapping the default marshaler lets us define a nil delimiter, which
ensures our streaming responses are unaffected by the server side
chunking.
2023-02-13 14:56:53 -05:00
Todd 1e89be1b1a Downstream worker connections are tracked by worker id (#2949)
When possible downstream workers will include their worker id information in
the connections they establish with the upstream using the nodeenrollment
library.  The tracking listener now tracks connections that are connected in
this same way instead of just connections of type *tls.Conn.
2023-02-10 15:27:42 -08:00