Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vault ssh certificate credential library #2860

Merged
merged 11 commits into from
Feb 2, 2023
Merged

Conversation

tmessi
Copy link
Member

@tmessi tmessi commented Jan 30, 2023

This adds a new credential library type, vault-ssh-certificate, which
can be used with vault's ssh secret engine to generate certificates to
use as credentials for ssh. This new credential library can be created
using:

boundary credential-libraries create vault-ssh-certificate

See the help output for a full list of the options supported.

This also renames the vault credential library subtype to
vault-generic. The previous subtype of vault will continue to work,
thus the following commands are equivalent:

boundary credential-libraries create vault-generic
boundary credential-libraries create vault

See: https://developer.hashicorp.com/vault/docs/secrets/ssh

@tmessi tmessi requested a review from a team January 30, 2023 22:29
@tmessi tmessi requested a review from a team as a code owner January 30, 2023 22:29
@tmessi tmessi requested review from shore and emilymianeil and removed request for a team January 30, 2023 22:29
@tmessi tmessi force-pushed the llb-vault-ssh-cert-injection branch from 15c5fb5 to 8c6e0f1 Compare February 2, 2023 14:38
@tmessi tmessi added this to the 0.12.x milestone Feb 2, 2023
@tmessi tmessi force-pushed the llb-vault-ssh-cert-injection branch 2 times, most recently from accda14 to a88bcc2 Compare February 2, 2023 17:02
kheina and others added 11 commits February 2, 2023 17:43
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.
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>
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
This expands the wh_credential_dimension to include fields for the new
vault ssh certificate credential library.
This allows the new vault ssh certificate credential library to be used
as an injected application credential source.
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
@tmessi tmessi force-pushed the llb-vault-ssh-cert-injection branch from a88bcc2 to 8624819 Compare February 2, 2023 17:43
@tmessi tmessi merged commit db42eaf into main Feb 2, 2023
@tmessi tmessi deleted the llb-vault-ssh-cert-injection branch February 2, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants