本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
記錄 Amazon 路線 53 API 呼叫 AWS CloudTrail
Route 53 與這項服務整合 AWS CloudTrail,可提供 Route 53 中使用者、角色或服務所採取之動作記錄的 AWS 服務。CloudTrail 會將 Route 53 的所有API呼叫擷取為事件,包括來自 Route 53 主控台的呼叫,以及從 Route 53 的程式碼呼叫APIs。如果您建立追蹤,您可以啟用持續交付 CloudTrail 事件到 Amazon S3 儲存貯體,包括 Route 53 的事件。如果您未設定追蹤,您仍然可以在 [事件歷程記錄] 中檢視 CloudTrail 主控台中最近的事件。使用收集的資訊 CloudTrail,您可以判斷向 Route 53 提出的要求、提出要求的來源 IP 位址、提出要求的人員、提出要求的時間以及其他詳細資訊。
53 號路線資訊 CloudTrail
CloudTrail 在您創建 AWS 帳戶時,您的帳戶已啟用。當活動在 Route 53 中發生時,該活動會與CloudTrail 事件歷史記錄中的其他 AWS 服務事件一起記錄在事件中。您可以在帳戶中查看,搜索和下載最近的事 AWS 件。如需詳細資訊,請參閱使用 CloudTrail 事件歷程記錄檢視事件。
如需 AWS 帳戶中持續記錄事件 (包括 Route 53 的事件),請建立追蹤。追蹤可 CloudTrail 將日誌檔交付到 Amazon S3 儲存貯體。根據預設,當您在主控台建立權杖時,權杖會套用到所有區域。追蹤記錄來自 AWS 分區中所有區域的事件,並將日誌檔傳送到您指定的 Amazon S3 儲存貯體。此外,您還可以設定其他 AWS 服務,以進一步分析 CloudTrail 記錄中收集的事件資料並採取行動。如需詳細資訊,請參閱:
所有 Route 53 動作都由記錄下來, CloudTrail 並記錄在 Amazon 路線 53 API 參考中。例如,呼叫CreateHostedZone
CreateHealthCheck
、和RegisterDomain
動作會在 CloudTrail 記錄檔中產生項目。
每一筆事件或日誌專案都會包含產生請求者的資訊。身分資訊可協助您判斷下列事項:
-
要求是使用根憑證還是IAM使用者認證提出。
-
提出該請求時,是否使用了特定角色或聯合身分使用者的暫時安全憑證。
-
請求是否由其他 AWS 服務提出。
如需詳細資訊,請參閱CloudTrail userIdentity 元素。
檢視事件歷史記錄中的 Route 53 事件
CloudTrail 可讓您在事件歷史記錄中檢視最近的事件。若要檢視 Route 53 API 要求的事件,您必須在主控台頂端的區域選取器中選擇美國東部 (維吉尼亞北部)。如需詳細資訊,請參閱AWS CloudTrail 使用指南中的檢視具有 CloudTrail 事件歷程記錄的事件。
了解 Route 53 日誌檔案項目
追蹤是一種組態,可讓事件以日誌檔的形式傳遞到您指定的 Amazon S3 儲存貯體。 CloudTrail 記錄檔包含一或多個記錄項目。事件代表來自任何來源的單一請求,包括有關請求的操作,動作的日期和時間,請求參數等信息。 CloudTrail 日誌文件不是公共API調用的有序堆棧跟踪,因此它們不會以任何特定順序顯示。
eventName
元素會識別發生的動作。(在 CloudTrail 記錄檔中,網域註冊動作的第一個字母為小寫,即使其在動作名稱中為大寫。 例如,UpdateDomainContact
顯示為updateDomainContact
在日誌中)。 CloudTrail 支援所有「路線 53API」動作。下列範例顯示示範下列動作的 CloudTrail 記錄項目:
列出與 AWS 帳戶關聯的託管區域
建立運作狀態檢查
建立 2 筆記錄
刪除託管區域
更新已註冊網域的資訊
建立 Route 53 Resolver 傳出端點
{ "Records": [ { "apiVersion": "2013-04-01", "awsRegion": "us-east-1", "eventID": "1cdbea14-e162-43bb-8853-f9f86d4739ca", "eventName": "ListHostedZones", "eventSource": "route53.amazonaws.com", "eventTime": "2015-01-16T00:41:48Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "444455556666", "requestID": "741e0df7-9d18-11e4-b752-f9c6311f3510", "requestParameters": null, "responseElements": null, "sourceIPAddress": "192.0.2.92", "userAgent": "Apache-HttpClient/4.3 (java 1.5)", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "111122223333", "arn": "arn:aws:iam::111122223333:user/smithj", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "smithj" } }, { "apiVersion": "2013-04-01", "awsRegion": "us-east-1", "eventID": "45ec906a-1325-4f61-b133-3ef1012b0cbc", "eventName": "CreateHealthCheck", "eventSource": "route53.amazonaws.com", "eventTime": "2018-01-16T00:41:57Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "444455556666", "requestID": "79915168-9d18-11e4-b752-f9c6311f3510", "requestParameters": { "callerReference": "2014-05-06 64832", "healthCheckConfig": { "iPAddress": "192.0.2.249", "port": 80, "type": "TCP" } }, "responseElements": { "healthCheck": { "callerReference": "2014-05-06 64847", "healthCheckConfig": { "failureThreshold": 3, "iPAddress": "192.0.2.249", "port": 80, "requestInterval": 30, "type": "TCP" }, "healthCheckVersion": 1, "id": "b3c9cbc6-cd18-43bc-93f8-9e557example" }, "location": "https://route53.amazonaws.com/2013-04-01/healthcheck/b3c9cbc6-cd18-43bc-93f8-9e557example" }, "sourceIPAddress": "192.0.2.92", "userAgent": "Apache-HttpClient/4.3 (java 1.5)", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "111122223333", "arn": "arn:aws:iam::111122223333:user/smithj", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "smithj" } }, { "additionalEventData": { "Note": "Do not use to reconstruct hosted zone" }, "apiVersion": "2013-04-01", "awsRegion": "us-east-1", "eventID": "883b14d9-2f84-4005-8bc5-c7bf0cebc116", "eventName": "ChangeResourceRecordSets", "eventSource": "route53.amazonaws.com", "eventTime": "2018-01-16T00:41:43Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "444455556666", "requestID": "7081d4c6-9d18-11e4-b752-f9c6311f3510", "requestParameters": { "changeBatch": { "changes": [ { "action": "CREATE", "resourceRecordSet": { "name": "prod.example.com.", "resourceRecords": [ { "value": "192.0.1.1" }, { "value": "192.0.1.2" }, { "value": "192.0.1.3" }, { "value": "192.0.1.4" } ], "tTL": 300, "type": "A" } }, { "action": "CREATE", "resourceRecordSet": { "name": "test.example.com.", "resourceRecords": [ { "value": "192.0.1.1" }, { "value": "192.0.1.2" }, { "value": "192.0.1.3" }, { "value": "192.0.1.4" } ], "tTL": 300, "type": "A" } } ], "comment": "Adding subdomains" }, "hostedZoneId": "Z1PA6795UKMFR9" }, "responseElements": { "changeInfo": { "comment": "Adding subdomains", "id": "/change/C156SRE0X2ZB10", "status": "PENDING", "submittedAt": "Jan 16, 2018 12:41:43 AM" } }, "sourceIPAddress": "192.0.2.92", "userAgent": "Apache-HttpClient/4.3 (java 1.5)", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "111122223333", "arn": "arn:aws:iam::111122223333:user/smithj", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "smithj" } }, { "apiVersion": "2013-04-01", "awsRegion": "us-east-1", "eventID": "0cb87544-ebee-40a9-9812-e9dda1962cb2", "eventName": "DeleteHostedZone", "eventSource": "route53.amazonaws.com", "eventTime": "2018-01-16T00:41:37Z", "eventType": "AwsApiCall", "eventVersion": "1.02", "recipientAccountId": "444455556666", "requestID": "6d5d149f-9d18-11e4-b752-f9c6311f3510", "requestParameters": { "id": "Z1PA6795UKMFR9" }, "responseElements": { "changeInfo": { "id": "/change/C1SIJYUYIKVJWP", "status": "PENDING", "submittedAt": "Jan 16, 2018 12:41:36 AM" } }, "sourceIPAddress": "192.0.2.92", "userAgent": "Apache-HttpClient/4.3 (java 1.5)", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "accountId": "111122223333", "arn": "arn:aws:iam::111122223333:user/smithj", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "type": "IAMUser", "userName": "smithj" } }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "smithj", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-01T19:43:59Z" } }, "invokedBy": "test" }, "eventTime": "2018-11-01T19:49:36Z", "eventSource": "route53domains.amazonaws.com", "eventName": "updateDomainContact", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.92", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0", "requestParameters": { "domainName": { "name": "example.com" } }, "responseElements": { "requestId": "034e222b-a3d5-4bec-8ff9-35877ff02187" }, "additionalEventData": "Personally-identifying contact information is not logged in the request", "requestID": "015b7313-bf3d-11e7-af12-cf75409087f6", "eventID": "f34f3338-aaf4-446f-bf0e-f72323bac94d", "eventType": "AwsApiCall", "recipientAccountId": "444455556666" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-01T14:33:09Z" }, "sessionIssuer": { "type": "Role", "principalId": "AROAIUZEZLWWZOEXAMPLE", "arn": "arn:aws:iam::123456789012:role/Admin", "accountId": "123456789012", "userName": "Admin" } } }, "eventTime": "2018-11-01T14:37:19Z", "eventSource": "route53resolver.amazonaws.com", "eventName": "CreateResolverEndpoint", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.176", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0", "requestParameters": { "creatorRequestId": "123456789012", "name": "OutboundEndpointDemo", "securityGroupIds": [ "sg-05618b249example" ], "direction": "OUTBOUND", "ipAddresses": [ { "subnetId": "subnet-01cb0c4676example" }, { "subnetId": "subnet-0534819b32example" } ], "tags": [] }, "responseElements": { "resolverEndpoint": { "id": "rslvr-out-1f4031f1f5example", "creatorRequestId": "123456789012", "arn": "arn:aws:route53resolver:us-west-2:123456789012:resolver-endpoint/rslvr-out-1f4031f1f5example", "name": "OutboundEndpointDemo", "securityGroupIds": [ "sg-05618b249example" ], "direction": "OUTBOUND", "ipAddressCount": 2, "hostVPCId": "vpc-0de29124example", "status": "CREATING", "statusMessage": "[Trace id: 1-5bd1d51e-f2f3032eb75649f71example] Creating the Resolver Endpoint", "creationTime": "2018-11-01T14:37:19.045Z", "modificationTime": "2018-11-01T14:37:19.045Z" } }, "requestID": "3f066d98-773f-4628-9cba-4ba6eexample", "eventID": "cb05b4f9-9411-4507-813b-33cb0example", "eventType": "AwsApiCall", "recipientAccountId": "123456789012" } ] }