AWS CloudHSM Integration
Amazon AWS CloudHSM integrates with Akana's external keystore feature to securely store and manage cryptographic keys outside the Akana database. AWS CloudHSM is a cloud-based hardware security module that enables you to easily generate and use your own encryption keys in AWS.
On this page:
- Prerequisites
- JVM/JCE provider setup
- Install and configure the External Keystore feature on all containers
- Update the container startup script
- Verify the external provider installation
- Assign keys
- Signing and encryption provider configuration (JOSE and OAuth)
Prerequisites
Before you integrate Amazon AWS CloudHSM with Akana, complete the following prerequisites:
- Install and configure AWS CloudHSM: Complete the installation and configuration according to the AWS CloudHSM documentation. For information about installing and configuring AWS CloudHSM, refer to the AWS CloudHSM Getting Started guide.
- Verify network connectivity and keystore access: Confirm that each Akana container host(s) can connect to the AWS CloudHSM cluster. Ensure all network configurations allow communication between your Akana containers and the CloudHSM cluster.
- Akana integration requirements: Obtain the following values from your AWS CloudHSM configuration:
Name Description Provider name Cavium or CloudHSM Fully qualified provider class com.cavium.provider.CaviumProvider Keystore type CloudHSM Provider JAR location cloudhsm-*.jar location Keystore location CloudHSM partition name or connection string. Keystore password CloudHSM partition password or credentials. Customer CA certificate Required for secure communication with CloudHSM cluster. - Generate or import PKI keys: Create or import PKI keys in the AWS CloudHSM keystore for each identity that requires a key. If Policy Manager and Community Manager (PM/CM) use a different keystore from Network Director (ND), create or import each key in the keystore used by the corresponding component.
The following example uses an external Oracle JRE (Java 21 or later) to generate a 2048-bit RSA key pair for the pmcm identity:
{JAVA_HOME}/bin/keytool -genkeypair \ -alias pmcm \ -keyalg rsa \ -keysize 2048 \ -sigalg sha512withrsassa-pss \ -validity 365 \ -storetype CloudHSM \ -keystore PARTITION_1 \ -dname "CN=pmcm, OU=AKANA, O=PERFORCE, L=PARKER, ST=CO, C=US" \ -storepass your-partition-password \ -J-classpath '-J/opt/cloudhsm/java/*' -J-Djava.library.path=/opt/cloudhsm/libCreate or import keys for the following identities, as applicable:
- pmadmin: Policy Manager engine identity.
- Containers, listeners, and outbound identities: Required by your security configuration.
- (Optional) User identities referenced in JOSE Security Policy v2 and JOSE Profile-Driven Security Policy configurations.
- (Optional) Services that use Server Name Indication (SNI) to serve a service certificate over a TLS connection.
- (Optional) User identities referenced by the Akana OAuth/OIDC provider or an External OAuth provider.
- (Optional) The key used for SAML Web SSO.
Java Virtual Machine (JVM)/Java Cryptography Extension (JCE) provider setup
Complete the following steps to register the AWS CloudHSM provider with the Java runtime used by each Akana Platform container:
- Obtain the AWS CloudHSM JAR file from the security provider. The following shows the .jar files for CloudHSM:
- cloudhsm-3.4.4.jar (or later version)
- log4j-slf4j-impl-2.17.1.jar
- log4j-over-slf4j-1.7.32.jar
- log4j-core-2.17.1.jar
- log4j-api-2.17.1.jar
- Open the java.security provider file at $JAVA_HOME/conf/security/java.security to add and register the AWS CloudHSM security provider. For example:
security.provider.1=Sun security.provider.2=SunRsaSign security.provider.3=SunEC security.provider.4=SunJSSE security.provider.5=SunJCE security.provider.6=SunJGSS security.provider.7=SunSASL security.provider.8=XMLDSig security.provider.9=SunPCSC security.provider.10=CaviumProvider security.provider.11=BouncyCastleProvider
- (Optional) If you cannot modify the default java.security file, create a custom java.security file that specifies your preferred provider order. Specify the path to the custom file by adding the following JVM argument when the container starts:
-Djava.security.properties=/path/to/custom-java.security
The following example shows AWS CloudHSM-specific entries in a custom java.security file:
# Add the HSM security providers security.provider.10=com.cavium.provider.CaviumProvider security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider # Set the preferred provider for specific signature algorithms jdk.security.provider.preferred=Signature.RSASSA-PSS:com.cavium.provider.CaviumProvider, \ Signature.SHA384withECDSA:com.cavium.provider.CaviumProvider
Install and configure the External Keystore feature on all containers
Use the automation recipe or Admin Console user interface to install and configure an external keystore for Policy Manager and Network Director containers.
Option 1: AWS CloudHSM External Keystore configuration by using an automation recipe
When configuring an AWS CloudHSM as an external keystore by using an automation recipe, use the following AWS CloudHSM property values. For more information, see Using the External Keystore recipe to install and configure an external keystore.
AWS CloudHSM property configuration
Add the following AWS CloudHSM property values to your properties file:
EX_KEYSTORE_PROVIDERNAME=Cavium EX_KEYSTORE_KEYSTORETYPE=CloudHSM EX_KEYSTORE_ENCRYPTED=true EX_KEYSTORE_LOCATION=PARTITION_1 EX_KEYSTORE_PASSWORD=your-partition-password
Option 2: Install the External Keystore feature by using the Admin Console
For a newly created container, install and configure the External Keystore feature before you configure the container identity.
Install the External Keystore feature
- Launch the Akana Administration Console (http://<hostname>:<port>/admin/) for the container.
- On the Available Features tab, select Plug-in from the filter list.
- Select External Keystore.
- Select Install Feature.
- If prompted, restart the container.
Repeat these steps for each container that references the AWS CloudHSM keystore, including Policy Manager and Network Director.
Configure the External Keystore feature
- In the Akana Administration Console, go to the Configuration tab.
- Select Configuration Actions > Configure External Keystore.
- In the External Keystore Options page, specify the following values:
- Provider Name: Cavium
- Keystore Type: CloudHSM
- Keystore Location: Your CloudHSM partition name (For example, PARTITION_1).
- Keystore Password: Your CloudHSM partition password.
- Set the Encrypted option:
- Selected: Policy Manager attaches an alias. Network Director uses the alias to retrieve the private key directly from the external keystore.
- Cleared: Policy Manager attaches the encrypted private key directly to the WSDL.
- Select Finish.
- If prompted, restart the container.
Repeat these steps for the Network Director container. Use the same values if both containers access the same CloudHSM cluster or CloudHSM-specific alias values if they use different partitions.
Update the container startup script
In <INSTALL_HOME>/bin/setDEMSEnv.sh, update AKANA_OPTS to include the AWS CloudHSM-specific JVM arguments and environment variables:
AKANA_OPTS="${AKANA_OPTS} -Djava.security.properties=/path/to/custom-java.security -DHSM_PARTITION=<partition_name> -DHSM_USER=<hsm_username> -DHSM_PASSWORD=<hsm_password> -Djava.library.path=<cloudhsm_lib_path>"
Alternatively, you can pass these as environment variables when starting the container:
./startup.sh eap-cloudhsm \ -DHSM_PARTITION=<partition_name> \ -DHSM_USER=<hsm_username> \ -DHSM_PASSWORD=<hsm_password> \ -Djava.library.path=<cloudhsm_lib_path>
Replace the following with values from your CloudHSM configuration:
- <partition_name>: The CloudHSM partition identifier (For example, PARTITION_1).
- <hsm_username>: The CloudHSM partition username.
- <hsm_password>: The CloudHSM partition password.
- <cloudhsm_lib_path>: The path to CloudHSM library (typically, /opt/cloudhsm/lib).
You can verify the logs to check for Cavium exceptions in the startup.log file.
Verify the external provider installation
After completing the configuration, verify that the external provider is installed and that sensitive key information is not stored in the database.
- Restart the system.
- Log in to the Akana Administration Console for the container and go to the Configuration tab > Manage PKI Keys.
- On the Manage PKI screen, verify that the Assign alias option is available.
Assign keys
After you install the External Keystore feature on a container, Generate PKI Keys and Export Private Keys and X.509 Certificate are not allowed for any identities requiring private keys. The private key material cannot be exported from the AWS CloudHSM.
For instructions on assigning keys to containers, listeners, services, organizations, users, and SAML SSO identities, see Assigning Keys by Identity Type.
For key operations that use CloudHSM, an alias password is not required. The encrypted username and password are provided when the container starts. Any password submitted during the operation is ignored, so an incorrect alias password does not cause the operation to fail. If Policy Manager and Network Director reference different CloudHSM partitions, manage aliases separately for each container.
Signing and encryption provider configuration (JOSE and OAuth)
For information about configuring the AWS CloudHSM signing provider, see Signing provider for JOSE and OAuth.
Use Cavium as the provider value in the following fields:
- JOSE Security Policy v2: In Crypto Provider, specify Cavium.
- JOSE Profile-Driven Security Policy: In Crypto Provider, specify Cavium.
- OAuth Client Policy: In Signing JCA Provider, specify Cavium.
- Akana OAuth/OIDC Provider Domain: In Signing JCA Provider, Encrypt JCA Provider, and Decrypt JCA Provider, specify Cavium.
- External OAuth Provider Domain: In Decrypt JCA Provider, specify Cavium.