本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 監控資源回收筒 AWS CloudTrail
Recycle Bin 服務已與 整合 AWS CloudTrail。 CloudTrail 是一種 服務,可提供使用者、角色或服務所採取動作的記錄 AWS 。 會將在 Recycle Bin 中執行的所有API呼叫 CloudTrail 擷取為事件。如果您建立追蹤,則可以啟用將 CloudTrail 事件持續交付至 Amazon Simple Storage Service (Amazon S3) 儲存貯體。如果您未設定追蹤,仍然可以在 事件歷史記錄 中檢視 CloudTrail 主控台中最新的管理事件。 您可以使用 所收集的資訊 CloudTrail 來判斷向資源回收筒提出的請求、提出請求的 IP 地址、提出請求的人員、提出時間,以及其他詳細資訊。
如需 的詳細資訊 CloudTrail,請參閱 AWS CloudTrail 使用者指南 。
中的資源回收筒資訊 CloudTrail
CloudTrail 當您建立 AWS 帳戶時, 會在您的帳戶上啟用。當 Recycle Bin 中發生支援的事件活動時,該活動會與 CloudTrail 事件歷史記錄 中的其他 AWS 服務事件一起記錄在事件中。您可以在 AWS 帳戶中檢視、搜尋和下載最近的事件。如需詳細資訊,請參閱檢視具有事件歷史記錄 CloudTrail 的事件。
如需 AWS 帳戶中事件的持續記錄,包括資源回收筒的事件,請建立追蹤。追蹤可讓 CloudTrail 將日誌檔案傳遞至 S3 儲存貯體。根據預設,當您在主控台中建立追蹤時,追蹤會套用至所有 AWS 區域。追蹤會記錄 AWS 分割區中所有 區域的事件,並將日誌檔案傳遞至您指定的 S3 儲存貯體。此外,您可以設定其他服務 AWS ,以進一步分析 CloudTrail 日誌中收集的事件資料並對其採取行動。如需詳細資訊,請參閱 AWS CloudTrail 使用者指南中的建立追蹤的概觀。
支援API的動作
對於資源回收筒,您可以使用 CloudTrail 將下列API動作記錄為管理事件。
-
CreateRule
-
UpdateRule
-
GetRules
-
ListRule
-
DeleteRule
-
TagResource
-
UntagResource
-
ListTagsForResource
-
LockRule
-
UnlockRule
如需記錄管理事件的詳細資訊,請參閱 CloudTrail 使用者指南 中的記錄追蹤的管理事件。
身分資訊
每一筆事件或日誌項目都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
該請求是使用根使用者還是使用者憑證提出。
-
提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。
-
該請求是否由其他 AWS 服務提出。
如需詳細資訊,請參閱 CloudTrail userIdentityElement。
了解資源回收筒日誌檔項目
追蹤是一種組態,可讓您將事件作為日誌檔案交付至您指定的 S3 儲存貯體。 CloudTrail 日誌檔案包含一或多個日誌項目。事件代表來自任何來源的單一請求,並包含所請求動作、動作日期和時間、請求參數等資訊。 CloudTrail log 檔案不是公開API呼叫的有序堆疊追蹤,因此它們不會以任何特定順序顯示。
以下是 CloudTrail 日誌項目範例。
- CreateRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-08-02T21:43:38Z" } } }, "eventTime": "2021-08-02T21:45:22Z", "eventSource": "rbin.amazonaws.com", "eventName": "CreateRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.9 Python/3.6.14 Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9", "requestParameters": { "retentionPeriod": { "retentionPeriodValue": 7, "retentionPeriodUnit": "DAYS" }, "description": "Match all snapshots", "resourceType": "EBS_SNAPSHOT" }, "responseElements": { "identifier": "jkrnexample" }, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- GetRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-08-02T21:43:38Z" } } }, "eventTime": "2021-08-02T21:45:33Z", "eventSource": "rbin.amazonaws.com", "eventName": "GetRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.9 Python/3.6.14 Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9", "requestParameters": { "identifier": "jkrnexample" }, "responseElements": null, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- ListRules
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-08-02T21:43:38Z" } } }, "eventTime": "2021-08-02T21:44:37Z", "eventSource": "rbin.amazonaws.com", "eventName": "ListRules", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.9 Python/3.6.14 Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9", "requestParameters": { "resourceTags": [ { "resourceTagKey": "test", "resourceTagValue": "test" } ] }, "responseElements": null, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- UpdateRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-08-02T21:43:38Z" } } }, "eventTime": "2021-08-02T21:46:03Z", "eventSource": "rbin.amazonaws.com", "eventName": "UpdateRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.9 Python/3.6.14 Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9", "requestParameters": { "identifier": "jkrnexample", "retentionPeriod": { "retentionPeriodValue": 365, "retentionPeriodUnit": "DAYS" }, "description": "Match all snapshots", "resourceType": "EBS_SNAPSHOT" }, "responseElements": null, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- DeleteRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-08-02T21:43:38Z" } } }, "eventTime": "2021-08-02T21:46:25Z", "eventSource": "rbin.amazonaws.com", "eventName": "DeleteRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.9 Python/3.6.14 Linux/4.9.230-0.1.ac.224.84.332.metal1.x86_64 botocore/1.21.9", "requestParameters": { "identifier": "jkrnexample" }, "responseElements": null, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- TagResource
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-10-22T21:38:34Z" } } }, "eventTime": "2021-10-22T21:43:15Z", "eventSource": "rbin.amazonaws.com", "eventName": "TagResource", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.26 Python/3.6.14 Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26", "requestParameters": { "resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234", "tags": [ { "key": "purpose", "value": "production" } ] }, "responseElements": null, "requestID": "examplee-7962-49ec-8633-795efexample", "eventID": "example4-6826-4c0a-bdec-0bab1example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- UntagResource
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-10-22T21:38:34Z" } } }, "eventTime": "2021-10-22T21:44:16Z", "eventSource": "rbin.amazonaws.com", "eventName": "UntagResource", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.26 Python/3.6.14 Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26", "requestParameters": { "resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234", "tagKeys": [ "purpose" ] }, "responseElements": null, "requestID": "example7-6c1e-4f09-9e46-bb957example", "eventID": "example6-75ff-4c94-a1cd-4d5f5example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- ListTagsForResource
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2021-10-22T21:38:34Z" } } }, "eventTime": "2021-10-22T21:42:31Z", "eventSource": "rbin.amazonaws.com", "eventName": "ListTagsForResource", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "aws-cli/1.20.26 Python/3.6.14 Linux/4.9.273-0.1.ac.226.84.332.metal1.x86_64 botocore/1.21.26", "requestParameters": { "resourceArn": "arn:aws:rbin:us-west-2:123456789012:rule/ABCDEF01234" }, "responseElements": null, "requestID": "example8-10c7-43d4-b147-3d9d9example", "eventID": "example2-24fc-4da7-a479-c9748example", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "eventCategory": "Management", "recipientAccountId": "123456789012", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- LockRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-10-25T00:45:11Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-10-25T00:45:19Z", "eventSource": "rbin.amazonaws.com", "eventName": "LockRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "python-requests/2.25.1", "requestParameters": { "identifier": "jkrnexample", "lockConfiguration": { "unlockDelay": { "unlockDelayValue": 7, "unlockDelayUnit": "DAYS" } } }, "responseElements": { "identifier": "jkrnexample", "description": "", "resourceType": "EBS_SNAPSHOT", "retentionPeriod": { "retentionPeriodValue": 7, "retentionPeriodUnit": "DAYS" }, "resourceTags": [], "status": "available", "lockConfiguration": { "unlockDelay": { "unlockDelayValue": 7, "unlockDelayUnit": "DAYS" } }, "lockState": "locked" }, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }
- UnlockRule
{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-10-25T00:45:11Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-10-25T00:46:17Z", "eventSource": "rbin.amazonaws.com", "eventName": "UnlockRule", "awsRegion": "us-west-2", "sourceIPAddress": "123.123.123.123", "userAgent": "python-requests/2.25.1", "requestParameters": { "identifier": "jkrnexample" }, "responseElements": { "identifier": "jkrnexample", "description": "", "resourceType": "EC2_IMAGE", "retentionPeriod": { "retentionPeriodValue": 7, "retentionPeriodUnit": "DAYS" }, "resourceTags": [], "status": "available", "lockConfiguration": { "unlockDelay": { "unlockDelayValue": 7, "unlockDelayUnit": "DAYS" } }, "lockState": "pending_unlock", "lockEndTime": "Nov 1, 2022, 12:46:17 AM" }, "requestID": "ex0577a5-amc4-pl4f-ef51-50fdexample", "eventID": "714fafex-2eam-42pl-913e-926d4example", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "rbin.us-west-2.amazonaws.com" } }