Commit Graph
113 Commits
Author SHA1 Message Date
Jeff Mitchell 271cc8f781 Add ssh private key to CLI (#2265) 2022-07-19 16:58:03 -04:00
Louis Ruch ef5ac07f02 Add ssh_private_key support for Vault libraries and targets (#2263)
* Add support for ssh_private_key credential type in Vault libraries

* Add support for ssh_private_key credential type

* Support jsonpointer for Vault library mapping overrides
2022-07-19 10:31:53 -07:00
Jeff MitchellandLouis Ruch 011e2e7425 Add ssh private key type and add type to static store (#2262)
Co-authored-by: Louis Ruch <louisruch@gmail.com>
2022-07-18 19:16:11 -04:00
Jeff Mitchell 8c56a5648d Migrate plugin host/set/catalog prefixes to typed (#2256)
* Migrate plugin host/set/catalog prefixes to typed

* Add credential store typing too
2022-07-15 13:09:55 -04:00
Haotian 28f53a64b4 feat(workers): implement worker service add/set/remove api tags 2022-07-14 10:19:03 -07:00
Jeff Mitchell fb3b2209e5 Add WithType to worker listing (#2252) 2022-07-11 15:14:22 -04:00
Jeff Mitchell 81af61ae7d Add client next protos to KMS connection info (#2246)
This builds on the previous change in the nodeenrollment library to
allow KMS connections to store incoming ALPN NextProto information.
2022-07-08 15:58:57 -04:00
Jeff Mitchell 1596ff3d1c Update against new nodee conn type (#2245) 2022-07-08 14:14:17 -04:00
Jeff Mitchell 6b48346bf3 Add managed worker address fetching (#2244) 2022-07-07 19:02:16 -04:00
Jeff Mitchell ca387223b8 Retry faster on initial status (#2243)
Right now there is a bit of a race condition in that a status call that
indirectly tells the controller that a worker is ready to accept
sessions can have its response unable to be processed in time for an
actual session to come in from a client. It's very unlikely but
technically there.

This changes where we check if we have ever successfully authenticated
from the function called by the ticker to the ticker itself, allowing us
to reset the timer to a very short time if we have not yet
authenticated. We already have the initial timer set to 0 for "as soon
as possible" behavior, but if that initial status failed we'd wait for
the normal interval. Now we will instead continue with the "as soon as
possible" behavior, and reduce the very unlikely race condition to
extremely unlikely.

(There are more permanent fixes but those are bigger and can come
later.)
2022-07-07 12:13:17 -04:00
Todd 155c5f578b Create session manager for workers to use to interact with sessions (#2235) 2022-07-06 13:37:49 -07:00
Jeff Malnick 1f66685864 feat: set default connection limit to unlimited (-1) instead of 1 (#2234)
This avoids the confusion behavior of a session terminating as soon
as a single connection using that session is closed.
2022-07-06 12:02:56 -04:00
Damian Debkowski 3e9c99c217 refactor(user_password) rename all references of user_password to username_password (#2232) 2022-06-27 14:03:12 -07:00
Damian Debkowski afd4437492 fix(error) validate credential store id when creating username/password credentials (#2231) 2022-06-24 09:16:11 -07:00
Todd 9af6c09c36 Move generated pb.go file in to the internal/gen directory (#2225) 2022-06-23 12:16:16 -07:00
Todd 19b549c44a Rename package servers to server (#2222) 2022-06-20 18:20:17 -07:00
Jim aaf669a044 fix (API): check attributes missing appropriately. (#2219)
* fix (API): check attributes missing appropriately.
2022-06-19 10:55:37 -04:00
Jeff Mitchell f5bf3b2c0c Add events on session activation and connection authz/close (#2215)
* Add events on session activation and connection authz/close

* Only send success event on actual success
2022-06-17 16:20:01 -04:00
Jeff Mitchell c31b8a4383 Fix harmless but nasty-looking error (#2214)
If a worker starts up and tries to connect to a controller before the
controller has a chance for its rotate roots job to run, it'll spit out
a nasty-looking error. It's harmless (things just retry and then work)
but scary (`tls: internal error`).

Rotating at creation time ensures that it's ready by the time a worker
is able to perform any connection against the cluster port.
2022-06-17 16:08:01 -04:00
Jeff Mitchell 6ffef1e4b5 Update nodeenrollment dep 2022-06-17 10:56:30 -05:00
irenarindos b7120bf88e bug(workers): Do not update description for status update 2022-06-16 18:15:44 -04:00
Louis Ruch 9671daf6e0 Revert "refactor(user_passsword) change all references of user_password into username_password (#2189)"
This reverts commit ab58b24142.
2022-06-16 11:11:39 -07:00
Damian Debkowski ab58b24142 refactor(user_passsword) change all references of user_password into username_password (#2189)
* (refactor) change all sql references of user_password to username_password

* refactor(pkg) renamed pkg userpassword to usernamepassword

* refactor(proto) updated protocol buffers to use UsernamePassword

* refactor(code) updated references from UserPassword to UsernamePassword in golang files

* refactor(test) updated unit tests to reference UsernamePassword changes

* refactor(ddtest) updated references in dbtests to use UsernamePassword

* chore(sql-test) fixed spelling issue

* chore(sql) added and updated comments in migartion & tables. fixed indentations

* chore(proto) updated comments to reflect username_password changes

* refactor(tests) updated unit tests to replace user-password with username-password

* refactor(cmd) updated cmd help text to use username

* chore(tests) update test name & comments

* fix(cmd) fixed cmd usage definition for credentials update

* refactor(tests) removed out of scope changes

* fix(sql) incremented sql migration id & updated migration comments
2022-06-16 10:56:46 -07:00
Jeff Mitchell a589c32269 Minor capitalization change 2022-06-16 09:21:11 -05: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
Jeff Mitchell 32d04b9ce7 Allow a worker to use KMS auth but accept PKI for proxy (#2206)
This essentially worked for non-dev mode before but would create storage
directories that weren't actually used or needed, and it didn't work in
dev mode because it made assumptions about the presence of a worker auth
kms or not. This fixes those behaviors.
2022-06-15 22:39:52 -04:00
Jeff Mitchell 9a4545e59e Fix eventing and worker name setup (#2204)
* Don't automatically create worker names, as this is now invalid for
  PKI workers
* Fix a check in dev that clears out name/description in exactly the
  wrong cases
* Change eventing setup to use a hostname-based ID instead of the name
  (which could change on every start anyways)
2022-06-15 20:01:03 -04:00
Todd 214ca9a668 Check that WorkerAuthKms is not nil before trying to decrypt with it (#2205) 2022-06-15 16:26:08 -07:00
irenarindos be0f07cc65 Merge remote-tracking branch 'origin/llb-byow' 2022-06-15 18:04:08 -04:00
Jeff Mitchell 704d68848c Merge remote-tracking branch 'origin/main' into llb-byow 2022-06-15 16:45:00 -05:00
Louis Ruch 618bcb451e fix(target): fix type check (#2202) 2022-06-15 14:14:24 -07:00
Jeff Mitchell bfd9565010 Merge remote-tracking branch 'origin/byow-attrib-consolidation' into llb-byow 2022-06-15 16:04:16 -05:00
Jeff Mitchell 3d42737789 Don't display active connection count if it's not authorized (#2200) 2022-06-15 16:50:55 -04:00
Todd 72d122ef5c TestUpdate for PKI and KMS workers fixed for worker service. (#2199) 2022-06-15 13:47:02 -07:00
Johan Brandhorst-Satzkorn d06ac0d370 Propagate plugin execution dir to CreatePlugin (#2183)
* fix: Propagate plugin options to CreatePlugin

Plugin options were previously only applied to the
BuildPluginMap call, resulting in the plugin
execution_dir variable being ineffective.

Also add a test to verify functionality

* fix: Support plugin execution_dir for all plugins

Previously, only external host plugins would respect
the plugin execution dir. Now, all uses of the embedded
plugins respect the configuration.
2022-06-15 16:16:18 -04:00
Jeff Mitchell 4efbce3112 Add description updating via worker status (#2197) 2022-06-15 15:50:36 -04:00
Jeff Mitchell a83a4112ce Fix hcpb URL suffix 2022-06-15 14:47:32 -05:00
Todd b3efe0eb3a Allow TestPkiWorker to be created in an authorized state. (#2198)
* Allow TestPkiWorker to be created in an authorized state.
2022-06-15 12:42:50 -07:00
Todd e379234259 Remove CanonicalAddress, GetApiTags(), and NewWorkerForStatus. (#2196)
Minor testing tweaks are also included.
2022-06-15 11:47:38 -07:00
Jeff Mitchell 11b025c016 Start updates on worker service test (#2195) 2022-06-15 14:24:42 -04:00
Todd 90a999d3fe Some testing fixes (#2193) 2022-06-15 10:47:25 -07:00
Louis Ruch 68eb6e2bed chore(targets): remove deprecated credential libraries on target resources (#1533) 2022-06-15 08:56:24 -07:00
Todd beecbbb8a2 Upsert creates a new KMS and Updates PKI workers (#2187) 2022-06-15 08:27:08 -07:00
06d0f99536 bug(workersAPI): do not allow nonprintable or uppercase name or desc (#2186)
* Send more info on KMS connect (#2182)

* Update nodeenrollment to v0.1.0

* bug(workersAPI): do not allow nonprintable or uppercase name or desc

* Put checks on create too

* Apply printable check to description in DB

* chore (worker): address PR feedback

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Jim <jlambert@hashicorp.com>
2022-06-14 20:13:02 -04:00
Jeff Mitchell e6f6665bea Merge remote-tracking branch 'origin/llb-byow' into byow-attrib-consolidation 2022-06-14 17:39:18 -05:00
Jeff Mitchell 8335deb8b6 Update protos, generated code, and service handlers (#2188)
* Update protos, generated code, and service handlers

* Address review feedback
2022-06-14 17:54:35 -04:00
Louis Ruch 4b365db634 feat(target): Add support for static credentials during authorize-session 2022-06-14 13:04:35 -07:00
Louis Ruch 00dfea1244 feat(target): Add support for static credential as target credential sources 2022-06-14 13:01:17 -07:00
Louis Ruch 58d546cdd4 feat(credential): Add static credential store and username_password credential 2022-06-14 13:01:17 -07:00
Jeff Mitchell 8fd663af47 Send more info on KMS connect (#2182) 2022-06-14 13:27:55 -04:00