GenerateServiceLastAccessedDetails

Updated at:

Generates a permission audit report for a RAM identity to identify the permissions granted to the RAM identity and the most recent access time of the permissions.

Operation description

Before you use the permission audit feature to modify the permissions of a RAM identity, read Usage notes for permission audit.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ram:GenerateServiceLastAccessedDetails

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Arn

string

Yes

The Alibaba Cloud Resource Name (ARN) of the RAM identity for which you want to generate a permission audit report. Resource Access Management (RAM) users and regular RAM roles are supported.

Format:

  • Resource Access Management (RAM) user: acs:ram::<account_id>:user/<user_name>

  • RAM role: acs:ram::<account_id>:role/<role_name>

acs:ram::1234567890:user/test_user

Granularity

string

No

The granularity of the permission audit report. Valid values:

  • SERVICE_LEVEL: analyzes the permissions and access records of the RAM identity at the cloud service level. You can view the cloud service permissions granted to the RAM identity, the cloud services that the RAM identity has accessed, and the last access time for each cloud service. For more information about the cloud services that support service-level auditing, see Cloud services that support permission auditing.

  • ACTION_LEVEL: analyzes the permissions and access records of the RAM identity at the API operation level, which is more fine-grained than the service level. For more information about the cloud services that support operation-level auditing, see the cloud services whose Audit granularity is Operation level in Cloud services that support permission auditing.

Valid values:

  • SERVICE_LEVEL
  • ACTION_LEVEL

SERVICE_LEVEL

Response elements

Element

Type

Description

Example

object

GenerateServiceLastAccessedDetailsRespDTO

JobId

string

The ID of the permission audit task. You can use this ID to call the GetServiceLastAccessedDetails operation to query the report generation status.

ba536aab-84c6-43af-8bcb-aa2cae2a34e4

RequestId

string

The request ID.

EEE5D280-31A0-1638-91CD-37EBDD282E7A

Examples

Success response

JSON format

{
  "JobId": "ba536aab-84c6-43af-8bcb-aa2cae2a34e4",
  "RequestId": "EEE5D280-31A0-1638-91CD-37EBDD282E7A"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.Arn Arn is invalid. Invalid ARN
400 NoSuchEntity.Arn No such entity for Arn. No entity for Arn
400 InvalidParameter.Granularity Granularity is invalid. Invalid parameter Granularity
400 NotSupport.SLR Not Support SLR as ARN. SLR is not supported for parsing as an ARN
400 NotSupport.Account.Site This site not support the account. This site does not support this account.
500 InternalError Internal Error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.