Commit Graph
151 Commits
Author SHA1 Message Date
Jeff Mitchell 7ff4b7f106 Send connected RPC to controller (#386) 2020-09-20 23:09:42 -04:00
Jeff Mitchell 4669c95999 Pass more session info around, make proxy UX nicer (#385) 2020-09-20 21:18:07 -04:00
Todd Knight e937b0ea27 Sessions Read/List/Cancel API and SDK (#369) 2020-09-20 20:22:57 -04:00
Jeff Mitchell f7e48ec836 Plumb connection limit to proxy and output it (#384) 2020-09-20 16:28:00 -04:00
Jeff Mitchell 697ea561e0 Fix breakage from dual merges 2020-09-20 16:04:05 -04:00
Jeff Mitchell edffc7863d Change connection limit to -1 for unlimited so it works with TF (#383)
* Migrate connection limit unlimited value to -1

* Fix authorization check
2020-09-20 15:53:49 -04:00
Jeff Mitchell 5214f14105 Work on connection authorization (#381) 2020-09-20 12:51:08 -04:00
Jeff Mitchell 5bf555cca2 Remove connection idle timeout seconds for now (#379) 2020-09-19 14:01:49 -04:00
Jeff Mitchell e002326293 Plumb timeouts to worker and set appropriate deadlines (#378) 2020-09-19 13:51:50 -04:00
Jeff Mitchell 0a3f9b8357 Rename connection idle timeout duration -> seconds and sessions max duration -> seconds (#376) 2020-09-19 11:32:38 -04:00
Jeff MitchellandJim Lambert 62baef1b7e Add multi connection parameters through targets and into session creation (#375)
* Update protos and gen

* Add new values to targets CLI command

* Lots more plumbing of new parameters through everything

* allow fields to be set to zero value.

* Disallow set but empty name/description strings in create/update verifiers

Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
2020-09-19 10:31:49 -04:00
Jeff Mitchell 07a7e9750a Tie together the database-driven session handling with the worker and add relevant CLI comands (#370) 2020-09-19 00:18:17 -04:00
Jeff Mitchell ff8ce053e1 Don't try to recreate resources when adding test cluster members 2020-09-17 16:06:27 -04:00
Jim 611288bdc7 basic sessions (#337) 2020-09-16 12:02:02 -04:00
Jeff Mitchell a67d5c8abb When logging urls, also log method 2020-09-16 10:21:35 -04:00
Jeff Mitchell 37e9fed2e3 Allow not destroying dev databases (#366)
This also shifts some logic around to better prepare for non-dev-mode
workloads, although it does not actually call the KMS creation functions
and initial auth method creation from non-dev commands yet.
2020-09-16 10:10:06 -04:00
Jeff Mitchell c4e2b88022 Add database URL. (#365)
* Add database URL.

This allows specification of either a file://, env://, or other string.
If it starts with file:// or env:// the actual value will be read from
those resources.

* Tidy up the KMS output

* Also run migrations in test mode when specifying the URL
2020-09-16 09:28:39 -04:00
Todd Knight f96fa25157 Add Auth Account id to Auth Token response (#363) 2020-09-15 14:33:38 -07:00
Jeff Mitchell f4ad22b247 Move default port to a TCP target attribute (#361) 2020-09-15 15:20:49 -04:00
Jeff Mitchell eb88d0381a Fix default port update handling 2020-09-15 02:15:33 -04:00
Jeff Mitchell a00ee7a948 Add Result types to Go SDK and properly populate body/map fields (#358) 2020-09-15 01:08:21 -04:00
Jeff Mitchell 6201357902 Use scope-specific token DEKs (#342) 2020-09-14 12:30:11 -04:00
Todd Knight b998591add Adding and updating host address validation checks (#350) 2020-09-12 22:07:56 -07:00
Todd Knight 33e7b4538e WorkerCoordination and GetSession API refactoring (#354)
* Possible api changes.

* Worker API update.

* Updating import alias name.

* Moving session down a level as a member of the GetSessionResponse.

* Marshal the auth flag into the GetSessionResponse proto instead of the session.
2020-09-12 21:54:18 -07:00
Jeff Mitchell 2914b4c14c Use base58 for a few more user-facing values (#356) 2020-09-12 21:43:08 -04:00
Jeff Mitchell 41ed95bdec Remove old-style pathing (#353) 2020-09-11 17:41:03 -04:00
Jeff Mitchell 60396e4384 Properly populate ScopeInfo from group member actions (#340) 2020-09-09 11:37:23 -04:00
Jeff Mitchell f8237fb945 Move some packages into SDK, out of internal 2020-09-09 01:24:25 -04:00
Jeff Mitchell f94f21fd97 Update API codes (#336) 2020-09-08 23:57:26 -04:00
Todd Knight 99d5456d7a Scopes type field and types in updates allowed (#335) 2020-09-08 16:04:19 -07:00
Todd Knight c3ecea172d Generate new version of SDK resources and Add Tests (#331) 2020-09-08 16:27:51 -04:00
Todd Knight 1c2c078e0a Adding Authz checks that support new pathing (#328) 2020-09-04 14:48:11 -07:00
Jim 3d944a616f fix name typo (#330) 2020-09-04 17:11:51 -04:00
Jeff Mitchell 23156afa11 Add in most of the proxy flow (#326) 2020-09-03 13:24:34 -04:00
Todd Knight c55153ff3d Fix allowed scope checks and added tests for creating in global scope. (#327) 2020-09-03 08:02:30 -07:00
Todd Knight 37e56ab46b Pathing updated to support new and old styles (#323) 2020-09-02 19:43:41 -07:00
Todd Knight 544e78b593 Target Handler and SDK CRUDL & add|set|remove-host-sets methods. (#310) 2020-09-01 15:05:46 -07:00
Todd Knight 24ec9620ca fix: Correct missed name updates to OutgoingInterceptor. 2020-09-01 10:08:18 -07:00
Jeff Mitchell c4522aa813 Update host sets and auth system to new paradigm (#319) 2020-09-01 12:31:54 -04:00
Todd Knight 0aba6db720 Enable Split Cookies (#318) 2020-09-01 09:23:41 -07:00
Jeff Mitchell 20aef738c4 Add host-catalogs CLI command. (#312) 2020-08-28 00:17:09 -04:00
Jeff Mitchell 17ecb6f2ce Separate accounts/host catalogs/host sets into their own packages (#311) 2020-08-27 20:43:33 -04:00
Jeff Mitchell 274afa6b02 Shave off an IAM lookup if the user is the anonymous user (#305)
* Shave off an IAM lookup if the user is the anonymous user

* Fix build

* If authz failures are turned off, make the token type unknown instead of invalid

* Change returned token format when authz failures are disabled

* Change logic back

* Fix logic
2020-08-26 23:28:38 -04:00
Jeff Mitchell b53812a5c1 Add ability to skip automatic auth method creation (#306)
This is useful if you, for instance, want Terraform to be 100%
responsible for creation of resources (outside of the static ones that
cannot be removed or modified, like u_anon). This will mean using the
recovery mechanism for initial setup, but that isn't an issue once TF
supports that :-)
2020-08-26 23:27:46 -04:00
Jeff Mitchell 490be8a7e4 Add ability to skip role creation on scope create (#308)
* Initial work on scope creation skipping

* Fix things
2020-08-26 23:27:25 -04:00
Todd Knight e4da5e9ab5 add|set|remove-hosts for host-sets SDK and API (#304)
* Adding ability to add host set members.

* Adding SDK and API for add|set|remove hosts.
2020-08-26 11:04:26 -07:00
Michael Gaffney 9ca8a4ec20 Host set members (#301)
* Update host set member test

* Add ListSetMembers method signature and doc

* Move repository methods for host set members to new file

* Add TestSetMembers

* Implement ListSetMembers

* Return hosts from ListSetMembers

* Implement AddSetMembers

* Implement DeleteSetMembers

* Use sql.QueryContext not sql.Query

* Implement SetSetMembers

* Refactor: extract getHosts method

* Refactor: extract createMembers method

* Refactor: extract common functions

* Return correct count of changed

In SetSetMembers, retrieving the current list of hosts in the set
happens after the transaction to modify the set has completed. This
retrieval can result in an error but the number of modified rows is not
effected.

* Make list set members an unexported method

* Get hosts within the same transaction as mutations of the set

* Return hosts of set from LookupSet method

* Return hosts of set from UpdateSet method

* Remove listSetMembers

* Fix merge conflict

* Add NOTE and TODOs about using new pattern in "SetMembers" methods
2020-08-26 12:31:18 -04:00
Jeff Mitchell 39721047e4 Fix CORS test 2020-08-25 12:45:16 -04:00
Jeff Mitchell 8f579c75c3 paum -> ampw (#303) 2020-08-25 00:21:08 -04:00
Jeff Mitchell 74544f6324 Encrypt tokens on the way out and decrypt on the way in (#302)
* Encrypt tokens on the way out and decrypt on the way in

This isn't a security feature related to tokens specifically; it's so
that we can discard cryptographically bad tokens before we ever hit the
DB. This way we can't pass through a DDoS to the database due to
fetching obviously invalid token values.

I'm using base58 to encode the resulting value as there aren't great
base62 options, and allowing base64 / and + values can hamper usability
by creating copying/highlighting breaks.
2020-08-25 00:20:50 -04:00