This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sw:vault [2023/08/11 09:02] tomas [CLI] |
sw:vault [2024/09/10 19:54] (current) tomas [CLI] |
||
---|---|---|---|
Line 2: | Line 2: | ||
- | ==== CLI ==== | + | ==== URL ==== |
+ | https:// | ||
+ | / | ||
+ | |||
+ | ==== CLI ==== | ||
**[[https:// | **[[https:// | ||
VAULT_TOKEN ... token pro autorizaci\\ | VAULT_TOKEN ... token pro autorizaci\\ | ||
- | VAULT_SKIP_VERIFY ... ignoruje nevalidní certifikát\\ | + | VAULT_SKIP_VERIFY=true ... ignoruje nevalidní certifikát\\ |
VAULT_ADDR=https:// | VAULT_ADDR=https:// | ||
+ | |||
+ | == systém == | ||
+ | vault secret list ... seznam včech secret enginu\\ | ||
+ | vault list auth/ | ||
+ | vault list identity/ | ||
+ | vault list identity/ | ||
+ | vault list identity/ | ||
+ | vault auth list ... seznam authentikačních mechanizmů\\ | ||
+ | vault auth enable -path=" | ||
+ | vault login -method=userpass user=tomas ... přihlášení pomocí userpass\\ | ||
+ | vault policy list ... seznam policy\\ | ||
+ | vault policy read aaa ... ukáže definici policy aaa\\ | ||
+ | vault token capabilities secret/ | ||
+ | vault write -format=json identity/ | ||
+ | vault write identity/ | ||
+ | vault audit enable file file_path=/ | ||
+ | vault event subscribe kv-v2/ | ||
+ | wss:// | ||
+ | wscat -H " | ||
+ | |||
== Práce se secretama a hodnotama == | == Práce se secretama a hodnotama == | ||
Line 16: | Line 40: | ||
vault kv metadata get java/list ... získá informace o složce včetně metadat\\ | vault kv metadata get java/list ... získá informace o složce včetně metadat\\ | ||
vault kv metadata delete java/aaa ... smaže secret (složku)\\ | vault kv metadata delete java/aaa ... smaže secret (složku)\\ | ||
+ | vault auth list ... seznam policy?\\ | ||
+ | vault read auth/ | ||
+ | vault read sys/ | ||
+ | vault print token ... vypíše hodnotu tokenu\\ | ||
== Práce s Vault službou == | == Práce s Vault službou == | ||
VAULT_TOKEN=aaa vault operator step-down ... tento node přestane být hlavní node\\ | VAULT_TOKEN=aaa vault operator step-down ... tento node přestane být hlavní node\\ | ||
+ | vault status -tls-skip-verify ... vypíše status služby, nekontroluje certifikáty\\ | ||
vault operator unseal ... odblokuje node z maintenance modu\\ | vault operator unseal ... odblokuje node z maintenance modu\\ | ||
vault operator rekey -init -key-shares=5 | vault operator rekey -init -key-shares=5 | ||
Line 24: | Line 53: | ||
vault operator generate-root ... zadají se 3 unseal klíče a vygeneruje se nový root klíč\\ | vault operator generate-root ... zadají se 3 unseal klíče a vygeneruje se nový root klíč\\ | ||
+ | == Vault v Dockeru, backup/ | ||
+ | docker volume create vault-volume\\ | ||
+ | %%docker run --rm -it --name vault_local --cap-add=IPC_LOCK -e VAULT_ADDR=' | ||
+ | docker cp vault-snap/ | ||
+ | docker exec -it vault_local /bin/sh\\ | ||
+ | vault status\\ | ||
+ | vault operator init\\ | ||
+ | vault operator unseal -tls-skip-verify\\ | ||
+ | vault login\\ | ||
+ | vault operator raft snapshot restore -force / | ||
+ | vault operator unseal -tls-skip-verify\\ |