Overview
HashiCorp Vault is a security platform that addresses the complexity of managing secrets across distributed infrastructure. The current state at many organizations is referred to as “secret sprawl,” where secret material is stored in a combination of point solutions, Confluence, files, post-it notes, etc. Vault is a solution for eliminating the sprawl, while providing a common API and flexible authentication methods for cloud-native and legacy applications. Some common use cases for Vault are storage of existing database credentials, app credentials, ssh keys, cloud access keys, etc. Vault also supports dynamic creation of secrets on demand for cloud platforms and databases and can act as a Certificate Authority (CA), providing dynamic short-lived PKI certificates.
In the same way that Vault has become a standard in the world of secrets management, Venafi has become a standard platform for providing centralized policy control, visibility and automation for the lifecycle of machine identities including public and private SSL/TLS certificates.
Together Venafi and HashiCorp make it easy for DevOps teams to go fast and for Security teams to get the visibility, intelligence, and policy enforcement they require to protect the business.
This blog is the first part of a series that explores the integration methods currently available between Vault and Venafi as a Service (now called TLS Protect Cloud).
As businesses operate in multi-cloud or hybrid models, they require a set of standard, common services to achieve consistency, agility, and speed. Venafi and HashiCorp together, aim to provide a consistent platform that enables teams to move fast and safely, while providing agility and flexibility over where applications run.
The Solution
The integration options for Vault and Venafi appear in the form of Vault plugins: Venafi Secrets Engine (vault-pki-backend-venafi) and Venafi Monitor Engine (vault-pki-monitor-venafi). Vault integrates with the Venafi Platform (see blog 1 and blog 2) and Venafi.
The Venafi Platform is well suited for organizations that need enterprise scalability, workflow and integration options both on-premise and in the cloud.
Venafi’s SaaS offering allows DevOps teams to quickly obtain policy compliant certificates from your organization’s approved CA without requiring you to install or manage software.
This post explores using the vault-pki-backend-venafi with Venafi, which serves the targeted use case of connecting trusted third-party certificate authorities to Vault, enabling developers to use native Vault commands to request certificates from leading CAs such as GlobalSign and DigiCert.
Additional details about the workflows between Vault and Venafi can be found in this whitepaper.
Let’s get started!
Working with the vault-pki-backend-venafi plugin
Prerequisites
- Venafi account with admin access
- HashiCorp Vault
This guide will offer a script for running Vault locally for testing. Optionally, an existing Vault development environment may be used. When deploying to production, it is recommended to follow HashiCorp’s Vault Deployment Guide and Vault Production Hardening Guide.
![Zero Trust with cert-manager, Istio and Kubernetes](/_next/image/?url=https%3A%2F%2Fcdn.venafi.com%2F994513b8-133f-0003-9fb3-9cbe4b61ffeb%2F4b70cc07-9fe0-4917-92db-b2533bd9ea0e%2FThumb_ZeroTrustwcert-mgrIstioandKubernetes.jpg%3Fw%3D650%26h%3D400%26fm%3Dwebp%26q%3D50%26fit%3Dcrop&w=1920&q=75&dpl=dpl_9nMnPWFgUR3MNGqVKD9tfneGCtKt)
Zero Trust with cert-manager, Istio and Kubernetes
Venafi Configuration
This section will describe tasks to configure in Venafi. First, a CA account must be added to Venafi. A CA account is a connection to a Certificate Authority API. Second, an issuing template must be created. An issuing template allows you to select a CA account and apply rules that enforce certificate attributes. Third, a project must be created in Venafi. A project is an area in Venafi that will enable Vault to request certificates. Each project contains a zone. Lastly, you can retrieve the credentials and configuration that will be used by the Venafi Vault Secrets Engine from the Zone view.
Step 1: Configure CA account
Login to Venafi as an administrator. On the left-hand side navigate to Configuration -> CA Accounts. Any existing CA account will be displayed here. Select Add New Account, provide a name, then select a CA and provide a credentials file. Next, click Authenticate. If successful, the authorized domains and policy will be retrieved from the public CA. Click Add Account and the newly added CA account will appear in the UI.
Note that in this example GlobalSign will be used to demonstrate retrieval of publicly trusted certificates. Venafi also supports DigiCert for public certificate retrieval as well as a Venafi-provided CA for internal certificates.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/a6d98d79-d2fa-48b3-a1a4-8d39719ac415/aid_inline_img__2dbcbaa8b88a7d6260ef6237cb6f6d18.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/bec38569-b406-4373-8cda-fb73fe58850b/aid_inline_img__bf7db441073dcbd4984459e99e39c9da.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/dcda3cfb-3395-4a4a-b5a4-ed34ab0e82e9/aid_inline_img__85244f952e858ca540c3a7fe5e71ac2b.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/66af7003-b7ee-47b2-b3de-4bcf33c211b3/aid_inline_img__17d9b121d7a9698e76b483f40032fe82.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/76c92b58-bf8f-4588-bacf-e2bfeb36db60/aid_inline_img__09e714994028b6f8be5740da48f4024e.png?fm=webp&q=85)
Step 2: Create an Issuing Template
On the left-hand side navigate to Configuration -> Issuing Templates. Any existing template will be displayed here. Select Create New Template, provide a template name, then select a CA account. In this example GlobalSign will be used to demonstrate retrieval of publicly trusted certificates. After selecting GlobalSign, the issuing rules will be filled based on the policy retrieved from the public CA in the previous step. Click Save.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/dd49397e-9a71-4eb4-b628-ad5e6c83224b/aid_inline_img__bb72d4bcac64a5d63f90a2d9bf8ed744.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/b5d3e827-9253-4e22-9e32-840b13eb5d08/aid_inline_img__2729b7c13c48e621b76f9add2bc47db9.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/38b22cb8-846a-4e9f-a4de-031d6bb22867/aid_inline_img__0a5efe66e77503c92130f6bd9b3b1a08.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/2cb0b3f0-7ff5-4afb-b13d-5078ecde64f0/aid_inline_img__7a0df23861e142b508235d43822962e3.png?fm=webp&q=85)
Step 3: Create a New Project
On the left-hand side navigate to Projects. Any existing projects will be displayed here. Select Create A New Project on the right-hand side of the screen. Give the project a name and description, and then click Create A New Zone. Give the zone a name, assign the Certificate Issuing Template which you created in the last step, and then click Save. In the DevOps User field, add any user accounts which should have access to this zone and click Save. This blog post leverages a single user account for administration as well as for the end user workflow. Note that as a best practice you should use a lower privileged user account with the ‘DevOps User’ role assigned to link with Vault so proper separation of duties is maintained.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/d68e1110-0bcd-436d-a721-351ae4d9a157/aid_inline_img__579a4a6d9af4a7fd4a8bb08c7c2f2fc0.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/751331bd-f20e-4b7b-b299-17b55e799498/aid_inline_img__4860a9e928434e394e2fff6a2d22e659.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/3cec968d-3555-4886-b396-2ca2177f051b/aid_inline_img__fcac9a8a3d586eaf4e42c0c7e190c98a.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/219048fb-ff20-4707-82e4-b23b7f43e09c/aid_inline_img__0c0a8055cdca86fc7006a1e777d56905.png?fm=webp&q=85)
Step 4: Retrieve Venafi Credentials
From the Projects menu, select the project which was just created by clicking on the project name. The project provides authentication instructions for common platform like K8s, Terraform and Vault. Select the Venafi Secrets Engine to retrieve the configuration and credentials for Vault. Make a note of the api key and zone as they will be needed when configuring Vault below. Note that the credentials have been removed from this screenshot.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/10c30220-f701-4d9e-a03b-ff22daec63a7/aid_inline_img__6a74a36577245a32e58522b11fc157fa.png?fm=webp&q=85)
Vault Configuration
Step 1
Download, unzip and install the Vault plugin, vault-pki-backend-venafi, for the desired operating system here along with its checksum.
Step 2
Prepare and start Vault on a suitable system. This step can be skipped if Vault is already running.
Step 3
Initialize, unseal and login to Vault. This example uses Shamir’s Secret Sharing for unsealing. If you choose to run the script, the root token and unseal keys will be sent to the screen as well as saved in init.out. In production, it is common to use one of the auto-unseal methods as discussed here. This step can be skipped if Vault is already running.
3_init_vault.sh
Step 4
Install the vault-pki-backend-venafi plugin
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/514ebf8a-a5f0-46fa-baea-1dda256d001c/aid_inline_img__91ced6cf1296ffc4d76d66a537e63a43.png?fm=webp&q=85)
Step 5
Enable the plugin and configure a role.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/0b2805e8-7d61-4b63-9c72-05d81bdb0506/aid_inline_img__2567aede149f241aa82cc0cdb2b532f1.png?fm=webp&q=85)
Set the following environment variables with your Venafi credentials, zone and list of allowed domains prior to running the script.
export API_KEY=“<enter api key here>”
export VC_ZONE=“<enter zone name here>”
export ALLOWED_DOMAINS=“<enter allowed domains here>”
If you choose to execute the commands interactively rather than running the script, Venafi provides a configuration snippet that you can copy/paste directly into your terminal. See step 4 above for more details.
The Vault read command can be used to verify the configuration.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/e015c954-95e2-4e2a-8bf2-dd85451095e3/aid_inline_img__717ccbbe8196e9365f823f607f4b8736.png?fm=webp&q=85)
Step 6
Test Plugin: request certificate
The Vault configuration is now complete, and certificates from third-party CAs may be requested from Venafi via Vault. When a valid certificate request is honored, Venafi sends an email notification to the requestor and Vault outputs the certificate, chain and private key. In the example below test.thehotelcook.com is allowed by policy and is visible in Venafi after the request is completed, which is done by navigating to Projects -> *your project name* -> View certificate requests. Certificates that were successfully generated as permitted by policy will be highlighted in green, while requests which failed due to policy enforced by the CA will be highlighted in red. In order to view the details of the certificates that were generated, navigate to Projects -> *your project name* -> View issued certificates.
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/707f8955-c0bd-47c9-bdcb-918619affd81/aid_inline_img__07f16f5ecbaff84f4535ac45bc0d09d2.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/99e8ca9d-af61-417c-88ed-7db0a3d1fd7f/aid_inline_img__5a8f6e7cbb340663bf495e0914406594.png?fm=webp&q=85)
![](https://cdn.venafi.com/994513b8-133f-0003-9fb3-9cbe4b61ffeb/ea7c768f-db6a-4a55-a4c1-7910a533b072/aid_inline_img__d75f05be004bca408e5757bebdf3f198.png?fm=webp&q=85)
Conclusion
This blog post has shown how the vault-pki-backend-venafi plugin allows organizations to use Vault and Venafi together so that SSL/TLS certificate requests can be sent to Vault but fulfilled directly by Venafi on behalf of third-party certificate authorities or its built-in CA. This alleviates the need for manual approval workflows thus allowing organizations to move faster while remaining compliant.
Find out how HashiCorp and Venafi integrate security with speed in the HashiCorp DevOps Lifecycle. HashiCorp CTA Armon Dadgar explains.
![Machine Identity Management Architecture](/_next/image/?url=https%3A%2F%2Fcdn.venafi.com%2F994513b8-133f-0003-9fb3-9cbe4b61ffeb%2F66c43656-eb21-47af-b271-dafaf3accee2%2Faid_field_img__c77310a4c7cf179c961b00f419139304.png%3Fw%3D650%26h%3D400%26fm%3Dwebp%26q%3D50%26fit%3Dcrop&w=1920&q=75&dpl=dpl_9nMnPWFgUR3MNGqVKD9tfneGCtKt)
Machine Identity Management Architecture
![Summit 2024 Teaser Photo](/_next/image/?url=https%3A%2F%2Fcdn.venafi.com%2F994513b8-133f-0003-9fb3-9cbe4b61ffeb%2F537b500f-ee2a-44ba-82b4-d7be0b23506c%2Fsummit-promo-graphic-2.jpg&w=3840&q=75&dpl=dpl_9nMnPWFgUR3MNGqVKD9tfneGCtKt)
Machine Identity Security Summit 2024
Help us forge a new era of cybersecurity
☕ We're spilling all the machine identiTEA Oct. 1-3, but these insights are too valuable to just toss in the harbor! Browse the agenda and register now.