Learn more about integrating an HSM with Infisical KMS.
ENCRYPTION_KEY
environment variable.v0.91.0
.infisical/infisical-fips
image.Setting up an HSM Device
Configure HSM on Infisical
HSM_LIB_PATH
: The path to the PKCS#11 library provided by the HSM provider. This usually comes in the form of a .so
for Linux and MacOS, or a .dll
file for Windows. For Docker, you need to mount the library path as a volume. Further instructions can be found below. If you are using Docker, make sure to set the HSM_LIB_PATH environment variable to the path where the library is mounted in the container.HSM_PIN
: The PKCS#11 PIN to use for authentication with the HSM device.HSM_SLOT
: The slot number to use for the HSM device. This is typically between 0
and 5
for most HSM devices.HSM_KEY_LABEL
: The label of the key to use for encryption. Please note that if no key is found with the provided label, the HSM will create a new key with the provided label.Restart Instance
Navigate to the Server Admin Console
Update the KMS Encryption Strategy to HSM
Verify Encryption Strategy
Create HSM client folder
/etc/luna-docker
.Chrystoki.conf
file, and the libs
, plugins
, and jsp
folders. You need to copy these files to the folder you created in the first step.Update Chrystoki.conf
Chrystoki.conf
file is used to configure the HSM client. You need to update the Chrystoki.conf
file to point to the correct file paths.In this example, we will be mounting the /etc/luna-docker
folder to the Docker container under a different path. The path we will use in this example is /usr/safenet/lunaclient
. This means /etc/luna-docker
will be mounted to /usr/safenet/lunaclient
in the Docker container.An example config file will look like this:Run Docker
.env
file to set these environment variables.HSM_KEY_LABEL
environment variable, and the HMAC key label will be the value of the HSM_KEY_LABEL
environment variable with the suffix _HMAC
.Software-based Encryption
. This will revert the encryption strategy back to the default software-based encryption.