AliyunServiceRoleForXtrace service-linked role

Updated at:

Managed Service for OpenTelemetry uses the AliyunServiceRoleForXtrace service-linked role to access other Alibaba Cloud services on your behalf. This role is automatically created the first time the service requires cross-service access and grants only the permissions necessary for monitoring and tracing operations.

A service-linked role is a Resource Access Management (RAM) role that only the linked service can assume. You cannot modify its permissions or assign it to other entities. For more information, see Service-linked roles.

When this role is created

Managed Service for OpenTelemetry automatically creates the AliyunServiceRoleForXtrace role when its monitoring feature first needs to access resources in the following services:

Permissions

The AliyunServiceRoleForXtrace role includes the following permissions, organized by service. Each section includes a summary of what the permissions allow, followed by the full policy definition.

ACK permissions

Discover, query, and manage Kubernetes clusters for monitoring purposes. Includes cluster scaling, configuration retrieval, image signing policy (Kritis) management, and log access.

{
    "Action": [
        "cs:ScaleCluster",
        "cs:GetClusterById",
        "cs:GetClusters",
        "cs:GetUserConfig",
        "cs:CheckKritisInstall",
        "cs:GetKritisAttestationAuthority",
        "cs:GetKritisGenericAttestationPolicy",
        "cs:AttachInstances",
        "cs:InstallKritis",
        "cs:InstallKritisAttestationAuthority",
        "cs:InstallKritisGenericAttestationPolicy",
        "cs:UpdateClusterTags",
        "cs:UninstallKritis",
        "cs:DeleteKritisAttestationAuthority",
        "cs:DeleteKritisGenericAttestationPolicy",
        "cs:UpdateKritisAttestationAuthority",
        "cs:UpdateKritisGenericAttestationPolicy",
        "cs:UpgradeCluster",
        "cs:GetClusterLogs"
    ],
    "Resource": [
        "acs:cs:*:*:cluster/*"
    ],
    "Effect": "Allow"
}

Log Service permissions

Create and manage Log Service projects, Logstores, indexes, dashboards, machine groups, consumer groups, saved searches, and jobs for trace data storage and analysis.

{
    "Action": [
        "log:CreateProject",
        "log:GetProject",
        "log:GetLogStoreLogs",
        "log:GetHistograms",
        "log:GetLogStoreHistogram",
        "log:GetLogStore",
        "log:ListLogStores",
        "log:EnableService",
        "log:DescribeService",
        "log:CreateLogStore",
        "log:DeleteLogStore",
        "log:UpdateLogStore",
        "log:GetCursorOrData",
        "log:GetCursor",
        "log:PullLogs",
        "log:ListShards",
        "log:PostLogStoreLogs",
        "log:CreateConfig",
        "log:UpdateConfig",
        "log:DeleteConfig",
        "log:GetConfig",
        "log:ListConfig",
        "log:CreateMachineGroup",
        "log:UpdateMachineGroup",
        "log:DeleteMachineGroup",
        "log:GetMachineGroup",
        "log:ListMachineGroup",
        "log:ListMachines",
        "log:ApplyConfigToGroup",
        "log:RemoveConfigFromGroup",
        "log:GetAppliedMachineGroups",
        "log:GetAppliedConfigs",
        "log:GetShipperStatus",
        "log:RetryShipperTask",
        "log:CreateConsumerGroup",
        "log:UpdateConsumerGroup",
        "log:DeleteConsumerGroup",
        "log:ListConsumerGroup",
        "log:UpdateCheckPoint",
        "log:HeartBeat",
        "log:GetCheckPoint",
        "log:CreateIndex",
        "log:DeleteIndex",
        "log:GetIndex",
        "log:UpdateIndex",
        "log:CreateSavedSearch",
        "log:UpdateSavedSearch",
        "log:GetSavedSearch",
        "log:DeleteSavedSearch",
        "log:ListSavedSearch",
        "log:CreateDashboard",
        "log:UpdateDashboard",
        "log:GetDashboard",
        "log:DeleteDashboard",
        "log:ListDashboard",
        "log:CreateJob",
        "log:UpdateJob"
    ]
}

ECS permissions

Query ECS instance details, monitor resource metrics, manage security groups, and run Cloud Assistant commands.

