I presented this talk at HashiConf Global in 2021 and always intended to write it as a blog, finally getting around to it.
In this blog post, we will discuss how HashiCorp Vault and HashiCorp Waypoint can be used together to manage secrets during application deployment. In addition to secret management, Vault provides excellent auditability, which can help with tracking down who used what secret and meeting compliance requirements.
Understanding Secrets and Ephemeral Credentials
A secret is a piece of sensitive information, such as API keys, passwords, or certificates, that should be kept confidential and secure. An ephemeral credential is a temporary and time-limited secret, such as a service account token, that is automatically revoked after its time-to-live (TTL) expires.
Vault’s Dynamic Secrets Engine generates ephemeral credentials, providing temporary access to resources like databases and cloud providers. It allows users to create and manage short-lived, automatically revoked secrets on demand.
HashiCorp Vault and Waypoint Overview
HashiCorp Vault is a secrets management tool that helps secure, store, and manage sensitive data. It enables fine-grained access control and robust audit logging to ensure that secrets remain secure.
HashiCorp Waypoint is a platform for building, deploying, and releasing applications. It allows developers to define deployment workflows, automate processes, and integrate with other tools like Vault.
Waypoint’s Vault plugin allows it to communicate with Vault, enabling dynamic secret generation and management during application deployment. The plugin also provides additional features such as audit logging, making it easier to meet compliance requirements.
Vault’s Dynamic Secrets Engine
With Vault’s Dynamic Secrets Engine for Google Cloud Platform (GCP), Vault can create a service account, assign the correct IAM roles, set a TTL, and then revoke the service account when it expires. Users with appropriate Vault roles and policies can retrieve these credentials.
Workflow Example: Vault and Waypoint Integration
When an application is deployed, Waypoint communicates with Vault to generate a credential on-demand, use it for the app, and then manage it throughout the lifecycle. This includes revoking access to all secrets in the event of a breach.
The integration of Vault and Waypoint demonstrates an excellent example of secrets management at deployment time because:
- It is fully automated, with no manual credential generation.
- Developers never directly handle the secrets or credentials.
- Waypoint acts as a broker, making the secret available only to the app through a Waypoint environment.
Enabling the Vault Plugin on Waypoint
To enable the Vault plugin on Waypoint, use the following command:
Waypoint App Configuration with Vault Integration
Here is an example of a Waypoint app configuration that highlights the Vault integration:
This example demonstrates how Waypoint and Vault integration enhances secrets management during the deployment process. It’s a great way to improve security, ensure compliance, and automate credential management.
Thank you for reading this blog post. If you would like to see the original talk given at HashiConf 2021, check it out here:
At the time of the presentation, there was a bug with the Vault dynamic secrets engine and Waypoint integration, but it has since been resolved. This integration is an excellent example of secrets management at deployment time, and we hope you find it useful in your projects.
Originally published at https://marc-leblanc.io on May 7, 2023.