本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用 記錄 AWS Backup API通話 CloudTrail
AWS Backup 與 AWS CloudTrail 服務整合,該服務提供使用者、角色或服務所採取動作的記錄 AWS 服務 。 會將 的所有API呼叫 CloudTrail 擷取 AWS Backup 為事件。擷取的呼叫包括來自 AWS Backup 主控台的呼叫,以及對 操作的 AWS Backup API程式碼呼叫。使用 所收集的資訊 CloudTrail,您可以判斷對 提出的請求 AWS Backup、提出請求的 IP 地址、提出的時間,以及其他詳細資訊。
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
該請求是使用根使用者還是使用者憑證提出。
-
是否代表 IAM Identity Center 使用者提出請求。
-
提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。
-
該請求是否由另一項 AWS 服務服務提出。
CloudTrail 當您建立 帳戶 AWS 帳戶 時, 會在 中處於作用中狀態,而且您會自動存取 CloudTrail 事件歷史記錄 。 CloudTrail 事件歷史記錄提供過去 90 天 中記錄的管理事件的可檢視、可搜尋、可下載和不可變記錄 AWS 區域。如需詳細資訊,請參閱 AWS CloudTrail 使用者指南 中的使用 CloudTrail 事件歷史記錄。檢視事件歷史記錄 不 CloudTrail收取任何費用。
如需 AWS 帳戶 過去 90 天內事件的持續記錄,請建立追蹤或 CloudTrail Lake 事件資料存放區。
- CloudTrail 追蹤
-
追蹤可讓 CloudTrail 將日誌檔案傳遞至 Amazon S3 儲存貯體。使用 建立的所有追蹤 AWS Management Console 都是多區域。您可以使用 建立單一區域或多區域追蹤 AWS CLI。建議您建立多區域追蹤,因為您擷取帳戶中所有 AWS 區域 中的活動。如果您建立單一區域追蹤,您只能檢視記錄於追蹤 的事件 AWS 區域。如需追蹤的詳細資訊,請參閱 AWS CloudTrail 使用者指南 中的為您的 建立追蹤 AWS 帳戶和為組織建立追蹤。
您可以透過建立追蹤 CloudTrail ,免費將一份正在進行的管理事件副本交付至您的 Amazon S3 儲存貯體,但需要支付 Amazon S3 儲存費用。如需 CloudTrail 定價的詳細資訊,請參閱AWS CloudTrail 定價。
如需 Amazon S3 定價的相關資訊,請參閱 Amazon S3 定價 。 - CloudTrail Lake 事件資料存放區
-
CloudTrail Lake 可讓您在事件上執行SQL以 為基礎的查詢。 CloudTrail Lake 會以資料列為基礎的JSON格式將現有事件轉換為 Apache ORC
格式。ORC 是一種欄式儲存格式,已針對快速擷取資料進行最佳化。系統會將事件彙總到事件資料存放區中,事件資料存放區是事件的不可變集合,其依據為您透過套用進階事件選取器選取的條件。套用於事件資料存放區的選取器控制哪些事件持續存在並可供您查詢。如需 CloudTrail Lake 的詳細資訊,請參閱 AWS CloudTrail 使用者指南 中的使用 AWS CloudTrail Lake。 CloudTrail Lake 事件資料存放區和查詢會產生成本。建立事件資料存放區時,您可以選擇要用於事件資料存放區的定價選項。此定價選項將決定擷取和儲存事件的成本,以及事件資料存放區的預設和最長保留期。如需 CloudTrail 定價的詳細資訊,請參閱AWS CloudTrail 定價。
AWS Backup 中的事件 CloudTrail
AWS Backup 會在執行備份、還原、複製或通知時產生這些 CloudTrail 事件。這些事件不一定是使用 AWS Backup 公有 產生的APIs。如需詳細資訊,請參閱 AWS CloudTrail 使用者指南 中的AWS 服務 事件。
-
BackupDeleted
-
BackupJobCompleted
-
BackupJobStarted
-
BackupSelectionDeletedDueToSLRDeletion
-
BackupTransitionedToCold
-
CopyJobCompleted
-
CopyJobStarted
-
ReportJobCompleted
-
ReportJobStarted
-
RestoreCompleted
-
RestoreStarted
-
PutBackupVaultNotifications
了解 AWS Backup 日誌檔案項目
追蹤是一種組態,可讓您將事件作為日誌檔案交付至您指定的 Amazon S3 儲存貯體。 CloudTrail 日誌檔案包含一或多個日誌項目。事件代表來自任何來源的單一請求,並包含所請求動作、動作日期和時間、請求參數等資訊。 CloudTrail log 檔案不是公開API呼叫的有序堆疊追蹤,因此它們不會以任何特定順序顯示。
下列範例顯示 CloudTrail 日誌項目,其中示範 StartBackupJob
、 StartRestoreJob
和 DeleteRecoveryPoint
動作,以及 BackupJobCompleted
事件。
{ "eventVersion": "1.05", "userIdentity": { "type": "Root", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2019-01-10T12:24:50Z" } } }, "eventTime": "2019-01-10T13:45:24Z", "eventSource": "backup.amazonaws.com", "eventName": "StartBackupJob", "awsRegion": "us-east-1", "sourceIPAddress": "12.34.567.89", "userAgent": "aws-internal/3 aws-sdk-java/1.11.465 Linux/4.9.124-0.1.ac.198.73.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.192-b12 java/1.8.0_192", "requestParameters": { "backupVaultName": "Default", "resourceArn": "arn:aws:ec2:us-east-1:123456789012:volume/vol-00a422a05b9c6asd3", "iamRoleArn": "arn:aws:iam::123456789012:role/AWSBackup", "startWindowMinutes": 60 }, "responseElements": { "backupJobId": "8a3c2a87-b23e-4d56-b045-fa9e88ede4e6", "creationDate": "Jan 10, 2019 1:45:24 PM" }, "requestID": "98cf4d59-8c76-49f7-9201-790743931234", "eventID": "fe8146a5-7812-4a95-90ad-074498be1234", "eventType": "AwsApiCall", "recipientAccountId": "account-id" }, { "eventVersion": "1.05", "userIdentity": { "type": "Root", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2019-01-10T12:24:50Z" } } }, "eventTime": "2019-01-10T13:49:50Z", "eventSource": "backup.amazonaws.com", "eventName": "StartRestoreJob", "awsRegion": "us-east-1", "sourceIPAddress": "12.34.567.89", "userAgent": "aws-internal/3 aws-sdk-java/1.11.465 Linux/4.9.124-0.1.ac.198.73.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.192-b12 java/1.8.0_192", "requestParameters": { "recoveryPointArn": "arn:aws:ec2:us-east-1::snapshot/snap-00a129455bdbc9d99", "metadata": { "volumeType": "gp2", "availabilityZone": "us-east-1b", "volumeSize": "100" }, "iamRoleArn": "arn:aws:iam::123456789012:role/AWSBackup", "idempotencyToken": "a9c8b4fb-d369-4a58-944b-942e442a8fe3", "resourceType": "EBS" }, "responseElements": { "restoreJobId": "9808E090-8C76-CCB8-4CEA-407CF6AC4C43" }, "requestID": "783ddddc-6d7e-4539-8fab-376aa9668543", "eventID": "ff35ddea-7577-4aec-a132-964b7e9dd423", "eventType": "AwsApiCall", "recipientAccountId": "account-id" }, { "eventVersion": "1.05", "userIdentity": { "type": "Root", "principalId": "123456789012", "arn": "arn:aws:iam::123456789012:root", "accountId": "123456789012", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2019-01-10T12:24:50Z" } } }, "eventTime": "2019-01-10T14:52:42Z", "eventSource": "backup.amazonaws.com", "eventName": "DeleteRecoveryPoint", "awsRegion": "us-east-1", "sourceIPAddress": "12.34.567.89", "userAgent": "aws-internal/3 aws-sdk-java/1.11.465 Linux/4.9.124-0.1.ac.198.73.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.192-b12 java/1.8.0_192", "requestParameters": { "backupVaultName": "Default", "recoveryPointArn": "arn:aws:ec2:us-east-1::snapshot/snap-05f426fd9daab3433" }, "responseElements": null, "requestID": "f1f1b33a-48da-436c-9a8f-7574f1ab5fd7", "eventID": "2dd70080-5aba-4a79-9a0f-92647c9f0846", "eventType": "AwsApiCall", "recipientAccountId": "account-id" }, { "eventVersion": "1.05", "userIdentity": { "accountId": "123456789012", "invokedBy": "backup.amazonaws.com" }, "eventTime": "2019-01-10T08:24:39Z", "eventSource": "backup.amazonaws.com", "eventName": "BackupJobCompleted", "awsRegion": "us-east-1", "sourceIPAddress": "backup.amazonaws.com", "userAgent": "backup.amazonaws.com", "requestParameters": null, "responseElements": null, "eventID": "2e7e4fcf-0c52-467f-9fd0-f61c2fcf7d17", "eventType": "AwsServiceEvent", "recipientAccountId": "account-id", "serviceEventDetails": { "completionDate": { "seconds": 1547108091, "nanos": 906000000 }, "state": "COMPLETED", "percentDone": 100, "backupJobId": "8A8E738B-A8C5-E058-8224-90FA323A3C0E", "backupVaultName": "BackupVault", "backupVaultArn": "arn:aws:backup:us-east-1:123456789012:backup-vault:BackupVault", "recoveryPointArn": "arn:aws:ec2:us-east-1::snapshot/snap-07ce8c3141d361233", "resourceArn": "arn:aws:ec2:us-east-1:123456789012:volume/vol-06692095a6a421233", "creationDate": { "seconds": 1547101638, "nanos": 272000000 }, "backupSizeInBytes": 8589934592, "iamRoleArn": "arn:aws:iam::123456789012:role/AWSBackup", "resourceType": "EBS" } }
記錄跨帳戶管理事件
使用 AWS Backup,您可以管理AWS Organizations結構 AWS 帳戶 內所有備份。當您建立、更新或刪除 AWS Organizations 備份政策 (將備份計畫套用至您的成員帳戶) 時,或組織備份計畫無效時, 會在您的成員帳戶中 AWS Backup 產生這些 CloudTrail 事件:
-
CreateOrganizationalBackupPlan
-
UpdateOrganizationalBackupPlan
-
DeleteOrganizationalBackupPlan
-
InvalidOrganizationBackupPlan
範例:跨帳戶管理的 AWS Backup 日誌檔案項目
追蹤是一種組態,可讓您將事件作為日誌檔案交付至您指定的 Amazon S3 儲存貯體。 CloudTrail 日誌檔案包含一或多個日誌項目。事件代表來自任何來源的單一請求,並包含所請求動作、動作日期和時間、請求參數等資訊。 CloudTrail log 檔案不是公開API呼叫的有序堆疊追蹤,因此它們不會以任何特定順序顯示。
下列範例顯示示範 CreateOrganizationalBackupPlan
動作的 CloudTrail 日誌項目。
{ "eventVersion": "1.05", "userIdentity": { "accountId": "123456789012", "invokedBy": "backup.amazonaws.com"}, "eventTime": "2020-06-02T00:34:00Z", "eventSource": "backup.amazonaws.com", "eventName": "CreateOrganizationalBackupPlan", "awsRegion": "ca-central-1", "sourceIPAddress": "backup.amazonaws.com", "userAgent": "backup.amazonaws.com", "requestParameters": null, "responseElements": null, "eventID": "f2642255-af77-4203-8c37-7ca19d898e84", "readOnly": false, "eventType": "AwsServiceEvent", "recipientAccountId": "account-id", "serviceEventDetails": { "backupPlanId": "orgs/544033d1-b19c-3f2a-9c20-40bcfa82ca68", "backupPlanVersionId": "ZTA1Y2ZjZDYtNmRjMy00ZTA1LWIyNTAtM2M1NzQ4OThmNzRj", "backupPlanArn": "arn:aws:backup:ca-central-1:123456789012:backup-plan:orgs/544033d1-b19c-3f2a-9c20-40bcfa82ca68", "backupPlanName": "mybackupplan", "backupRules": "[{\"id\":\"745fd0ea-7f57-3f35-8a0e-ed4b8c48a8e2\",\"name\":\"hourly\",\"description\":null,\"cryopodArn\":\"arn:aws:backup:ca-central-1:123456789012:backup-vault:ControllerCAMTestBackupVault\",\"scheduleExpression\":\"cron(0 0/1 ? * * *)\",\"startWindow\":\"PT1H\",\"completionWindow\":\"PT2H\",\"lifecycle\":{\"moveToColdStorageAfterDays\":null,\"deleteAfterDays\":\"7\"},\"tags\":null,\"copyActions\":[]}]", "backupSelections": "[{\"name\":\"selectiondatatype\",\"arn\":\"arn:aws:backup:ca-central-1:123456789012:selection:8b40c6d9-3641-3d49-926d-a075ea715686\",\"role\":\"arn:aws:iam::123456789012:role/OrganizationmyRoleTestRole\",\"resources\":[],\"notResources\":[],\"conditions\":[{\"type\":\"STRINGEQUALS\",\"key\":\"dataType\",\"value\":\"PII\"},{\"type\":\"STRINGEQUALS\",\"key\":\"dataType\",\"value\":\"RED\"}],\"creationDate\":\"2020-06-02T00:34:00.695Z\",\"creatorRequestId\":null}]", "creationDate": { "seconds": 1591058040, "nanos": 695000000 }, "organizationId": "org-id", "accountId": "123456789012" } }
下列範例顯示示範 DeleteOrganizationalBackupPlan
動作的 CloudTrail 日誌項目。
{ "eventVersion": "1.05", "userIdentity": { "accountId": "123456789012", "invokedBy": "backup.amazonaws.com" }, "eventTime": "2020-06-02T00:34:25Z", "eventSource": "backup.amazonaws.com", "eventName": "DeleteOrganizationalBackupPlan", "awsRegion": "ca-central-1", "sourceIPAddress": "backup.amazonaws.com", "userAgent": "backup.amazonaws.com", "requestParameters": null, "responseElements": null, "eventID": "5ce66cd0-b90c-4957-8e00-96ea1077b4fa", "readOnly": false, "eventType": "AwsServiceEvent", "recipientAccountId": "account-id", "serviceEventDetails": { "backupPlanId": "orgs/544033d1-b19c-3f2a-9c20-40bcfa82ca68", "backupPlanVersionId": "ZTA1Y2ZjZDYtNmRjMy00ZTA1LWIyNTAtM2M1NzQ4OThmNzRj", "backupPlanArn": "arn:aws:backup:ca-central-1:123456789012:backup-plan:orgs/544033d1-b19c-3f2a-9c20-40bcfa82ca68", "backupPlanName": "mybackupplan", "deletionDate": { "seconds": 1591058065, "nanos": 519000000 }, "organizationId": "org-id", "accountId": "123456789012" } }
下列範例顯示一個 CloudTrail 日誌項目,示範事件 InvalidOrganizationBackupPlan
,當 從 Organizations AWS Backup 收到無效的備份計劃時傳送。
{ "eventVersion": "1.08", "userIdentity": { "accountId": "123456789012", "invokedBy": "backup.amazonaws.com" }, "eventTime": "2022-06-11T13:29:23Z", "eventSource": "backup.amazonaws.com", "eventName": "InvalidOrganizationBackupPlan", "awsRegion": "Region", "sourceIPAddress": "backup.amazonaws.com", "userAgent": "backup.amazonaws.com", "requestParameters": null, "responseElements": null, "eventID": "ab1de234-fg56-7890-h123-45ij678k9l01", "readOnly": false, "eventType": "AwsServiceEvent", "managementEvent": true, "recipientAccountId": "987654321098", "serviceEventDetails": { "effectivePolicyVersion": 7, "effectivePolicyId": "12345678-a9b0-123c-45d6-78e901f23456", "lastUpdatedTimestamp": "Jun 11, 2022 1:29:22 PM", "policyType": "BACKUP_POLICY", "effectiveBackupPlan": { "logicalName": "logical-name", "regions": [ "Region" ], "rules": [ { "name": "test-orgs", "targetBackupVaultName": "vault-name", "ruleLifecycle": { "deleteAfterDays": 100 }, "copyActions": [], "enableContinuousBackup": true } ], "selections": { "tagSelections": [ { "selectionName": "selection-name", "iamRoleArn": "arn:aws:iam::$account:role/role", "targetedTags": [ { "tagKey": "key", "tagValue": "value" } ] } ] }, "backupPlanTags": { "key": "value" } }, "organizationId": "org-id", "accountId": "123456789012" }, "eventCategory": "Management" }