Integrate enclaive vHSM with Utimaco HSM

Learn how to install and configure enclaive vHSM with Utimaco HSM

Prerequisites

  1. Download and install Utimaco Security Server software.

  2. Update the cs_pkcs11_R3.cfg configuration file.

  3. Create a Security Officer (SO) User and initialize a slot.

For more information about downloading, installing, Utimaco Secirity Server Software, see the Utimaco integration guide

To integrate enclaive vHSM with Utimac HSM you need to perform these steps:

Install enclaive vHSM in a Docker container

  1. Create the vhsm group : groupadd vhsm

  2. Create the vhsm User : useradd --gid vhsm vhsm

  3. Pull the latest image: docker pull harbor.enclaive.cloud/vhsm/vhsm-utimaco:latest

  4. Set the enterprise license key that you received as an environment variable: export ENCLAIVE_LICENCE=<licence-key>

  5. Download and install the vHSM CLI to interact with enclaive vHSM: wget https://vhsm.enclaive.cloud/static/vhsm

  6. Create a directory for the vHSM configuration file, data, and certificates

Configure enclaive vHSM to run with Utimaco HSM

To configure the vHSM, you need to set up vHSM first. Outside of development mode, vHSM servers are configured using a persistent storage method.

1. Create a /etc/vhsm/config file and add the following contents:

Note: Ensure that the slot number and slot PIN are per your Utimaco setup.

2. Start the enclave vHSM server to run with Utimaco HSM.

3. Check the status of vHSM server: vhsm status

The output is similar to:

4. Initialize vHSM to use the HSM initial token value: vhsm operator init

The output is similar to:

5. Verify that the keys got generated into the HSM: p11tool2 slot=<slot_no> loginuser=<slot_PIN> listobjects

The output is similar to:

6. Check the status of vHSM again to verify that it is initialized and unsealed: vhsm status

The output is similar to:

7. Log in to vHSM using the initial Root token that you saved: vhsm login <initial_root_token_value>

The output is similar to:

Test vHSM Integration with Utimaco HSM

After configuring vHSM with Utimaco HSM you can test the integration by viewing the secrets, enabling the Secrets Engine, seal wrapping the secret data, and retrieving the secret data.

1. View the current secrets and the default locations: vhsm secrets list

2. Enable the KV engine: vhsm secrets enable -version=1 kv

3. View the details of the Secrets Engine that you enabled: vhsm secrets list -detailed

4.To test the seal wrap feature, add secret data to the key/value storage of vHSM: vhsm kv put kv /opt/vhsm/secret key=test_secret

5. Retrieve the secret data from vHSM storage: vhsm kv get kv /opt/vhsm/secret

Enable Entropy Augmentation

Entropy augmentation allows Vault Enterprise to supplement its system entropy with entropy from an external cryptography module. Designed to operate in environments where alignment with cryptographic regulations like NIST SP800-90B is required or when augmented entropy from external sources such as hardware true random number generators (TRNGs) augmented entropy replaces system entropy when performing random number operations on critical security parameters (CSPs).

1. Update the /etc/vhsm/config file and add the following contents:

Note: Ensure that the slot number and slot PIN are per your Utimaco setup.

2. Restart the vHSM service: docker restart <name_of_the_container>

3. Log in to vHSM using the initial Root token that you saved. vhsm login <initial_root_token_value>

4. Execute the following command to enable transit secrets engine with external entropy source using the ` -external-entropy-access` flag: vhsm secrets enable -external-entropy-access transit

5. List the enabled secrets engine with -detailed flag: vhsm secrets list -detailed

Note: The External Entropy Access is set to true for transit.

6. You can start using the transit secrets engine to encrypt your sensitive data which leverages the HSM as its external entropy source. Now create a new encryption key named, "orders". vhsm write -f transit/keys/order

7. Send a base64-encoded string to be encrypted by vHSM: vhsm write transit/encrypt/orders plaintext=$(base64 <<< “4111 1111 1111 1111”)

8. Verify that you can decrypt: vhsm write transit/decrypt/orders ciphertext=vault:v1:mBBYBUoICZ/igXKgkb9YPmWA+2b6upmZM1WqQEyiiyGa6aq6bpqn0Hfqxpi89aJ

9. Decode to get the original value: base64 --decode <<< NDExMSAxMTExIDExMTEgMTExMQo=

Last updated

Was this helpful?