使用記錄 AWS Config API 呼叫 AWS CloudTrail - AWS Config

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用記錄 AWS Config API 呼叫 AWS CloudTrail

CloudTrail 擷取 AWS Config 作為事件的所有 API 呼叫。擷取的呼叫包括來自 AWS Config 主控台的呼叫和 AWS Config API 作業的程式碼呼叫。如果您建立追蹤,您可以啟用持續交付 CloudTrail 事件到 Amazon S3 儲存貯體,包括 AWS Config. 如果您未設定追蹤,您仍然可以在 [事件歷程記錄] 中檢視 CloudTrail 主控台中最近的事件。使用收集的資訊 CloudTrail,您可以判斷提出的要求 AWS Config、提出要求的 IP 位址、提出要求的人員、提出要求的時間,以及其他詳細資訊。

若要進一步了解 CloudTrail,請參閱使AWS CloudTrail 用者指南

AWS Config 信息在 CloudTrail

CloudTrail 在您創建帳戶 AWS 帳戶 時啟用。當活動發生在中時 AWS Config,該活動會與事件歷史記錄中的其他 AWS 服務 CloudTrail 事件一起記錄在事件中。您可以在您的. 中檢視、搜尋和下載最近的活動 AWS 帳戶。如需詳細資訊,請參閱檢視具有事 CloudTrail 件記錄的事件

對於您的事件的持續記錄 AWS 帳戶,包括事件 AWS Config,請創建一個跟踪。追蹤可 CloudTrail 將日誌檔交付到 Amazon S3 儲存貯體。依預設,當您在主控台中建立追蹤時,該追蹤會套用至所有的 AWS 區域。追蹤記錄來自 AWS 分區中所有區域的事件,並將日誌檔傳送到您指定的 Amazon S3 儲存貯體。此外,您還可以設定其他 AWS 服務,以進一步分析 CloudTrail 記錄中收集的事件資料並採取行動。如需詳細資訊,請參閱下列內容:

所有 AWS Config 操作均由 API 參考記錄 CloudTrail 並記錄在 AWS Config API 參考中。例如,呼叫「DeliverConfig快照」、「DeleteDelivery通道」和「通DescribeDelivery道」作業會在 CloudTrail 記錄檔中產生項目。

每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:

  • 要求是使用根使用者登入資料還是 AWS Identity and Access Management (IAM) 使用者登入資料提出。

  • 提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。

  • 請求是否由其他 AWS 服務提出。

如需詳細資訊,請參閱CloudTrail 使 userIdentity 元素

瞭解 AWS Config 記錄檔項目

追蹤是一種組態,可讓事件以日誌檔的形式傳遞到您指定的 Amazon S3 儲存貯體。 CloudTrail 記錄檔包含一或多個記錄項目。事件代表來自任何來源的單一請求,包括有關請求的操作,動作的日期和時間,請求參數等信息。 CloudTrail 日誌文件不是公共 API 調用的有序堆棧跟踪,因此它們不會以任何特定順序顯示。

範例日誌檔案

如需 CloudTrail 記錄項目的範例,請參閱下列主題。

DeleteDeliveryChannel

以下是「DeleteDelivery通道」作業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:32:57Z", "eventSource": "config.amazonaws.com", "eventName": "DeleteDeliveryChannel", "awsRegion": "us-west-2", "sourceIPAddress": "10.24.34.0", "userAgent": "aws-internal/3", "requestParameters": { "deliveryChannelName": "default" }, "responseElements": null, "requestID": "207d695a-8164-11e4-ab4f-657c7ab282ab", "eventID": "5dcff7a9-e414-411a-a43e-88d122a0ad4a", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
DeliverConfigSnapshot

以下是DeliverConfig快照作業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "AssumedRole", "principalId": "AIDAABCDEFGHIJKLNMOPQ:Config-API-Test", "arn": "arn:aws:sts::111111111111:assumed-role/JaneDoe/Config-API-Test", "accountId": "111111111111", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2014-12-11T00:58:42Z" }, "sessionIssuer": { "type": "Role", "principalId": "AIDAABCDEFGHIJKLNMOPQ", "arn": "arn:aws:iam::111111111111:role/JaneDoe", "accountId": "111111111111", "userName": "JaneDoe" } } }, "eventTime": "2014-12-11T00:58:53Z", "eventSource": "config.amazonaws.com", "eventName": "DeliverConfigSnapshot", "awsRegion": "us-west-2", "sourceIPAddress": "10.24.34.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "deliveryChannelName": "default" }, "responseElements": { "configSnapshotId": "58d50f10-212d-4fa4-842e-97c614da67ce" }, "requestID": "e0248561-80d0-11e4-9f1c-7739d36a3df2", "eventID": "3e88076c-eae1-4aa6-8990-86fe52aedbd8", "eventType": "AwsApiCall", recipientAccountId": "111111111111" }
DescribeConfigurationRecorderStatus

