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
| Variable | Purpose | Example |
|---|---|---|
STRONGHOLD_ADDR | Stronghold server address | export STRONGHOLD_ADDR=https://stronghold.example.com |
STRONGHOLD_TOKEN | Token used for requests. Overrides the token saved by login | export STRONGHOLD_TOKEN=<TOKEN> |
STRONGHOLD_CACERT | Path to the CA certificate used to verify the server TLS certificate | export 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.
| Variable | Purpose |
|---|---|
STRONGHOLD_NAMESPACE | The namespace in which commands run (Stronghold EE) |
STRONGHOLD_CAPATH | A directory with CA certificates |
STRONGHOLD_CLIENT_CERT, STRONGHOLD_CLIENT_KEY | A client certificate and key for mutual TLS |
STRONGHOLD_TLS_SERVER_NAME | The server name used to verify the TLS certificate (SNI) |
STRONGHOLD_SKIP_VERIFY | Disable verification of the server TLS certificate. The client then does not detect a substituted server |
STRONGHOLD_CLIENT_TIMEOUT | The client request timeout |
STRONGHOLD_MAX_RETRIES | The maximum number of request retries on errors |
STRONGHOLD_WRAP_TTL | The time to live for response wrapping |
STRONGHOLD_MFA | MFA data for the request |
STRONGHOLD_FORMAT | The 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
| Flag | Purpose |
|---|---|
-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) |
-help | Command help |
Flags for connecting to the server:
| Flag | Purpose |
|---|---|
-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-verify | Disable verification of the server TLS certificate. The client then does not detect a substituted server |
-output-curl-string | Do not run the request; print an equivalent curl command instead |
Server and status
| Command | Purpose | Details |
|---|---|---|
server -config=<FILE> | Start the Stronghold server with the specified configuration file (standalone). In DP, the stronghold module manages the server | Installation, configuration |
status | Show the server status: initialization, Sealed, seal type, HA mode, Raft indexes | Access setup |
version | Show the Stronghold version and edition | — |
monitor -log-level=<LEVEL> | Stream node logs in real time | Logs |
d8 stronghold statusoperator
Cluster maintenance commands. They require a privileged token or unseal keys.
| Command | Purpose | Key flags | Details |
|---|---|---|---|
operator init | Initialize the storage and get the key shares and the root token. In DP, the module does this automatically | -key-shares, -key-threshold | Installation |
operator unseal | Enter an unseal key share. Repeat as many times as set by -key-threshold | — | Seal and unseal |
operator seal | Seal the node | — | Seal and unseal |
operator rekey | Change the unseal or recovery keys | -init, -nonce, -verify | Seal and unseal |
operator generate-root | Generate a new root token using a key quorum | -init, -nonce, -decode, -otp | Tokens |
operator step-down | Force the active HA node to step down | — | Switching from EE to CSE |
operator raft list-peers | Show Raft nodes and their roles | — | Raft quorum recovery |
operator raft join | Join a node to the Raft cluster | -non-voter | Configuration |
operator raft autopilot state | Show 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 | -force | Restoring |
operator raft snapshot inspect <FILE> | Check the contents and consistency of a snapshot | -validate, -depth, -filter, -format | Inspecting 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).snapAuthentication
| Command | Purpose | Key flags | Details |
|---|---|---|---|
login | Log in to Stronghold and save the token | -method, -path, -no-print | Access setup |
auth enable <TYPE> | Enable an auth method | -path | Auth methods |
auth list | List enabled auth methods | -format | Auth methods |
auth tune <PATH> | Change auth method parameters | for example, -user-lockout-disable | userpass |
d8 stronghold login -method=oidc -path=oidc_deckhouse -no-printtoken
| Command | Purpose | Key flags | Details |
|---|---|---|---|
token create | Create a token | -policy, -period, -orphan, -no-default-policy, -namespace | Tokens |
token renew [<TOKEN>] | Renew the token lifetime | — | Tokens |
token revoke <TOKEN> | Revoke the token and its child tokens | -accessor | Tokens |
d8 stronghold token create -policy=myapp-read -period=24hpolicy
| Command | Purpose | Details |
|---|---|---|
policy write <NAME> <FILE> | Create or update an ACL policy. Pass - instead of a file to read the policy from stdin | Policies |
d8 stronghold policy write myapp-read - <<'POLICY'
path "secret/data/myapp/*" {
capabilities = ["read"]
}
POLICYsecrets
| Command | Purpose | Key flags | Details |
|---|---|---|---|
secrets enable <TYPE> | Enable a secrets engine | -path, -version (for kv) | Secrets engines |
secrets list | List enabled secrets engines | -format | Secrets engines |
secrets tune <PATH> | Change mount parameters | -max-lease-ttl | PKI |
secrets disable <PATH> | Disable a secrets engine and delete its data | — | Secrets engines |
d8 stronghold secrets enable -path=secret -version=2 kvkv
| Command | Purpose | Key flags | Details |
|---|---|---|---|
kv put <PATH> <KEY>=<VALUE> | Write a secret | -mount | KV2 |
kv get <PATH> | Read a secret | -mount, -version, -field | KV2 |
kv patch <PATH> <KEY>=<VALUE> | Partially update a secret | -mount | KV2 |
kv list <PATH> | List keys at a path | -mount | KV |
kv delete <PATH> | Delete the latest version of a secret (recoverable in KV2) | -mount, -versions | KV2 |
kv undelete <PATH> | Restore deleted versions | -mount, -versions | KV2 |
kv destroy <PATH> | Permanently delete versions | -mount, -versions | KV2 |
kv metadata get|put|patch|delete <PATH> | Manage KV2 secret metadata | -mount, -custom-metadata | KV2 |
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/dbGeneric commands
These commands work with any API path: secrets engines, auth methods, and the sys/ system backend.
| Command | Purpose | Key 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 pkilease
| Command | Purpose | Key flags | Details |
|---|---|---|---|
lease renew <LEASE_ID> | Renew a lease | -increment | Leases |
lease revoke <LEASE_ID> | Revoke a lease | -prefix | Leases |
d8 stronghold lease revoke -prefix database/creds/myapp/audit
Audit is available in all Stronghold editions.
| Command | Purpose | Details |
|---|---|---|
audit enable <TYPE> [parameters] | Enable a file, syslog, or socket audit device | Audit |
audit list | List enabled audit devices | Audit |
audit disable <PATH> | Disable an audit device | Audit |
d8 stronghold audit enable file file_path=/var/log/stronghold_audit.lognamespace
Namespaces are available in Stronghold EE.
| Command | Purpose | Key flags | Details |
|---|---|---|---|
namespace create <NAME> | Create a namespace | -namespace (parent) | Namespaces |
namespace list | List child namespaces | -namespace | Namespaces |
namespace lookup <NAME> | Show namespace details | -namespace | Namespaces |
namespace delete <NAME> | Delete a namespace | -namespace | Namespaces |
namespace lock [<PATH>] | Lock the Namespace API | — | Namespaces |
namespace unlock [<PATH>] | Unlock the Namespace API | -unlock-key | Namespaces |
d8 stronghold namespace create team-aplugin
| Command | Purpose | Key flags | Details |
|---|---|---|---|
plugin register <TYPE> <NAME> | Register an external plugin in the catalog | -sha256, -version | Plugins 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