vHSM Agent quickstart
Learn to start vHSM Agent and to load data to vHSM server
Last updated
vhsm kv put secret/customers/enclaive @data.jsonpid_file = "./pidfile"
vault {
address = "$VAULT_ADDR"
tls_skip_verify = true
}
auto_auth {
method {
type = "token_file"
config = {
token_file_path = "$HOME/.vault-token"
}
}
sink "file" {
config = {
path = "$HOME/vault-token-via-agent"
}
}
}vhsm agent -config=agent-config.json==> vHSM Agent started! Log data will stream in below:
==> vHSM Agent configuration:
Api Address 1: http://bufconn
Cgo: disabled
Log Level:
Version: Vhsm v1.3.2-0 heads/main-0-g1b8bb7c 2024-10-10T01:15:29+00:00
2025-03-08T17:00:28.700Z [INFO] agent.sink.file: creating file sink
2025-03-08T17:00:28.700Z [INFO] agent.sink.file: file sink configured: path=/tmp/secrets/vault-token mode=-rw-r-----
2025-03-08T17:00:28.701Z [INFO] agent.exec.server: starting exec server
2025-03-08T17:00:28.701Z [INFO] agent.exec.server: no env templates or exec config, exiting
2025-03-08T17:00:28.701Z [INFO] agent.auth.handler: starting auth handler
2025-03-08T17:00:28.701Z [INFO] agent.auth.handler: authenticating
2025-03-08T17:00:28.701Z [INFO] agent.sink.server: starting sink server
2025-03-08T17:00:28.701Z [INFO] agent.template.server: starting template server{
{{ with secret "secret/data/customers/acme" }}
"Organization": "{{ .Data.data.organization }}",
"ID": "{{ .Data.data.customer_id }}",
"Contact": "{{ .Data.data.contact_email }}"
{{ end }}
}template {
source = "$HOME/vhsm-test/customer.json.tmpl"
destination = "$HOME/vhsm-test/customer.json"
}vhsm agent -config=agent-config.json -config=agent-template.jsoncat customer.json{
"Organization": "Enclaive",
"ID": "ABXX2398YZPIE7391",
"Contact": "alice@enclaive.com"
}vhsm agent -config=agent-config.json \
-log-file=$HOME/vhsm-test/vhsm-agent.logls | grep .log
cat vhsm-agent-<timestamp>.log