Commit Graph
1647 Commits
Author SHA1 Message Date
Timothy Messier 718e183a1e fix(credentiallibraries): Correctly populate attrs for vault-generic (#2901) 2023-02-03 14:21:08 -05:00
Timothy Messier f9a2f44f5b test(cli): Add tests for vault-ssh-certificate credential library
This adds tests for updating specific fields of the credential library.
2023-02-03 17:00:34 +00:00
Timothy Messier e66ea15fef fix(cli): Status code on api error
When using the json output of the cli (`-format=json`), a successful
call to the controller API would place the HTTP status code in the JSON
as `status_code`. However, if there was an error from the API the status
code would be placed in the JSON as `status`. In order to be consistent,
this adds a `status_code` field to the error response case. For
backwards compatibility it still populates `status` in the error case.

This inconsistency was missed partially due to a bug in the CLI tests.
The assertion on status code was not valid and would always be
successful. Thus this also fixes the assertions and tests.
2023-02-03 17:00:34 +00:00
Irena Rindos 4114b41527 Filter managed workers from egress workers when the host address is unsafe (#2899) 2023-02-03 11:40:41 -05:00
Hugo e455e31f9e fix(target): Incorrectly allowing whitespace on Target's address field (#2862) 2023-02-02 10:51:39 -08:00
Timothy Messier 32dd7f07d0 fix(vault): Only persist revokable credentials
When issuing credentials from vault credential libraries, only persist
the vault credential if it is revokable. A credential that is revokable
has a valid lease id that can be used to revoke the lease in vault. If
the credential is not revokable it is also not renewable since renewing
also requires a lease id.

See: https://developer.hashicorp.com/vault/docs/concepts/lease
2023-02-02 17:43:17 +00:00
Timothy Messier 12a53bbfa9 feat(target): Allow vault ssh cert library as credential source
This allows the new vault ssh certificate credential library to be used
as an injected application credential source.
2023-02-02 17:43:17 +00:00
Timothy Messier 1aaaf4af1d feat(controller): Translate ssh certificate credentials for worker 2023-02-02 17:43:17 +00:00
Timothy Messier 6a41bf1237 feat(wh): Support vault ssh certificate credentials
This expands the wh_credential_dimension to include fields for the new
vault ssh certificate credential library.
2023-02-02 17:43:17 +00:00
Timothy Messier 89a55632ba feat(cli): Add vault ssh certificate credential library 2023-02-02 17:43:17 +00:00
Haotian 43f0ba89cf feat(credentiallibraries): support vault ssh certificates 2023-02-02 17:43:16 +00:00
Danielle 3a78a74571 feat(vault): Support Issuing SSH Cert Credentials
Allows the new credential library type to be pulled from the db and used
for issuing ssh certificate type credentials. The ssh cert library
interfaces with vault's ssh secrets engine to either issu certificates
directly from vault, or to generate them within boundary and have vault
sign them as a certificate authority for authentication.

See:
  https://developer.hashicorp.com/vault/api-docs/secret/ssh#sign-ssh-key
  https://developer.hashicorp.com/vault/api-docs/secret/ssh#generate-certificate-and-key
2023-02-02 17:43:16 +00:00
HaotianandTimothy Messier 823b8cdfc6 feat(vault): Add CRUDL methods for ssh certificate cred library (#2765)
This defines a new credential library type for ssh certificates.
It adds new repository methods to support CRUDL of the new ssh
certificate credential library.

Co-authored-by: Timothy Messier <tim.messier@gmail.com>
2023-02-02 17:43:16 +00:00
Danielle 7833dd73c0 refact(vault): Create issuingCredentialLibrary Interface
Allows for new issuing credential library implementations in the future.
Moved db and decrypt logic to privateCredentialLibraryAllTypes from
issueCredentialLibrary.

This also removes sessionId from retrieveCredential, it was not needed
and removing allows retrieveCredential to be reused for credentials
issued outside current workflow.
2023-02-02 17:43:16 +00:00
Cameron Perera f4951c385f chore: bump ui commit to include vault ssh cert feature (#2883) 2023-02-01 14:42:15 -06:00
Todd d8aea569c5 Only return live workers in ListHcpbWorkersResponse (#2876) 2023-02-01 10:24:56 -08:00
Irena Rindos a030c15403 Support HCPBInt in hcpb_cluster_id field (#2880)
* initial commit
2023-02-01 13:20:07 -05:00
Johan Brandhorst-Satzkorn 55259029f1 Add job run cleaner (#2866)
* chore: remove duplicate import

* feat: Add job run cleaner

The new job cleans job runs older than a configured interval.
Configure the job to clean jobs older than 1 minute.
2023-01-31 20:41:33 -05:00
Cameron Perera bc332541c3 chore: bump ui commit for host set link fixes (#2875) 2023-01-31 18:33:01 -06:00
Cameron Perera e64b8eaef1 chore: update UI commit to include onboarding updates (#2870) 2023-01-31 16:46:57 -06:00
Irena Rindos ed9f2b2730 bug(workers): Check initial upstreams for an HCBP environment (#2869) 2023-01-31 15:53:11 -05:00
Jeff MalnickandJeff Mitchell a3c4cef648 Use primary auth method if no auth method ID is provided (#2725)
* feat: default to using primary auth method with authenticating

* Add ability to specify scope ID flag in authenticate method

---------

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2023-01-31 10:07:10 -08:00
Irena Rindos 2e3fd041ef Target worker filters migration fix (#2859) 2023-01-31 08:38:32 -05:00
Jeff MitchellandJohan Brandhorst-Satzkorn 19180af0eb Fix target port handling (#2846)
* Fix target port handling

This fixes two issues that compounded on each other (see the Changelog
update for more information):

* The verification logic for hosts was not correct for update operations
(in multiple ways) which meant that a host could be updated after
creation to have a port. Targets had a previously fixed bug where they
did not require a default port, which meant that ports could be used
from hosts
* A recent (unreleased) change had prioritized any port coming from the
host over the default port, which would mean there was no way if a
host had a port specified to use it in multiple targets.

This fixes the update verification logic, and strikes a middle ground
between breaking things and not by allowing existing addresses with
ports to be used with targets but ignoring that port, instead requiring
targets to have default port set at authorize time (currently there is
backwards compat that does not require this due to the original optional
port bug).

* Update CHANGELOG.md

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-01-26 13:35:29 -05:00
Cameron Perera 9f49d1a7f8 bump ui commit (#2841) 2023-01-24 13:53:44 -06:00
Irena Rindos 00a73f64d9 bug(sessions): Fix authorizeSession race conditions in handleProxy (#2795)
* initial commit
2023-01-24 09:24:03 -05:00
Todd d66b92abe0 Add directly connected downstream workers to the worker resource api (#2831) 2023-01-23 11:45:09 -08:00
Todd 87b09d5e27 Rename router to receiver for secondary connections (#2816) 2023-01-20 10:43:57 -08:00
Todd b359561e51 Filter WorkerList by feature and go from version string to version.Info (#2807) 2023-01-19 14:39:49 -08:00
Hugo 0bee55aa19 fix(target): Correct accounting of updated rows when deleting address (#2799)
If an update call was made to a target that removed an address, for a
target that already did not have an address, the incorrect number of
rows updated was being reported. During the update the target's version
was correctly being updated, resulting in one row being updated.
However then the delete call would result in zero rows being deleted,
since there was no address associated with the target, and this would
replace the value for the returned rowsUpdated. This resulted in the
target service thinking that no update happened, and it would report an
error.
2023-01-19 16:12:04 -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
Cameron Perera 4195821d29 bump ui commit to latest on main (#2798) 2023-01-18 13:06:48 -06:00
Todd bc409bc7d4 Graceful shutdown blocks on running proxy handler connections (#2789) 2023-01-17 08:54:01 -08:00
Irena Rindos e238893c21 Unset worker auth when Boundary dev uses a kms worker (#2786) 2023-01-13 12:03:05 -05:00
Timothy Messier e2248c1360 fix(wh): Associate session fact with credential dimensions (#2787)
The wh_upsert_credential_group function was incorrectly attempting to
update the session connection fact table. There are a couple problems
with this:

1. At the time that this runs, there would be no session connection facts
   for this session.
2. This function is meant to update the session fact table, there is a
   separate function that associates the credential group with the
   session connection facts.

This also fixes another bug that was causing expired rows of the
credential dimension to be included in the group membership. And finally
it fixes a typo in the function name.
2023-01-13 11:24:32 -05:00
Todd 38b74ce897 Provide a worker decryption function to proxy handlers (#2784) 2023-01-12 13:16:36 -08:00
Todd 0b87acb896 Always call PostConnectionHook in dialer and fix Dial bug (#2783) 2023-01-12 11:04:16 -08:00
Irena Rindos bb281e494f Fix status NPE if worker has been sitting waiting for registration (#2781) 2023-01-12 12:02:08 -05:00
Irena Rindos 5d5dc7524c update dial function doc to include options (#2776) 2023-01-11 13:26:37 -05:00
Irena Rindos af24972386 warn if controller and worker name are the same (#2773) 2023-01-11 09:07:31 -05:00
Irena Rindos d3d1fa0b55 initial commit (#2768) 2023-01-10 08:10:54 -05:00
Damian Debkowski a8ee18e177 fix(db): target address relabel migration id (#2769) 2023-01-09 14:00:28 -08:00
Irena Rindos beb97ac9f2 SSH Proxy support (#2736)
* initial commit
2023-01-09 13:43:02 -05:00
Hugo 1fb960575f Merge pull request #2613 from hashicorp/llb-target-address
Assign a Network Address to a Target
2023-01-09 18:35:19 +00:00
Irena Rindos a403b3904c initial commit (#2735) 2023-01-09 12:35:13 -05:00
Hugo Vieira f85da3ee2b feat(cmd): Create target using address on boundary dev / database init
Creates a target using an address for boundary dev and when first
init-ing boundary (boundary database init).

It also makes this newly created target the default one
(ttcp_1234567890). The target using host sources is now a secondary
target (ttcp_0987654321).
2023-01-09 15:39:55 +00:00
Damian Debkowski 1d3930a711 feat(handlers): Support address field on a Target 2023-01-09 15:39:55 +00:00
Damian Debkowski bca7c371d8 feat(session): Support connecting to an address associated to a Target 2023-01-09 15:39:55 +00:00
Damian Debkowski 760671f223 feat(target): Support connecting to an address associated to a Target 2023-01-09 15:39:55 +00:00
Damian Debkowski 0dbe18e453 fix(db): remove migration test 59_01
This test uses the target domain repository code to test the ingress
& egress worker filter. With our changes we have updated the target
domain repository logic to fetch the target address. When this migration
test is invoked, the target_address table does not exist and the domain
code will always return an error making this test invalid.
2023-01-09 15:39:55 +00:00