How can I integrate use Module Protection with a Thales HSM as Module Protection leverages virtual slots, for which a PIN/Passphrase cannot be defined?

How can I integrate use Module Protection with a Thales HSM as Module Protection leverages virtual slots, for which a PIN/Passphrase cannot be defined?

93
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 12:56 PM


Question


How can I integrate use Module Protection with a Thales HSM as Module Protection leverages virtual slots, for which a PIN/Passphrase cannot be defined?


Environment


10.5;10.10;11.5;11.6;11.7;12.0;12.2;12.6;13.0 Privileged Access Manager (PAM, self-hosted) Vault

Answer


The solution below includes steps to allow the Vault to access both the 32bit and 64bit PKCS11 DLLs

1.   Edit the dbparm.ini file and add the line AllowNonStandardFWAddresses=[HSMIP],Yes,1024:inbound/tcp,1024:outbound/tcp
a.       Assumes the HSM can be reached on port 1024, adjust port according to needs.
b.      Multiple HSM addresses can be supplied by separating them with a comma, ie [HSMIP1,HSMIP2,HSMIP3]
2.       Edit the dbparm.ini file
a.       Add the line PKCS11ProviderPath parameter to the location of the System32 location we’ll use for the PKCS#11 DLL. For example: PKCS11ProviderPath=” C:\Windows\System32\cknfast.dll”
b.      Add the line ReconnectHSMOnErrorCodes=48,50,179
3.       Save the file and restart the Vault
4.       Install Thales client on Vault servers and register with HSM
5.       Edit the file C:\Program Files (x86)\Ncipher\nfast\cknfastrc
a.       On a new line, enter CKNFAST_FAKE_ACCELERATOR_LOGIN=1
b.      Save and close the file
6.       Copy the 32 bit cknfast.dll file into C:\Windows\SysWOW64\ and rename to cknfast.dll
7.       Copy the 64 bit cknfast.dll file into C:\Windows\System32\ and rename to cknfast.dll

On the First Vault
1.       Stop the Vault
2.       Use CAVaultManager utility to generate the server key on the HSM by running the following command
a.      CAVaultManger GenerateKeyOnHSM /ServerKey
b.      Note the HSM key word returned by the command, ie, HSM#1
3.       Use the ChangeServerKeys command to re-encrypt the Vault data with the newly generated key. The Master key is required to complete this step
a.       Ensure the Master key is available in the location defined in dbparm.ini under the parameter RecoveryPrvKey. 
b.       Copy the Master key (recprv.key) to the local key store on the Vault, e.g. D:\PAKeys
c.       Execute the command ChangeServerKeys PathToKeys PathToEmergencyFile HSMKeyword
i.      For example, ChangeServerKeys D:\PAKeys D:\PAKeys\VaultEmergency.pass HSM#1
ii.      A utility will run that will verify the Master key is available and prompt if it cannot be found
iii.      HSM#1 is the key word returned by the command in Step
4.       Edit dbparm.ini
a.       Modify the entry for ServerKey and set it to read ServerKey=HSM#1
b.       Note that HSM#1 is the key word returned by step Step 2
5.       Use Sdelete (https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx) to delete the local copy of the private recovery key (recprv.key) using a minimum of 10 passes
6.       Start Vault and test
On Additional Vaults
1.       Copy Security World file generated on first Vault when new key was generated to appropriate folder on additional vaults
2.       Stop Vault
3.       Use the ChangeServerKeys command to rekey the Vault to use the HSM keys
a.        Ensure the Master key is available in the location defined in dbparm.ini under the parameter RecoveryPrvKey
a.       Also, copy the Master key (recprv.key) to the local key store on the Vault, e.g. D:\PAKeys
b.      Execute the command ChangeServerKeys PathToKeys PathToEmergencyFile HSMKeyword
i.      For example, ChangeServerKeys D:\PAKeys D:\PAKeys\VaultEmergency.pass HSM#1
 ii.      A utility will run that will verify the Master key is available and prompt if it cannot be found
iii.      HSM#1 is the same key word we used on the first vault for this step
4.       Use Sdelete (https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx) to delete the local copy of the private recovery key (recprv.key) using a minimum of 10 passes
5.       Edit dbparm.ini
a.       Modify the entry for ServerKey and set it to read ServerKey=HSM#1
b.       Note that HSM#1 is the same key word use for the first Vault
6.       Start the Vault and test


