全部产品
Search
文档中心

操作审计:通过角色SSO查询操作审计事件

更新时间:Sep 08, 2023

进行角色SSO时,通过调用AssumeRoleWithSAML接口,可以获取一个扮演该角色的临时身份。本文为您介绍通过角色SSO查询操作审计事件的示例及含义。

示例

以下示例表示北京时间2021年08月02日14:05:24,企业自有身份用户通过扮演阿里云账号159498693826****下的testrole角色来查询操作审计事件。

{
  "apiVersion": "2016-11-11",
  "requestId": "3462D6AF-4434-4690-8CAD-E54AED8B",
  "eventType": "ApiCall",
  "userIdentity": {
    "accessKeyId": "STS.NUQNP4PiGyckMsNiGELCs****",
    "sessionContext": {
      "attributes": {
        "mfaAuthenticated": "false",
        "creationDate": "2021-08-02T06:05:24Z"
      }
    },
    "accountId": "159498693826****",
    "principalId": "179432153826****:Alice@159498693826****.com",
    "type": "assumed-role",
    "userName": "testrole:Alice@159498693826****.com"
  },
  "acsRegion": "cn-shanghai",
  "eventName": "LookUpEvents",
  "requestParameters": {
    "stsTokenPrincipalName": "testrole:Alice@159498693826****.com",
    "AcsHost": "actiontrail.cn-hangzhou.aliyuncs.com",
    "ServiceCode": "actiontrail",
    "AcsProduct": "Actiontrail",
    "RequestId": "3462D6AF-4434-4690-8CAD-E54AED8B",
    "Region": "cn-hangzhou",
    "LookupAttribute.1.Value": "Write",
    "RegionId": "cn-hangzhou",
    "HostId": "actiontrail.cn-hangzhou.aliyuncs.com",
    "stsTokenPlayerUid": 10001,
    "LookupAttribute.1.Key": "EventRW"
  },
  "eventSource": "actiontrail.cn-hangzhou.aliyuncs.com",
  "serviceName": "Actiontrail",
  "eventTime": "2021-08-02T06:05:24Z",
  "userAgent": "",
  "eventId": "3462D6AF-4434-4690-8CAD-E54A****",
  "additionalEventData": {
    "Scheme": "https"
  },
  "errorCode": "",
  "errorMessage": "",
  "eventVersion": "1",
  "sourceIpAddress": "192.168.XX.XX"
}

示例中关键字段含义如下:

  • userIdentity.accountId:请求者的阿里云账号ID。取值为159498693826****,表示RAM角色的阿里云账号。

  • userIdentity.type:请求者的身份类型。取值为assumed-role,表示RAM角色。

  • userIdentity.userName:请求者的用户名。格式为{roleName}:{sessionName}roleName表示被扮演的角色名称,sessionName表示进行角色扮演时指定的名称。取值为testrole:Alice@159498693826****.com,表示被扮演的RAM角色名称是testrole,进行角色扮演时指定的名称为Alice@159498693826****.com

  • userIdentity.attributes.creationDate:事件的发生时间(UTC格式)。取值为2021-08-02T06:05:24Z,表示北京时间2021年08月02日14:05:24。