在 Slack API 调用中使用登录 Amazon Web Services 支持 应用程序 Amazon CloudTrail - Amazon Web Services 支持
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

在 Slack API 调用中使用登录 Amazon Web Services 支持 应用程序 Amazon CloudTrail

Slack 中的 Amazon Web Services 支持 应用程序已与集成。 Amazon CloudTrail CloudTrail 提供用户、角色或 Amazon Web Services 支持 应用程序 Amazon Web Services 服务 中执行的操作的记录。要创建此记录,请将 Amazon Web Services 支持 应用程序的所有公共 API 调用 CloudTrail 捕获为事件。这些捕获的调用包括来自 Amazon Web Services 支持 应用程序控制台的调用以及对 Amazon Web Services 支持 应用程序公共 API 操作的代码调用。如果您创建了跟踪,则可以将 CloudTrail 事件持续传输到 Amazon S3 存储桶。其中包括 Amazon Web Services 支持 App 的事件。如果您未配置跟踪,您仍然可以在 CloudTrail 控制台的 “事件历史记录” 中查看最新的事件。您可以使用 CloudTrail 收集到的信息来确定是向 Amazon Web Services 支持 App 发出的请求。您还可以了解发起调用的 IP 地址、请求方、请求时间以及其他详细信息。

要了解更多信息 CloudTrail,请参阅《Amazon CloudTrail 用户指南》

Amazon Web Services 支持 中的应用程序信息 CloudTrail

当你创建自己的账户时 Amazon Web Services 账户,它会在账户 CloudTrail 上激活。当 Amazon Web Services 支持 应用程序中发生公共 API 活动时,该活动会与其他 Amazon 服务 CloudTrail 事件一起记录在事件历史记录中。您可以在中查看、搜索和下载最近发生的事件 Amazon Web Services 账户。有关更多信息,请参阅使用事件历史记录查看 CloudTrail 事件

要持续记录您的事件 Amazon Web Services 账户,包括 Amazon Web Services 支持 应用程序的事件,请创建跟踪。预设情况下,在控制台中创建跟踪记录时,此跟踪记录应用于所有 Amazon Web Services 区域。此跟踪记录在 Amazon 分区中记录所有区域中的事件,并将日志文件传送至您指定的 Simple Storage Service(Amazon S3)存储桶。此外,您可以配置其他, Amazon Web Services 服务 以进一步分析 CloudTrail 日志中收集的事件数据并对这些数据进行操作。有关更多信息,请参阅下列内容:

CloudTrail 记录所有公共 Amazon Web Services 支持 应用程序操作。这些操作也记录在 Amazon Web Services 支持 App in Slack API Reference 中。例如,调用GetAccountAliasUpdateSlackChannelConfiguration操作会在 CloudTrail 日志文件中生成条目。CreateSlackChannelConfiguration

每个事件或日志条目都包含有关生成请求的人员信息。身份信息有助于您确定以下内容:

  • 请求是使用根证书还是 Amazon Identity and Access Management (IAM) 用户凭证发出。

  • 请求是使用角色还是联合用户的临时安全凭证发出的。

  • 请求是否由其他 Amazon Web Services 服务发出。

有关更多信息,请参阅 CloudTrail userIdentity 元素

了解 Amazon Web Services 支持 应用程序日志文件条目

跟踪是一种配置,允许将事件作为日志文件传输到您指定的 Amazon S3 存储桶。 CloudTrail 日志文件包含一个或多个日志条目。事件代表来自任何来源的单个请求,包括有关请求的操作、操作的日期和时间、请求参数等的信息。 CloudTrail 日志文件不是公共 API 调用的有序堆栈跟踪。这意味着这些日志不会按任何特定顺序显示。

例 :CreateSlackChannelConfiguration 的日志示例

以下示例显示了该CreateSlackChannelConfiguration操作的 CloudTrail 日志条目。

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "AIDACKCEVSQ6C2EXAMPLE:JaneDoe", "arn": "arn:aws:sts::111122223333:assumed-role/Administrator/JaneDoe", "accountId": "111122223333", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::111122223333:role/Administrator", "accountId": "111122223333", "userName": "Administrator" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-02-26T01:37:57Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-02-26T01:48:20Z", "eventSource": "supportapp.amazonaws.com", "eventName": "CreateSlackChannelConfiguration", "awsRegion": "us-east-1", "sourceIPAddress": "205.251.233.183", "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5", "requestParameters": { "notifyOnCreateOrReopenCase": true, "teamId": "T012ABCDEFG", "notifyOnAddCorrespondenceToCase": true, "notifyOnCaseSeverity": "all", "channelName": "troubleshooting-channel", "notifyOnResolveCase": true, "channelId": "C01234A5BCD", "channelRoleArn": "arn:aws:iam::111122223333:role/AWSSupportAppRole" }, "responseElements": null, "requestID": "d06df6ca-c233-4ffb-bbff-63470c5dc255", "eventID": "0898ce29-a396-444a-899d-b068f390c361", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333", "eventCategory": "Management" }
例 :ListSlackChannelConfigurations 的日志示例

以下示例显示了该ListSlackChannelConfigurations操作的 CloudTrail 日志条目。

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "AIDACKCEVSQ6C2EXAMPLE:AWSSupportAppRole", "arn": "arn:aws:sts::111122223333:assumed-role/AWSSupportAppRole", "accountId": "111122223333", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::111122223333:role/AWSSupportAppRole", "accountId": "111122223333", "userName": "AWSSupportAppRole" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-03-01T20:06:32Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-03-01T20:06:46Z", "eventSource": "supportapp.amazonaws.com", "eventName": "ListSlackChannelConfigurations", "awsRegion": "us-east-1", "sourceIPAddress": "72.21.217.131", "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5", "requestParameters": null, "responseElements": null, "requestID": "20f81d63-31c5-4351-bd02-9eda7f76e7b8", "eventID": "70acb7fe-3f84-47cd-8c28-cc148ad06d21", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333", "eventCategory": "Management" }
例 :GetAccountAlias 的日志示例

以下示例显示了该GetAccountAlias操作的 CloudTrail 日志条目。

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "AIDACKCEVSQ6C2EXAMPLE:devdsk", "arn": "arn:aws:sts::111122223333:assumed-role/AWSSupportAppRole/devdsk", "accountId": "111122223333", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::111122223333:role/AWSSupportAppRole", "accountId": "111122223333", "userName": "AWSSupportAppRole" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-03-01T20:31:27Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-03-01T20:31:47Z", "eventSource": "supportapp.amazonaws.com", "eventName": "GetAccountAlias", "awsRegion": "us-east-1", "sourceIPAddress": "72.21.217.142", "userAgent": "aws-cli/1.3.23 Python/2.7.6 Linux/2.6.18-164.el5", "requestParameters": null, "responseElements": null, "requestID": "a225966c-0906-408b-b8dd-f246665e6758", "eventID": "79ebba8d-3285-4023-831a-64af7de8d4ad", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333", "eventCategory": "Management" }