{
    "Action": [
        "ecs:DescribeInstanceAutoRenewAttribute",
        "ecs:DescribeInstances",
        "ecs:DescribeInstanceStatus",
        "ecs:DescribeInstanceVncUrl",
        "ecs:DescribeSpotPriceHistory",
        "ecs:DescribeUserdata",
        "ecs:DescribeInstanceRamRole",
        "ecs:DescribeDisks",
        "ecs:DescribeSnapshots",
        "ecs:DescribeAutoSnapshotPolicy",
        "ecs:DescribeSnapshotLinks",
        "ecs:DescribeImages",
        "ecs:DescribeImageSharePermission",
        "ecs:DescribeClassicLinkInstances",
        "ecs:AuthorizeSecurityGroup",
        "ecs:DescribeSecurityGroupAttribute",
        "ecs:DescribeSecurityGroups",
        "ecs:AuthorizeSecurityGroupEgress",
        "ecs:DescribeSecurityGroupReferences",
        "ecs:RevokeSecurityGroup",
        "ecs:DescribeNetworkInterfaces",
        "ecs:DescribeTags",
        "ecs:DescribeRegions",
        "ecs:DescribeZones",
        "ecs:DescribeInstanceMonitorData",
        "ecs:DescribeEipMonitorData",
        "ecs:DescribeDiskMonitorData",
        "ecs:DescribeInstanceTypes",
        "ecs:DescribeInstanceTypeFamilies",
        "ecs:DescribeTasks",
        "ecs:DescribeTaskAttribute",
        "ecs:DescribeInstanceAttribute",
        "ecs:InvokeCommand",
        "ecs:CreateCommand",
        "ecs:StopInvocation",
        "ecs:DeleteCommand",
        "ecs:DescribeCommands",
        "ecs:DescribeInvocations",
        "ecs:DescribeInvocationResults",
        "ecs:ModifyCommand",
        "ecs:InstallCloudAssistant"
    ],
    "Resource": "*",
    "Effect": "Allow"
}

VPC permissions

Query VPC configurations, vSwitches, elastic IP addresses, router interfaces, and gateway information for network topology discovery.

{
    "Action": [
        "vpc:DescribeVpcs",
        "vpc:DescribeVSwitches",
        "vpc:DescribeEipAddresses",
        "vpc:DescribeRouterInterfaces",
        "vpc:DescribeGlobalAccelerationInstances",
        "vpc:DescribeVpnGateways",
        "vpc:DescribeNatGateways"
    ],
    "Resource": "*",
    "Effect": "Allow"
}

SLB permissions

Query Server Load Balancer (SLB) configurations and manage access log settings for traffic analysis.

{
    "Action": [
        "slb:DescribeLoadBalancers",
        "slb:DescribeLoadBalancerAttribute",
        "slb:SetLoadbalancerListenerAttributeEx",
        "slb:DescribeLoadbalancerListenersEx",
        "slb:DescribeLoadbalancerListenersEx",
        "slb:SetAccessLogsDownloadAttribute",
        "slb:DeleteAccessLogsDownloadAttribute",
        "slb:DescribeAccessLogsDownloadAttribute"
    ],
    "Resource": "*",
    "Effect": "Allow"
}

Delete the AliyunServiceRoleForXtrace role

If you no longer need cross-service access for Managed Service for OpenTelemetry, delete the AliyunServiceRoleForXtrace role. After deletion, trace data can no longer be stored or displayed for the current account.

Note

If any Managed Service for OpenTelemetry applications exist in your account, delete all applications before you delete the role.

  1. Log on to the RAM console.

  2. In the left-side navigation pane, choose Identities > Roles.

  3. On the Roles page, search for AliyunServiceRoleForXtrace.

  4. Click Delete Role in the Actions column.

  5. In the Delete Role dialog box, enter the role name and click Delete Role.

If the deletion fails, verify that all Managed Service for OpenTelemetry applications in the account have been deleted first.

FAQ

Why can't the system automatically create the AliyunServiceRoleForXtrace role for my RAM user?

The RAM user is missing the ram:CreateServiceLinkedRole permission. Attach the following policy to grant it:

{
    "Statement": [
        {
            "Action": [
                "ram:CreateServiceLinkedRole"
            ],
            "Resource": "acs:ram:*:<your-alibaba-cloud-account-id>:role/*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": [
                        "xtrace.aliyuncs.com"
                    ]
                }
            }
        }
    ],
    "Version": "1"
}

Replace <your-alibaba-cloud-account-id> with the ID of your Alibaba Cloud account.