Outils pour utilisateurs

Outils du site


tech:notes_hashicorp_vault

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_hashicorp_vault [2026/09/21 17:05] – Jean-Baptistetech:notes_hashicorp_vault [2026/11/03 15:33] (Version actuelle) – Jean-Baptiste
Ligne 60: Ligne 60:
  
 export VAULT_TOKEN='hvs.pSSg3pM9pfk5Ih6HdCi784un...' export VAULT_TOKEN='hvs.pSSg3pM9pfk5Ih6HdCi784un...'
-vault(){ podman run --cap-add IPC_LOCK --rm -v /etc/ssl/certs/:/etc/ssl/certs/:ro -e VAULT_ADDR='https://vault.acme.local' docker.io/library/vault:0.11.6 vault $@ ;}+vault(){ podman run --cap-add IPC_LOCK --rm -v /etc/ssl/certs/:/etc/ssl/certs/:ro -e VAULT_ADDR='https://vault.acme.local' -e VAULT_TOKEN docker.io/library/vault:0.11.6 vault $@ ;}
  
 vault --version vault --version
Ligne 137: Ligne 137:
 } }
 ~~~ ~~~
 +
 +~~~
 +vault write auth/approle/login \
 +    role_id=db02de05-fa39-4855-059b-67221c5c2f63 \
 +    secret_id=6a174c20-f6de-a53c-74d2-6018fcceff64
 +
 +Key                Value
 +---                -----
 +token              65b74ffd-842c-fd43-1386-f7d7006e520a
 +token_accessor     3c29bc22-5c72-11a6-f778-2bc8f48cea0e
 +token_duration     20m0s
 +token_renewable    true
 +token_policies     [default]
 +
 +
 +
 +vault auth enable approle
 +
 +vault write auth/approle/login \
 +    role_id=22dea5fa-b745-11f1-9077-00155dae9f60 \
 +    secret_id=43017678-b745-11f1-8da6-00155dae9f60
 +~~~
 +
 +$ vault token lookup
 +Error looking up token: Error making API request.
 +
 +URL: GET https://vault.acme.local/v1/auth/token/lookup-self
 +Code: 403. Errors:
 +
 +* 2 errors occurred:
 +        * permission denied
 +        * invalid token
 +
 +
 +~~~bash
 +cat << EOF | vault policy write ansible-readonly -
 +path "secret/data/lab82" {
 +  capabilities = ["read"]
 +}
 +EOF
 +~~~
 +
  
tech/notes_hashicorp_vault.1790003107.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki