CloudHSM provides single-tenant, FIPS-validated hardware security modules in your VPC for cryptographic key generation, storage, and operations. The primary attack surface centers on HSM user credential compromise, network-level access to HSM ENIs, and IAM-level control-plane abuse.
CloudHSM clusters contain one or more HSM instances distributed across Availability Zones within a VPC. Each HSM gets an ENI in your subnet. Clients connect via ports 2223-2225.
Attack note: Compromising the cluster security group or gaining network access to HSM ENIs allows direct interaction with HSM instances.
CloudHSM has its own user model separate from IAM: Admin (manages users), Crypto User (creates/uses keys), and Appliance User (AWS-managed sync). Credentials are managed outside IAM.
Attack note: If an attacker obtains the admin or CU password, IAM policies cannot prevent HSM-level operations. Credential theft is the highest-impact vector.
CloudHSM has strong cryptographic protections — key material never leaves the HSM unencrypted. However, HSM user credentials exist outside IAM without MFA, the IAM control plane allows cluster destruction and backup exfiltration, and quorum authentication is not enabled by default.
aws cloudhsmv2 describe-clustersaws cloudhsmv2 describe-clusters --filters clusterIds=cluster-1234abcd5678aws cloudhsmv2 describe-backupsaws cloudhsmv2 list-tags --resource-id cluster-1234abcd5678aws cloudhsmv2 get-resource-policy --resource-arn arn:aws:cloudhsm:us-east-1:123456789012:backup/backup-1234abcd5678Key insight: Backup exfiltration is the primary escalation path — but the attacker still needs HSM user credentials to use the keys after restoring.
aws cloudhsmv2 describe-backups \
--query "Backups[*].{ID:BackupId,ClusterId:ClusterId,State:BackupState}"aws cloudhsmv2 copy-backup-to-region \
--destination-region eu-west-1 \
--backup-id backup-1234abcd5678aws cloudhsmv2 create-cluster \
--hsm-type hsm2m.medium \
--subnet-ids subnet-abcdef12 \
--source-backup-id backup-1234abcd5678aws cloudhsmv2 create-hsm \
--cluster-id cluster-newcluster \
--availability-zone eu-west-1aaws cloudhsmv2 delete-backup \
--backup-id backup-1234abcd5678aws cloudhsmv2 delete-hsm \
--cluster-id cluster-1234abcd5678 \
--hsm-id hsm-abcdef123456{
"Effect": "Allow",
"Action": "cloudhsm:*",
"Resource": "*"
}Grants full control including DeleteCluster, DeleteHsm, DeleteBackup, CopyBackupToRegion, and PutResourcePolicy. An attacker can destroy clusters and exfiltrate backups.
{
"Effect": "Allow",
"Action": [
"cloudhsm:DescribeClusters",
"cloudhsm:DescribeBackups",
"cloudhsm:ListTags"
],
"Resource": "*"
}Grants only read-only access for monitoring and inventory. Cannot modify, delete, or create any CloudHSM resources.
{
"Effect": "Allow",
"Action": [
"cloudhsm:DescribeClusters",
"cloudhsm:DescribeBackups",
"cloudhsm:ListTags",
"cloudhsm:CreateHsm",
"cloudhsm:TagResource"
],
"Resource": "*"
},
{
"Effect": "Deny",
"Action": [
"cloudhsm:DeleteCluster",
"cloudhsm:DeleteHsm",
"cloudhsm:DeleteBackup",
"cloudhsm:CopyBackupToRegion",
"cloudhsm:PutResourcePolicy"
],
"Resource": "*"
}Allows day-to-day operations while explicitly denying destructive actions and exfiltration vectors.
{
"Effect": "Deny",
"Action": [
"cloudhsm:DeleteCluster",
"cloudhsm:DeleteHsm",
"cloudhsm:DeleteBackup"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:PrincipalArn": "arn:aws:iam::*:root"
}
}
}SCP to prevent unauthorized deletion of CloudHSM resources across the organization.
Require multiple admins to approve sensitive operations like user creation, deletion, and password changes.
# cloudhsm-cli> quorum token-sign set-quorum-value --service user --value 2Always run at least two HSMs in separate Availability Zones for high availability and resilience.
aws cloudhsmv2 create-hsm \
--cluster-id cluster-1234abcd5678 \
--availability-zone us-east-1bEnsure the cluster security group only allows inbound traffic from authorized client instances. Never add broad CIDR ranges.
aws ec2 describe-security-groups \
--group-ids sg-cloudhsmclustersg \
--query "SecurityGroups[*].IpPermissions"Monitor all CloudHSM API calls (CreateHsm, DeleteHsm, DeleteCluster, CopyBackupToRegion, DeleteBackup) via CloudTrail.
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=EventName,AttributeValue=DeleteClusterCloudHSM sends HSM-level audit logs to CloudWatch Logs. Set up metric filters and alarms for failed logins and admin operations.
aws logs describe-log-groups --log-group-name-prefix /aws/cloudhsmCreate EventBridge rules to alert on high-risk CloudHSM API calls like DeleteHsm, DeleteCluster, and CopyBackupToRegion.
Store HSM user credentials in AWS Secrets Manager with rotation. Never store them in plaintext in application code or environment variables.
Use Service Control Policies to prevent unauthorized deletion of CloudHSM resources across the organization.
AWS CloudHSM Security Card • Toc Consulting
Always obtain proper authorization before testing