Configure and Use the HashiCorp Vault KV Secret Engine

This doc provides steps to create and use a KV Secrets Engine on Vault to be used with Axual Platform.

These steps have been written with the governance secret engine as example, this secret engine is required when using the Platform Manager with the Streaming charts, but can be replaced with any other secret engine.

Initially, we need to initialize and unseal the HashiCorp Vault.

Initialization is required once

Initialize and Unseal the HashiCorp Vault

The first time you install the HashiCorp Vault, it requires to be initialized to have unseal key(s) and a root token.

More info can be found in the Vault official doc

  1. Access the Vault UI

    Vault UI init screen
  2. Provide the key shares and the key threshold and press Initialize button

    For a production environment we suggest at least key_shares=3 and key_threshold=2
    Vault UI init screen with values
  3. Download the generated keys

    These will be used to unseal and access the Vault UI
    Vault UI download keys screen
  4. Press the Continue to Unseal button

  5. Paste the Key(s) and press the Unseal button

    Vault UI unseal screen

    Based on the number of key shares and key threshold you will have to repeat the above step with a different key.

    More info can be found in the Vault official doc

Enable the AppRole Auth Method

The AppRole auth method allows application to authenticate with Vault-defined roles.

More info can be found in the Vault official doc

  1. Login into the Vault UI with your rootToken

    Vault UI login screen
  2. Open the Access menu

    Open Access Menu
  3. Press the Enable auth method button

    Enable auth method button
  4. Select the AppRole type for the new Authentication Method and press Next

    Select Authentication Method type
  5. Fill the Path with approle and press the Enable Method button

    Create AppRole
  6. You have now enabled the AppRole authentication method, let’s use it with Platform Manager.

    `platform-manager` Policy created

Create the KV Secrets Engine

The KV Secrets Engine is used to store secrets in Vault storage with Key:Value format.

More info can be found in the Vault official doc

  1. Login into the Vault UI with the rootToken

    Vault UI login screen
  2. Open the Secrets Engines menu

    Open Secrets Engines Menu
  3. Press the Enable new engine button

    Enable new engine button
  4. Select the KV type for the new engine and press Next

    Select Secrets Engine type
  5. Fill the Path with governance and press Enable Engine

    Create `governance` path
  6. You have now configured the governance KV Secrets Engine, let’s use it with Platform Manager.

    `governance` KV secrets engine created

Create the Platform Manager Policy

Create the ACL Rule

The ACL Rule is a Vault Policy that provides a declarative way to grant access to a certain path.

More info can be found in the Vault official doc

  1. Login into the Vault UI with the rootToken

    Vault UI login screen
  2. Open the Policy menu

    Open Policies Menu
  3. Press the Create ACL policy button

    ACL policy button
  4. Fill the Name with platform-manager and copy the following content as Policy

    path "governance/*" {
    	capabilities = ["read","create","update","delete"]
    }
    Create Platform Manager policy
  5. Press Create Policy

    `platform-manager` Policy created
  6. You have now created the Platform Manager policy, let’s add it to the Platform Manager AppRole.

Create RoleId and SecretId

  1. Login into the Vault UI with the rootToken

    Vault UI login screen
  2. Open the terminal menu

    Open Terminal Menu
  3. Add the Platform Manager policy to the Platform Manager AppRole

    vault write auth/approle/role/platform-manager token_policies="platform-manager"
    Write policy to Platform Manager AppRole
  4. Read the Platform Manager policy role_id

    vault read auth/approle/role/platform-manager/role-id
    Read Platform Manager RoleID
  5. You will see a response like the following

    Key     Value
    role_id 0b7569bd-7d8b-c33c-f759-e15231b18542

    Note down the role_id, will be used in the Platform Manager configuration

  6. Read the Platform Manager policy secret_id

    vault write -f auth/approle/role/platform-manager/secret-id
    Read Platform Manager SecretID
  7. You will see a response like the following

    Key                Value
    secret_id          2387519d-5ac8-8af2-ad58-e89848fa3f05
    secret_id_accessor a5740957-205d-7be4-23c7-e7bc57791631
    secret_id_num_uses 0
    secret_id_ttl      0

    Note down the secret_id, will be used in the Platform Manager configuration

  8. Now you have done all steps to allow Platform Manager accessing the governance path.