All Products
Search
Document Center

Key Management Service:Service-linked role for HSM

Last Updated:Mar 31, 2026

AliyunServiceRoleForHSMLogDelivery is a service-linked role that grants Cloud Hardware Security Module (HSM) the permissions it needs to deliver security audit logs to Object Storage Service (OSS).

Permissions

AliyunServiceRoleForHSMLogDelivery has the following permissions:

PermissionResourcePurpose
oss:ListBucketsAll buckets (acs:oss:*:*:*)Retrieves the list of OSS buckets
oss:GetObject, oss:PutObjectacs:oss:*:*:*/aliyun-hsm-audit-log and subpathsReads and writes audit log files to the aliyun-hsm-audit-log path in the destination bucket
ram:DeleteServiceLinkedRoleAll (*), conditioned on ram:ServiceName: logdelivery.hsm.aliyuncs.comAllows Resource Access Management (RAM) to delete this role when you no longer need it

The full policy for this role is:

{
  "Statement": [
    {
      "Action": "ram:DeleteServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": "logdelivery.hsm.aliyuncs.com"
        }
      }
    },
    {
      "Action": [
        "oss:GetObject",
        "oss:PutObject"
      ],
      "Effect": "Allow",
      "Resource": [
        "acs:oss:*:*:*/aliyun-hsm-audit-log",
        "acs:oss:*:*:*/aliyun-hsm-audit-log/*"
      ]
    },
    {
      "Action": [
        "oss:ListBuckets"
      ],
      "Effect": "Allow",
      "Resource": [
        "acs:oss:*:*:*"
      ]
    }
  ]
}

Delete the service-linked role

Before deleting AliyunServiceRoleForHSMLogDelivery, confirm that:

Both conditions ensure that no active workload depends on the role. Once both are met, delete the role from the RAM console.