The d8 stronghold command of Deckhouse CLI is the Stronghold client. Its subcommands and flags match the HashiCorp Vault CLI. For details, refer to HashiCorp Vault compatibility.

In a standalone installation, the same subcommands are available through the stronghold executable:

# The command format in Deckhouse Platform (DP).
d8 stronghold <COMMAND> [flags] [arguments]
# The command format in Linux.
stronghold <COMMAND> [flags] [arguments]

To get help for any subcommand, use the -help flag, for example d8 stronghold kv put -help.

Connecting to the server

Environment variables

VariablePurposeExample
STRONGHOLD_ADDRStronghold server addressexport STRONGHOLD_ADDR=https://stronghold.example.com
STRONGHOLD_TOKENToken used for requests. Overrides the token saved by loginexport STRONGHOLD_TOKEN=<TOKEN>
STRONGHOLD_CACERTPath to the CA certificate used to verify the server TLS certificateexport STRONGHOLD_CACERT=/opt/stronghold/tls/stronghold-ca.pem

The client also reads variables that set connection parameters. Before the client starts, every STRONGHOLD_* variable is copied to the matching VAULT_* variable, so all variables below can be set with either prefix. If both are set, STRONGHOLD_* takes effect.

VariablePurpose
STRONGHOLD_NAMESPACEThe namespace in which commands run (Stronghold EE)
STRONGHOLD_CAPATHA directory with CA certificates
STRONGHOLD_CLIENT_CERT, STRONGHOLD_CLIENT_KEYA client certificate and key for mutual TLS
STRONGHOLD_TLS_SERVER_NAMEThe server name used to verify the TLS certificate (SNI)
STRONGHOLD_SKIP_VERIFYDisable verification of the server TLS certificate. The client then does not detect a substituted server
STRONGHOLD_CLIENT_TIMEOUTThe client request timeout
STRONGHOLD_MAX_RETRIESThe maximum number of request retries on errors
STRONGHOLD_WRAP_TTLThe time to live for response wrapping
STRONGHOLD_MFAMFA data for the request
STRONGHOLD_FORMATThe default output format, for example json

In DP, you can get the Stronghold server address from the Ingress object:

export STRONGHOLD_ADDR=https://$(d8 k -n d8-stronghold get ing stronghold -o json | jq -r '.spec.rules[0].host')

Common flags

FlagPurpose
-address=<URL>Server address. Overrides STRONGHOLD_ADDR, for example to query a secondary cluster
-namespace=<PATH>Namespace in which the command runs (Stronghold EE)
-format=<FORMAT>Output format, for example json
-field=<FIELD>Print only the value of the specified response field (for read, write, kv get, and others)
-helpCommand help

Flags for connecting to the server:

FlagPurpose
-ca-cert=<PATH>A file with a CA certificate used to verify the server certificate. Takes precedence over -ca-path
-ca-path=<PATH>A directory with CA certificates
-tls-skip-verifyDisable verification of the server TLS certificate. The client then does not detect a substituted server
-output-curl-stringDo not run the request; print an equivalent curl command instead

Server and status

CommandPurposeDetails
server -config=<FILE>Start the Stronghold server with the specified configuration file (standalone). In DP, the stronghold module manages the serverInstallation, configuration
statusShow the server status: initialization, Sealed, seal type, HA mode, Raft indexesAccess setup
versionShow the Stronghold version and edition—
monitor -log-level=<LEVEL>Stream node logs in real timeLogs
d8 stronghold status

operator

Cluster maintenance commands. They require a privileged token or unseal keys.

CommandPurposeKey flagsDetails
operator initInitialize the storage and get the key shares and the root token. In DP, the module does this automatically-key-shares, -key-thresholdInstallation
operator unsealEnter an unseal key share. Repeat as many times as set by -key-threshold—Seal and unseal
operator sealSeal the node—Seal and unseal
operator rekeyChange the unseal or recovery keys-init, -nonce, -verifySeal and unseal
operator generate-rootGenerate a new root token using a key quorum-init, -nonce, -decode, -otpTokens
operator step-downForce the active HA node to step down—Switching from EE to CSE
operator raft list-peersShow Raft nodes and their roles—Raft quorum recovery
operator raft joinJoin a node to the Raft cluster-non-voterConfiguration
operator raft autopilot stateShow the Raft autopilot state—Monitoring
operator raft snapshot save <FILE>Save a snapshot of the Raft storage—Saving a snapshot
operator raft snapshot restore <FILE>Restore the storage from a snapshot-forceRestoring
operator raft snapshot inspect <FILE>Check the contents and consistency of a snapshot-validate, -depth, -filter, -formatInspecting a snapshot

