DEV Community

Cover image for First steps after Hashicorp Vault production deploy
Vasiliy
Vasiliy

Posted on

First steps after Hashicorp Vault production deploy

For ones who happy after production Hashicorp Vault deploy and a little confused about what to do next ... because all youtube and article guides are happyending on vault deploy.

Here the plan:

  1. Use your root token you've got after vault init to login the Vault:

    $ vault login <root token here>
    
  2. Create base policies with different permissions (admin, provisioner) And write them down

  3. Generate tokens for each policy

    $ vault token create -policy="admin"
    $ vault token create -policy="provisioner"
    
  4. Create and attach kv storage engine

    $ vault secrets enable -path=secret kv-v2
    
  5. Login under you "provisioner" user and check secret creation

    $ vault login <provisioner token here>
    $ vault kv put secret/foo bar=baz
    Key              Value
    ---              -----
    created_time     2020-07-14T15:41:52.080464762Z
    deletion_time    n/a
    destroyed        false
    version          1
    
  6. Now you can get the key! πŸ’₯πŸΎπŸŽ‰

    $ vault kv get secret/foo
    ====== Metadata ======
    Key              Value
    ---              -----
    created_time     2020-07-14T15:41:52.080464762Z
    deletion_time    n/a
    destroyed        false
    version          1
    === Data ===
    Key    Value
    ---    -----
    bar    baz
    

Top comments (0)