Venafi Secrets Engine for HashiCorp Vault
The Venafi Machine Identity Secrets Engine provides applications with the ability to dynamically generate SSL/TLS certificates that serve as machine identities. Using Venafi Trust Protection Platform or Venafi Cloud assures compliance with enterprise policy and consistency with industry standard trust protection. Designed for high performance with the same interface as the built-in PKI secrets engine, services can get certificates without manually generating a private key and CSR, submitting to a certificate authority, and waiting for a verification and signing process to complete. Venafi's certificate authority integrations and policy controls, combined with Vault's built-in authentication and authorization mechanisms, provide the verification functionality.
Like the built-in PKI secrets engine, short-lived certificates for ephemeral workloads are the primary focus of the Venafi secrets engine. As such, revocation is not currently supported.
The Venafi secrets engine makes use of HashiCorp Vault's plugin system and Venafi's VCert Client SDK. If you have questions about the Venafi secrets engine, have an issue to report, or have developed improvements that you want to contribute, visit the GitHub repository.
Considerations
To successfully deploy this secrets engine, there are some important considerations. Before using Venafi secrets engine, you should read every consideration.
Venafi Trust Protection Platform Requirements
Your certificate authority (CA) must be able to issue a certificate in under one minute. Microsoft Active Directory Certificate Services (ADCS) is a popular choice. Other CA choices may have slightly different requirements.
Within Trust Protection Platform, configure these settings. For more information see the Venafi Administration Guide.
A user account that has an authentication token for the "Venafi Secrets Engine for HashiCorp Vault" (ID "hashicorp-vault-by-venafi") API Application as of 20.1 (or scope "certificate:manage" for 19.2 through 19.4) or has been granted WebSDK Access (deprecated)
A Policy folder where the user has the following permissions: View, Read, Write, Create.
Enterprise compliant policies applied to the folder including:
- Subject DN values for Organizational Unit (OU), Organization (O), City/Locality (L), State/Province (ST) and Country (C).
- CA Template that Trust Protection Platform will use to enroll general certificate requests.
- Management Type not locked or locked to 'Enrollment'.
- Certificate Signing Request (CSR) Generation unlocked or not locked to 'Service Generated CSR'.
- Generate Key/CSR on Application not locked or locked to 'No'.
- (Recommended) Disable Automatic Renewal set to 'Yes'.
- (Recommended) Key Bit Strength set to 2048 or higher.
- (Recommended) Domain Whitelisting policy appropriately assigned.
NOTE: If you are using Microsoft ACDS, the CRL distribution point and Authority Information Access (AIA) URIs must start with an HTTP URI (non-default configuration). If an LDAP URI appears first in the X509v3 extensions, some applications will fail, such as NGINX ingress controllers. These applications aren't able to retrieve CRL and OCSP information.
Trust between Vault and Trust Protection Platform
The Trust Protection Platform REST API (WebSDK) must be secured with a certificate. Generally, the certificate is issued by a CA that is not publicly trusted so establishing trust is a critical part of your setup.
Two methods can be used to establish trust. Both require the trust anchor
(root CA certificate) of the WebSDK certificate. If you have administrative
access, you can import the root certificate into the trust store for your
operating system. If you don't have administrative access, or prefer not to
make changes to your system configuration, save the root certificate to a file
in PEM format (e.g. /opt/venafi/bundle.pem) and reference it using the
trust_bundle_file
parameter whenever you create or update a PKI role in your
Vault.
Venafi Cloud Requirements
If you are using Venafi Cloud, be sure to set up an issuing template, project, and any other dependencies that appear in the Venafi Cloud documentation.
- Set up an issuing template to link Venafi Cloud to your CA. To learn more, search for "Issuing Templates" in the Venafi Cloud Help system.
- Create a project and zone that identifies the template and other information. To learn more, search for "Projects" in the Venafi Cloud Help system.
Setup
Before certificates can be issued, you must complete these steps to configure the Venafi secrets engine:
Create the directory where your Vault server will look for plugins (e.g. /etc/vault/vault_plugins). The directory must not be a symbolic link. On macOS, for example, /etc is a link to /private/etc. To avoid errors, choose an alternative directory such as /private/etc/vault/vault_plugins.
Download the latest
vault-pki-backend-venafi
release package for your operating system. Unzip the binary to the plugin directory. Note that the URL for the zip file, referenced below, changes as new versions of the plugin are released.Update the Vault server configuration to specify the plugin directory:
Start your Vault using the server command.
Get the SHA-256 checksum of the
venafi-pki-backend
plugin binary:Register the
venafi-pki-backend
plugin in the Vault system catalog:Enable the Venafi secrets engine:
Configure a Venafi secret that maps a name in Vault to connection and authentication settings for enrolling certificate using Venafi. The zone is a policy folder for Trust Protection Platform or a DevOps project zone for Venafi Cloud.
Obtain the
access_token
andrefresh_token
for Trust Protection Platform using the VCert CLI (getcred
action with--client-id "hashicorp-vault-by-venafi"
and--scope "certificate:manage"
) or the Platform's Authorize REST API method.To see all options available for venafi secrets, use
vault path-help venafi-pki/venafi/:name
after creating the secret.Trust Protection Platform:
Venafi Cloud:
Lastly, configure a role that maps a name in Vault to a Venafi secret for enrollment. To see all options available for roles, including
ttl
,max_ttl
andissuer_hint
(for validity), usevault path-help venafi-pki/roles/:name
after creating the role.Trust Protection Platform:
Venafi Cloud:
Usage
After the Venafi secrets engine is configured and a user/machine has a Vault
token with the proper permission, it can enroll certificates using Venafi.
To see all of the options available when requesting a certificate, including
ttl
(for validity), key_password
, and custom_fields
, use
vault path-help venafi-pki/issue/:role-name
and
vault path-help venafi-pki/sign/:role-name
.
Generate a certificate by writing to the
/issue
endpoint with the name of the role:Trust Protection Platform:
Venafi Cloud:
Or sign a CSR from a file by writing to the
/sign
endpoint with the name of the role:Trust Protection Platform:
Venafi Cloud:
API
Venafi Machine Identity Secrets Engine uses the same Vault API as the built-in PKI secrets engine. Some methods, such as those for managing certificate authorities, do not apply.