exportVAULT_ADDR=https://vault.example.com:8200where the cli talks to
exportVAULT_CACERT=/etc/ssl/vault-ca.pemtrust a private ca
exportVAULT_NAMESPACE=adminenterprise and hcp only
vaultstatussealed? ha mode, version
vaultserver-devlocal test server, root token printed
login
vaultloginpaste a token
vaultlogin-method=userpassusername=adminasks for the password
vaultlogin-method=oidcsso in the browser
vaulttokenlookupown policies, ttl
tokens
vaulttokencreate-policy=app-read-ttl=1hchild token with that policy
vaulttokenrenewextend own ttl
vaulttokenrevoke-selflog out for good
vaulttokencapabilitiessecret/data/appwhat this token may do there
kv
vaultkvput-mount=secretappuser=adminpass=s3cr3tnew version, replaces every key
vaultkvpatch-mount=secretapppass=n3wchange one key, keep the rest
vaultkvget-mount=secretapplatest version, every key
vaultkvget-mount=secret-field=passappraw value, for scripts
vaultkvget-mount=secret-version=2appan older version
vaultkvlist-mount=secretapp/keys under app/
vaultkvdelete-mount=secretappsoft delete of the latest version
vaultkvundelete-mount=secret-versions=3appbring a deleted version back
vaultkvrollback-mount=secret-version=2appv2 becomes the latest again
vaultkvmetadatadelete-mount=secretappevery version, for good
secrets engines
vaultsecretslistmounts and their types
vaultsecretsenable-path=secretkv-v2versioned kv at secret/
vaultsecretsdisablesecret/deletes everything in it
auth methods
vaultauthlistenabled methods and their paths
vaultauthenableuserpassmounted at auth/userpass/
vaultwriteauth/userpass/users/adminpassword=s3cr3ttoken_policies=admincreate or update a user
vaultauthdisableuserpass/revokes its tokens
policies
vaultpolicylist
vaultpolicyreadapp-readshow its rules
vaultpolicywriteapp-readapp-read.hclcreate or replace from a file
path"secret/data/app/*"{capabilities=["read"]}kv-v2 reads go through data/
path"secret/metadata/app/*"{capabilities=["list"]}listing goes through metadata/
approle
vaultauthenableapprolemachine login for ci and apps
vaultwriteauth/approle/role/citoken_policies=citoken_ttl=1hrole, its policy, token ttl
vaultread-field=role_idauth/approle/role/ci/role-idfixed id, like a username
vaultwrite-f-field=secret_idauth/approle/role/ci/secret-idnew secret, like a password
vaultwriteauth/approle/loginrole_id="$ROLE_ID"secret_id="$SECRET_ID"returns a token
kubernetes auth
vaultauthenablekubernetespods log in with their service account
vaultwriteauth/kubernetes/configkubernetes_host=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORTvault runs in the cluster
vaultwriteauth/kubernetes/role/appbound_service_account_names=appbound_service_account_namespaces=defaulttoken_policies=app-readttl=1hwhich accounts get which policy
leases
vaultreaddatabase/creds/readonlydynamic db user + lease
vaultleaserenew"$LEASE_ID"keep the credentials longer
vaultleaserevoke"$LEASE_ID"credentials stop working now
vaultleaserevoke-prefixdatabase/creds/readonlyevery lease from the role
unseal & raft
vaultoperatorinit-key-shares=5-key-threshold=3once; keep the keys apart
vaultoperatorunsealrepeat until the threshold
vaultoperatorsealstops serving until unsealed
vaultoperatorraftlist-peerscluster members, who leads
vaultoperatorraftsnapshotsavebackup.snapbackup of all data
vaultoperatorraftsnapshotrestorebackup.snapreplaces all data