以下是作DescribeConfigurationRecorderStatus業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:35:44Z", "eventSource": "config.amazonaws.com", "eventName": "DescribeConfigurationRecorderStatus", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": null, "responseElements": null, "requestID": "8442f25d-8164-11e4-ab4f-657c7ab282ab", "eventID": "a675b36b-455f-4e18-a4bc-d3e01749d3f1", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
DescribeConfigurationRecorders

以下是「 CloudTrail 記錄器」作業的範例DescribeConfiguration記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:34:52Z", "eventSource": "config.amazonaws.com", "eventName": "DescribeConfigurationRecorders", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": null, "responseElements": null, "requestID": "6566b55c-8164-11e4-ab4f-657c7ab282ab", "eventID": "6259a9ad-889e-423b-beeb-6e1eec84a8b5", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
DescribeDeliveryChannels

以下是「DescribeDelivery通道」作業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:35:02Z", "eventSource": "config.amazonaws.com", "eventName": "DescribeDeliveryChannels", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": null, "responseElements": null, "requestID": "6b6aee3f-8164-11e4-ab4f-657c7ab282ab", "eventID": "3e15ebc5-bf39-4d2a-8b64-9392807985f1", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
GetResourceConfigHistory

以下是作GetResourceConfigHistory業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "AssumedRole", "principalId": "AIDAABCDEFGHIJKLNMOPQ:Config-API-Test", "arn": "arn:aws:sts::111111111111:assumed-role/JaneDoe/Config-API-Test", "accountId": "111111111111", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2014-12-11T00:58:42Z" }, "sessionIssuer": { "type": "Role", "principalId": "AIDAABCDEFGHIJKLNMOPQ", "arn": "arn:aws:iam::111111111111:role/JaneDoe", "accountId": "111111111111", "userName": "JaneDoe" } } }, "eventTime": "2014-12-11T00:58:42Z", "eventSource": "config.amazonaws.com", "eventName": "GetResourceConfigHistory", "awsRegion": "us-west-2", "sourceIPAddress": "10.24.34.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "resourceId": "vpc-a12bc345", "resourceType": "AWS::EC2::VPC", "limit": 0, "laterTime": "Dec 11, 2014 12:58:42 AM", "earlierTime": "Dec 10, 2014 4:58:42 PM" }, "responseElements": null, "requestID": "d9f3490d-80d0-11e4-9f1c-7739d36a3df2", "eventID": "ba9c1766-d28f-40e3-b4c6-3ffb87dd6166", "eventType": "AwsApiCall", "recipientAccountId": "111111111111" }
PutConfigurationRecorder

以下是「錄製程式」作業的範例 CloudTrail 記PutConfiguration錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:35:23Z", "eventSource": "config.amazonaws.com", "eventName": "PutConfigurationRecorder", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "configurationRecorder": { "name": "default", "roleARN": "arn:aws:iam::222222222222:role/config-role-pdx" } }, "responseElements": null, "requestID": "779f7917-8164-11e4-ab4f-657c7ab282ab", "eventID": "c91f3daa-96e8-44ee-8ddd-146ac06565a7", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
PutDeliveryChannel

以下是「PutDelivery通道」作業的範例 CloudTrail 記錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:33:08Z", "eventSource": "config.amazonaws.com", "eventName": "PutDeliveryChannel", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "deliveryChannel": { "name": "default", "s3BucketName": "config-api-test-pdx", "snsTopicARN": "arn:aws:sns:us-west-2:222222222222:config-api-test-pdx" } }, "responseElements": null, "requestID": "268b8d4d-8164-11e4-ab4f-657c7ab282ab", "eventID": "b2db05f1-1c73-4e52-b238-db69c04e8dd4", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
StartConfigurationRecorder

以下是「錄製程式」作業的範例 CloudTrail 記StartConfiguration錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:35:34Z", "eventSource": "config.amazonaws.com", "eventName": "StartConfigurationRecorder", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "configurationRecorderName": "default" }, "responseElements": null, "requestID": "7e03fa6a-8164-11e4-ab4f-657c7ab282ab", "eventID": "55a5507f-f306-4896-afe3-196dc078a88d", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }
StopConfigurationRecorder

以下是「錄製程式」作業的範例 CloudTrail 記StopConfiguration錄檔。

{ "eventVersion": "1.02", "userIdentity": { "type": "IAMUser", "principalId": "AIDACKCEVSQ6C2EXAMPLE", "arn": "arn:aws:iam::222222222222:user/JohnDoe", "accountId": "222222222222", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "userName": "JohnDoe" }, "eventTime": "2014-12-11T18:35:13Z", "eventSource": "config.amazonaws.com", "eventName": "StopConfigurationRecorder", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "aws-cli/1.2.11 Python/2.7.4 Linux/2.6.18-164.el5", "requestParameters": { "configurationRecorderName": "default" }, "responseElements": null, "requestID": "716deea3-8164-11e4-ab4f-657c7ab282ab", "eventID": "6225a85d-1e49-41e9-bf43-3cfc5549e560", "eventType": "AwsApiCall", "recipientAccountId": "222222222222" }