Additional Information


Details

Q:

How can I integrate use Module Protection with a Thales HSM as Module Protection leverages virtual slots, for which a PIN/Passphrase cannot be defined?

A:

The solution below includes steps to allow the Vault to access both the 32bit and 64bit PKCS11 DLLs

1.   Edit the dbparm.ini file and add the line AllowNonStandardFWAddresses=[HSMIP],Yes,1024:inbound/tcp,1024:outbound/tcp

a.       Assumes the HSM can be reached on port 1024, adjust port according to needs.

b.      Multiple HSM addresses can be supplied by separating them with a comma, ie [HSMIP1,HSMIP2,HSMIP3]

2.       Edit the dbparm.ini file

a.       Add the line PKCS11ProviderPath parameter to the location of the System32 location we’ll use for the PKCS#11 DLL. For example: PKCS11ProviderPath=” C:\Windows\System32\cknfast.dll”

b.      Add the line ReconnectHSMOnErrorCodes=48,50,179

3.       Save the file and restart the Vault

4.       Install Thales client on Vault servers and register with HSM

5.       Edit the file C:\Program Files (x86)\Ncipher\nfast\cknfastrc

a.       On a new line, enter CKNFAST_FAKE_ACCELERATOR_LOGIN=1

b.      Save and close the file

6.       Copy the 32 bit cknfast.dll file into C:\Windows\SysWOW64\ and rename to cknfast.dll

7.       Copy the 64 bit cknfast.dll file into C:\Windows\System32\ and rename to cknfast.dll

 

On the First Vault

1.       Stop the Vault

2.       Use CAVaultManager utility to generate the server key on the HSM by running the following command

a.       CAVaultManger GenerateKeyOnHSM /ServerKey

b.      Note the HSM key word returned by the command, ie, HSM#1

3.       Use the ChangeServerKeys command to re-encrypt the Vault data with the newly generated key. The Master key is required to complete this step

a.       Ensure the Master key is available in the location defined in dbparm.ini under the parameter RecoveryPrvKey

b.       Copy the Master key (recprv.key) to the local key store on the Vault, e.g. D:\PAKeys

c.       Execute the command ChangeServerKeys PathToKeys PathToEmergencyFile HSMKeyword

                                                               i.      For example, ChangeServerKeys D:\PAKeys D:\PAKeys\VaultEmergency.pass HSM#1

                                                             ii.      A utility will run that will verify the Master key is available and prompt if it cannot be found

                                                            iii.      HSM#1 is the key word returned by the command in Step 2

4.       Edit dbparm.ini

a.       Modify the entry for ServerKey and set it to read ServerKey=HSM#1

b.       Note that HSM#1 is the key word returned by step Step 2

5.       Use Sdelete (https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx) to delete the local copy of the private recovery key (recprv.key) using a minimum of 10 passes

6.       Start Vault and test

 

On Additional Vaults

1.       Copy Security World file generated on first Vault when new key was generated to appropriate folder on additional vaults

2.       Stop Vault

3.       Use the ChangeServerKeys command to rekey the Vault to use the HSM keys

a.        Ensure the Master key is available in the location defined in dbparm.ini under the parameter RecoveryPrvKey

a.       Also, copy the Master key (recprv.key) to the local key store on the Vault, e.g. D:\PAKeys

b.      Execute the command ChangeServerKeys PathToKeys PathToEmergencyFile HSMKeyword

                                                               i.      For example, ChangeServerKeys D:\PAKeys D:\PAKeys\VaultEmergency.pass HSM#1

                                                             ii.      A utility will run that will verify the Master key is available and prompt if it cannot be found

                                                            iii.      HSM#1 is the same key word we used on the first vault for this step

4.       Use Sdelete (https://technet.microsoft.com/en-us/sysinternals/sdelete.aspx) to delete the local copy of the private recovery key (recprv.key) using a minimum of 10 passes

5.       Edit dbparm.ini

a.       Modify the entry for ServerKey and set it to read ServerKey=HSM#1

b.       Note that HSM#1 is the same key word use for the first Vault

6.       Start the Vault and test




Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj00000010KXCAY&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail