Commit Graph
141 Commits
Author SHA1 Message Date
Jeff Mitchell 4900f249e6 Update parseutil import location 2021-07-14 17:40:39 -07:00
Jeff Mitchell b533e12c1a Update password import 2021-07-14 17:38:52 -07:00
Jeff Mitchell ce52acb968 Update strutil import 2021-07-14 17:37:40 -07:00
Jeff Mitchell 44329d4ff9 Repoint mlock import 2021-07-14 17:33:23 -07:00
Jeff Mitchell 140c54e319 Repoint base62 import 2021-07-14 17:31:58 -07:00
Jeff Mitchell 051fe60718 Duplicate logging instead of using from shared secure libs, as it's going out of there and we'll be moving away from hclog anyways 2021-07-14 16:48:33 -07:00
Jeff Mitchell 2cbcf9a563 Update usage of shared-secure-libs (#1393) 2021-07-12 21:06:22 -04:00
Jeff Mitchell c9e4c877b8 Update shared-secure-libs for kms block fix (#1384)
Fixes #1305
2021-07-07 22:54:57 -04:00
Jim a68f131089 update api dep 2021-06-30 18:07:14 -04:00
Jim 2ac5e0a6ad update sdk and api deps 2021-06-29 07:08:06 -04:00
Chris Marchesi 9f9acce972 [Merge to main] internal/servers/worker: Controller failure connection cleanup (#1330) (#1357)
This commit adds some rudimentary functionality for cleaning up
connections on controller failure, or more specifically, a failure to
communicate with the controllers.

In this scenario, when a status cannot be sent for any reason for longer
than 30 seconds, the worker will close all connections that are normally
not cleaned up (so for sessions that currently are *not* in the progress
of being canceled or terminated). Status requests now time out after 10
seconds if they are not made successfully.

Session status is not touched during this process, but natural cleanup
or connectionless sessions will still occur. This should be okay, as the
session should be added on re-connect if need be.

A few other changes are made to cancelConnections: first, error logging
has been moved to the function so that we can handle errors requesting
cancellation directly within the function; this entails simply just
locally marking these connections as closed with a warning. Second,
there was a minor logging bug where closed connections were not properly
being noted in the last trace log, this has been fixed.

Additional changes:

* Circle: Set acceptance test no_output_timeout to 30m
2021-06-28 17:32:13 -07:00
Jim 83c65d0d4b update cap dependency (#1349) 2021-06-24 20:32:22 -04:00
df35699c4e Integrate with Vault to retrieve and manage per session credentials (#1308)
* Fix down migrations

* Udpates due to merge

* Sentinel values only have to be greater than 0

* Create credential related sdk structs and methods.

* Post merge interface updating.

* Removing scratch code that was not cleaned up.

* updates

* Convert client certificate and client certificate keys into pem blocks and validate.

* Add newline at end of file.

* Faster check for "s" at the end of a resource name when generating from templates.

* make fmt

* updates

* Add dynamic credentials to a session

* Refactor: move contents of file

* updates

* Updates

* Add InvalidDynamicCredential error

* Assign credentials

* Allow updating client certificates seperate from the client certificate key.

* Replace application purpose string with enum value

* PR feedback / fix go test .

* Delete dead code

* Use common view

* Refactor: extract interface and rename method

* Refactor: move code to eliminate privPurpLibrary

* Add comment to requestMap

* Refactor: do not export methods on an unexported struct

* Update internal/db/schema/migrations/postgres/10/03_vault_credential.up.sql

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Add comments to credential Purpose constants

* Reorder switch statements to handle errors first

* PR feedback

* update

* fix merge

* Organizing the scheduler code and extract the individual store creation test helper function.

* Run 'make fmt'

* Create certificate when creating store.  Allow vault address to be passed in as option

* Refactor: rename database views and associated structs

This change renames two database views and associated go structs to use
a consistent naming pattern. Views ending in 'private' contain encrypted
credentials needed for connecting to Vault. Views ending in 'public'
mirror the 'private' views but do not include any encrypted values.

This change does not include any changes to functionality or behavior.

* Adding SAD target operations for credential libraries to the SDK.

* Add status field and enumeration table for credential status

* Refactor: rename Status to TokenStatus

* Add status to vault credentials

* Creating the template for the CLI and helper functions.

* Add private database view for vault credentials

* Add scope_id to view and cleanup TODO comment

* Reformat embedded sql queries

* Add vault client helpers

* updates

* white space

* Add LookupLease test

* CLI commands for Store work.  Renamed fields in proto w/ vault prefix.

* Test issue credentials with client TLS

* Add additional checks to vault ping

* Add an error for vault token capabilities and create a VaultToken error kind

* Add support for working with Vault policies

* Use Vault 1.7.2 for testing

* Add testing helper for creating a vault client with a non-root token

* Fix Vault renew lease test

The Vault renew lease endpoint accepts an optional duration parameter
for requesting the number of seconds to extend the lease by. However,
Vault is not required to honor this request.

* Add a var for the required capabilities of a boundary Vault token

* Enhance the test helper for adding a policy to Vault

* Allow the test role in postgresql to revoke credentials

* Remove out of date comments

* Enhance Vault test helpers for the database secrets engine

* Reformat comments

* Add a method for getting the capabilities of the current Vault token

* Add revoke lease to internal Vault client

* Reformat: combine err return line with check for nil line

* Remove redundant checks in test code

Remove checks in test code that are redundant with checks in the test
harness.

* Refactor CreateToken test helper to return the secret and the token

* Fix build failures caused by signature change in vault.CreateToken

* Fix Vault version and Vault API link in comments

* ran `make gen` after merging from mgaffney-vault.

* Remove Vault prefix from attribute fields in API, create a base CLI option for adding field prefixes. format now uses that prefix for error reporting.

* Template now allows attaching attribute field prefixes.

* Credential store uses PrefixAttributeFieldErrorsWithSubactionPrefix.

* Fixing naming of vault flags and helper flags.

* Updating more references to generated api methods.

* Make the capabilities String method more readable

* Add comment outlining PrintApiError usage of Options.

* Refactor test to move declarations closer to first use

* Fix comment

* Implement revoke method on vault repository

* Tests now verify certs, CA, and tokens, addresses can be updated in a store.

* Added test for creating store with pk/cert in same field.

* Allo updating certificates seperate from private key.  Only contact backing vault service when updating token.

* Fixing bad tests and removing unused code.

* Adding tests for various ways of updating tokens.

* Add private credential

* Add token revocation job and cred renewal/revocation job

* Regen after merge.

* Fixing field mask related merge error.

* Create Library CLI. Removes vault prefix from path. Adds a WithoutCleanup testOption for vault.

* Set all credentials to revoked when a token is revoked

* Fixing missed renaming update.

* fix copy/paste error.

* Fixing code generation errors after merge.

* make gen after merge.

* Update internal/cmd/commands/credentialstorescmd/vault_funcs.go

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Update internal/cmd/commands/credentialstorescmd/vault_funcs.go

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Update internal/cmd/commands/credentialstorescmd/vault_funcs.go

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

* Refactor: move migrations from 10 to 12

* Removing logic from transaction.

* wrapping client errors in the calling op for CredentialStore's client() method.

* Redact token

* redact client key

* updates

* Add trigger to revoke credentials when session is canceled or terminated

* Fixing some help text for some flags.

* Add ability to load values from files (file://) or environment variables (env://).

* Updating comments

* fix bad merge

* feedback

* Adding issued credentials to sessions.

* Error on capabilities

* updates

* Expose NewVaulTestServer

* Add godoc

* Adding generated SessionCredential struct for API.

* Progress on building handler test for Authorize Session.

* feedback

* Update policies

* Add 'revoke' as a status for Vault Tokens

* Add delete_time to vault credential store

* Create dynamic credentials at session creation time.

* Tests pass with credentials attached to AuthorizedSession result.

* Only call issue if there are credentials to issue.

* Fixing output only issues. Adding type to credential library.

* Fix test to clear un/pw generated.  confirm generated un/pw changes from 1 authorize session call to another.

* Update lookupTokenError

* Add delete_time to private credential store

* Refactor: move private store to separate file

* Fixing tests for AuthorizeSession and verifying error cases.

* Only create the credential repo if there are credentials to issue.

* Rename Library field to CredentialLibrary.

* Fixing missing change of Library to CredentialLibrary.

* Removing Default SDK functions for fields which are required and update CLI to match.

* Replace resource specific id variables with "id" and the input parmater for paths to be just a single string and the resource name as it should show up in the path.

* Soft delete vault credential stores

* Prevent new SQL functions from silently overwriting existing functions

* Rename "Hmac" to "HMAC" in the human readable cli response table.

* Fix tests

* Add vault database cleanup jobs

* Add ability to set the token period in the vault test harness

* updates

* Add not_null_columns func test

* remove unused struct

* Up no output timeout

* Validate current vault token on addr update

* Fix client cert change test

* add cert test

* Update revocation job where

* Fix comment

* Use Vault's default port in CLI help strings

* Remove down migrations

* Increase migration file numbers by 1

* Run make migrations

* Move migrations from 12 to 10

* Increase Circle CI timeout for acceptance tests

* Fix spelling mistake in error messages

* ASD cmds for Target and returning credentials to AuthSession request (#1338)

* Add Add/Set/Remove commands for libraries on Targets.  Return credentials on AuthorizeSession request.

Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>

Co-authored-by: Louis Ruch <louisruch@gmail.com>
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-06-22 22:26:26 -04:00
Jeff Mitchell 09bdb498bd Update grpc, grpc-gateway, and a few other deps (#1325) 2021-06-17 09:46:39 -04:00
Jeff Mitchell 8c63ede9cc Update some deps (#1324) 2021-06-15 13:34:24 -04:00
Jim Lambert aa41676dc9 make gen changes prior to staging release 2021-06-08 13:12:26 -04:00
Jeff Mitchell d6ef2732e7 Merge remote-tracking branch 'origin/main' into ICU-1573 2021-06-07 15:21:30 -04:00
Jim cc2c71a261 base types for events package (#1275) 2021-06-06 07:57:24 -04:00
Jeff Mitchell 6c9b9e948e Add the bits to actually read filters and assign values to users (#1261) 2021-06-01 20:15:57 -04:00
Jim a1b338f253 bump dependency to get a fix for https://github.com/coreos/go-oidc/pull/259 (#1238) 2021-05-18 13:02:48 -04:00
Jim e064e26f58 update cap dependency (#1231) 2021-05-17 16:55:41 -04:00
Jeff Mitchell a23d68b0dd Bump some deps (#1228) 2021-05-17 13:37:34 -04:00
Jim Lambert 3564956572 update api dep 2021-05-04 21:44:08 -04:00
Jeff Mitchell 77a85636c2 If we're going to use replace directives, use SDK too 2021-04-21 12:05:37 -04:00
Jim 75108cbc8b Ongoing OIDC: return the primary account info along with the user. (#1145) 2021-04-20 20:33:56 -04:00
Jeff MitchellandSam Salisbury a90a64d787 Use Go 1.16 native embedding and remove go-bindata (#1151)
Co-authored-by: Sam Salisbury <samsalisbury@gmail.com>
2021-04-20 10:45:05 -04:00
Jim 9b36dbb628 replace go mod statements for api and sdk (#1146) 2021-04-18 19:04:31 -04:00
Jeff Mitchell 1558b8e52b Bump PQ dep (#1137) 2021-04-15 14:14:21 -04:00
Jeff Mitchell be10cc4b42 Update grpc/proto deps (#1136)
* Update grpc/proto deps

* Make gen
2021-04-15 14:11:23 -04:00
Jeff Mitchell 8332eb10c5 Update websocket, vault/sdk, and hclog deps (#1135) 2021-04-15 12:31:15 -04:00
Jeff Mitchell e860e5f778 Bump to Go 1.16 2021-04-15 12:15:03 -04:00
Jeff Mitchell ba693bbafc Bump shared-secure-libs 2021-04-14 14:54:06 -04:00
Jeff Mitchell a71725f9c5 Bump go-mod-upgrade 2021-04-14 14:13:26 -04:00
Jeff Mitchell e002209a5c Remove replace directive 2021-04-13 21:10:58 -04:00
Jim Lambert 5df064d7b4 new api tag added as dep 2021-04-13 19:59:02 -04:00
dd0f34bc35 Add new OIDC auth method. (#1090)
Co-authored-by: Todd Knight <T.Alan.Knight@gmail.com>
Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2021-04-08 20:54:32 -04:00
Jeff Mitchell 06206de387 Remove go-swagger from the set of tools
This indirectly removes a dependency on broken mongodb-driver 1.4.5; see https://jira.mongodb.org/browse/GODRIVER-1851
2021-03-29 17:17:23 -04:00
Jeff Mitchell fcbf372881 Bump proto/grpc deps (#1017)
* Bump proto/grpc deps

* Back out buf change

* Run make gen
2021-03-20 16:12:01 -04:00
Jeff Mitchell d148dddb16 Update go-fumpt and multierror 2021-03-18 11:20:27 -04:00
Jeff Mitchell 559d304b59 Bump go-mod-upgrade 2021-03-18 11:11:07 -04:00
Jeff Mitchell 1047e7dab3 Update main's api/sdk 2021-03-09 13:53:27 -05:00
Jeff Mitchell 9fbb552031 Update shared-secure-libs to support tls_max_version 2021-03-09 08:33:35 -05:00
Jeff Mitchell 72aa110f72 CLI JSON updates (#962)
See Changelog for details.
2021-02-25 12:43:17 -05:00
Jeff Mitchell b967ff7f05 Pull in new API tag 2021-02-25 12:41:56 -05:00
Todd Knight 909026ed3d API filter tests (#958)
* API filter tests.  Requires that PR https://github.com/hashicorp/boundary/pull/957 is merged and tagged first.

* Updating /api dependency.
2021-02-22 14:37:14 -07:00
Jeff Mitchell 2ed1643e3a Dep updates (pgx, dktest) (#956)
* Dep updates:

* pgx
* dktest

* Remove pgx
2021-02-22 13:36:07 -05:00
Jeff Mitchell 09e57a6624 Dep update: (#955)
* grpc-gateway and friends
* buf
* go-swagger
* protoc-gen-go-grpc/genproto
2021-02-22 12:46:00 -05:00
Todd Knight 97b404032b Add ability to filter List*Requests (#952) 2021-02-22 10:09:25 -07:00
Jeff Mitchell d7afd08148 Update API dep 2021-02-12 11:47:16 -05:00
Jeff Mitchell 377d837df3 Update gen 2021-02-12 11:44:46 -05:00