The operator seal command seals the server, and operator rotate rotates the storage encryption key. For details, refer to Key management.

d8 stronghold operator raft snapshot save stronghold-$(date +%F_%H-%M).snap

Authentication

CommandPurposeKey flagsDetails
loginLog in to Stronghold and save the token-method, -path, -no-printAccess setup
auth enable <TYPE>Enable an auth method-pathAuth methods
auth listList enabled auth methods-formatAuth methods
auth tune <PATH>Change auth method parametersfor example, -user-lockout-disableuserpass
d8 stronghold login -method=oidc -path=oidc_deckhouse -no-print

token

CommandPurposeKey flagsDetails
token createCreate a token-policy, -period, -orphan, -no-default-policy, -namespaceTokens
token renew [<TOKEN>]Renew the token lifetime—Tokens
token revoke <TOKEN>Revoke the token and its child tokens-accessorTokens
d8 stronghold token create -policy=myapp-read -period=24h

policy

CommandPurposeDetails
policy write <NAME> <FILE>Create or update an ACL policy. Pass - instead of a file to read the policy from stdinPolicies
d8 stronghold policy write myapp-read - <<'POLICY'
path "secret/data/myapp/*" {
  capabilities = ["read"]
}
POLICY

secrets

CommandPurposeKey flagsDetails
secrets enable <TYPE>Enable a secrets engine-path, -version (for kv)Secrets engines
secrets listList enabled secrets engines-formatSecrets engines
secrets tune <PATH>Change mount parameters-max-lease-ttlPKI
secrets disable <PATH>Disable a secrets engine and delete its data—Secrets engines
d8 stronghold secrets enable -path=secret -version=2 kv

kv

CommandPurposeKey flagsDetails
kv put <PATH> <KEY>=<VALUE>Write a secret-mountKV2
kv get <PATH>Read a secret-mount, -version, -fieldKV2
kv patch <PATH> <KEY>=<VALUE>Partially update a secret-mountKV2
kv list <PATH>List keys at a path-mountKV
kv delete <PATH>Delete the latest version of a secret (recoverable in KV2)-mount, -versionsKV2
kv undelete <PATH>Restore deleted versions-mount, -versionsKV2
kv destroy <PATH>Permanently delete versions-mount, -versionsKV2
kv metadata get|put|patch|delete <PATH>Manage KV2 secret metadata-mount, -custom-metadataKV2
kv enable-versioning <PATH>Upgrade a KV1 store to KV2—KV2
d8 stronghold kv put -mount=secret myapp/db password=s3cr3t
d8 stronghold kv get -mount=secret -field=password myapp/db

Generic commands

These commands work with any API path: secrets engines, auth methods, and the sys/ system backend.

CommandPurposeKey flags
read <PATH>Read data-field, -format, -address
write <PATH> [<KEY>=<VALUE>...]Write data or perform an operation-f/-force (request without data), -field
list <PATH>List keys at a path-format
delete <PATH>Delete data at a path—
path-help <PATH>Show help for the paths of an engine—
d8 stronghold write -f transit/keys/orders/rotate
d8 stronghold read -address="${SECONDARY_ADDR}" sys/replication/dr/status
d8 stronghold path-help pki

lease

CommandPurposeKey flagsDetails
lease renew <LEASE_ID>Renew a lease-incrementLeases
lease revoke <LEASE_ID>Revoke a lease-prefixLeases
d8 stronghold lease revoke -prefix database/creds/myapp/

audit

Audit is available in all Stronghold editions.

CommandPurposeDetails
audit enable <TYPE> [parameters]Enable a file, syslog, or socket audit deviceAudit
audit listList enabled audit devicesAudit
audit disable <PATH>Disable an audit deviceAudit
d8 stronghold audit enable file file_path=/var/log/stronghold_audit.log

namespace

Namespaces are available in Stronghold EE.

CommandPurposeKey flagsDetails
namespace create <NAME>Create a namespace-namespace (parent)Namespaces
namespace listList child namespaces-namespaceNamespaces
namespace lookup <NAME>Show namespace details-namespaceNamespaces
namespace delete <NAME>Delete a namespace-namespaceNamespaces
namespace lock [<PATH>]Lock the Namespace API—Namespaces
namespace unlock [<PATH>]Unlock the Namespace API-unlock-keyNamespaces
d8 stronghold namespace create team-a

plugin

CommandPurposeKey flagsDetails
plugin register <TYPE> <NAME>Register an external plugin in the catalog-sha256, -versionPlugins in standalone, plugins in DP
plugin deregister <TYPE> <NAME>Remove a plugin from the catalog—Plugins
d8 stronghold plugin register -sha256="${PLUGIN_SHA}" secret my-custom-plugin