vHSM Proxy quickstart
Learn to start vHSM Proxy and read secrets from a specified path in the vHSM server through vHSM Proxy.
Last updated
vhsm kv put secret/customers/enclaive @data.jsonpid_file = "./pidfile"
vault {
address = "http://127.0.0.1:8200"
tls_skip_verify = true
}
auto_auth {
method {
type = "token_file"
config = {
token_file_path = "$HOME/.vault-token"
}
}
sink "file" {
config = {
path = "$HOME/vault-proxy"
}
}
}
listener "tcp" {
address = "127.0.0.1:8100"
tls_disable = true
}
api_proxy {
use_auto_auth_token = true
enforce_consistency = "always"
}
vhsm proxy -config=vault-proxy-config.json==> vHSM Proxy started! Log data will stream in below:
==> vHSM Proxy configuration:
Api Address 1: http://127.0.0.1:8100
Cgo: disabled
Log Level:
Version: Vhsm v1.3.7-0, built 2025-01-29T15:11:42Z
Version Sha: 00d245ed8143844db6761fd947433aab237f914f+CHANGES
2025-03-10T18:28:43.946+0530 [INFO] proxy.sink.file: creating file sink
2025-03-10T18:28:43.947+0530 [INFO] proxy.sink.file: file sink configured: path=/Users/rkodhandapani/vault-token-via-agent mode=-rw-r-----
2025-03-10T18:28:43.947+0530 [INFO] proxy.sink.server: starting sink server
2025-03-10T18:28:43.947+0530 [INFO] proxy.auth.handler: starting auth handler
2025-03-10T18:28:43.947+0530 [INFO] proxy.auth.handler: authenticating
2025-03-10T18:28:43.949+0530 [INFO] proxy.auth.handler: authentication successful, sending token to sinks
2025-03-10T18:28:43.949+0530 [INFO] proxy.auth.handler: not starting token renewal process, as token has unlimited TTcurl -s http://127.0.0.1:8100/v1/secret/data/customers/enclaive \
| jq -r ".data.data"{
"contact_email": "alice@enclaive.com",
"customer_id": "ABXX2398YZPIE7391",
"organization": "Enclaive",
"region": "US-West",
"status": "active",
"type": "premium",
"zip_code": "94105"
}curl --verbose -s http://127.0.0.1:8100/v1/secret/data/customers/enclaive \
| jq -r ".data.data"* Trying 127.0.0.1:8100...
* Connected to 127.0.0.1 (127.0.0.1) port 8100 (#0)
> GET /v1/secret/data/customers/enclaive HTTP/1.1
> Host: 127.0.0.1:8100
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-store
< Content-Length: 465
< Content-Type: application/json
< Date: Mon, 10 Mar 2025 15:43:34 GMT
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-Cache: MISS
<
{ [465 bytes data]
* Connection #0 to host 127.0.0.1 left intact
{
"contact_email": "alice@enclaive.com",
"customer_id": "ABXX2398YZPIE7391",
"organization": "Enclaive",
"region": "US-West",
"status": "active",
"type": "premium",
"zip_code": "94105"
}vhsm kv patch secret/customers/enclaive "customer_since"="2011"curl --verbose http://127.0.0.1:8100/v1/secret/data/customers/enclaive \
| jq -r ".data.data"* Connected to 127.0.0.1 (127.0.0.1) port 8100 (#0)
> GET /v1/secret/data/customers/enclaive HTTP/1.1
> Host: 127.0.0.1:8100
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: no-store
< Content-Length: 489
< Content-Type: application/json
< Date: Mon, 10 Mar 2025 15:52:55 GMT
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-Cache: MISS
<
{ [489 bytes data]
100 489 100 489 0 0 58612 0 --:--:-- --:--:-- --:--:-- 238k
* Connection #0 to host 127.0.0.1 left intact
{
"contact_email": "alice@enclaive.com",
"customer_id": "ABXX2398YZPIE7391",
"customer_since": "2011",
"organization": "Enclaive",
"region": "US-West",
"status": "active",
"type": "premium",
"zip_code": "94105"
}