vHSM Agent quickstart
Learn to start vHSM Agent and to load data to vHSM server
vHSM Agent acts as a client-side daemon that handles authentication and communication with vHSM on behalf of client applications. It simplifies authentication by obtaining and managing client tokens, eliminating the need for applications or users to manually renew or re-authenticate as tokens expire.
Additionally, vHSM Agent supports Consul Template markup, allowing it to render secrets into files. This enables client applications to seamlessly access and load the required data.
By the end of this tutorial, you'll learn how to seamlessly manage secrets using vHSM without modifying your client application’s code. The client application loads data from the customer.json
file, while vHSM Agent's Template feature dynamically injects secrets into the file. This approach ensures secure and automated secret management without requiring direct integration with vHSM.
Prerequisites
1. Create a directory for storing test files and configuration.
2. Create a mock dataset data.json
representing a customer record, using an editor of your choice:
Upload the test data to the vHSM KV v2 secrets engine:
4. Create the agent configuration file agent-config.json
to enable automatic authentication and token management.
Note: For production, consider robust auth methods such as AppRole, Kubernetes Auth, and others.
Start the vHSM Agent:
Expected log output will confirm:
Token sink created
Auth handler started and authenticated
6. Stop the running vHSM Agent (Ctrl + C)
7. Use the template rendering feature of vHSM Agent to dynamically fetch and inject secrets into application configuration files and create a template file, customer.json.tmpl
:
Create an additional config
agent-template.json
for templates:
Restart vHSM Agent with both configs:
You should see a rendered file at $HOME/vhsm-test/customer.json
.
Verify rendered output:
Output is similar to:
11. Enable logging using the -log-file
flag:
vHSM appends a timestamp to the log file.
Check the log file:
Last updated
Was this helpful?