本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
使用记录亚马逊 Route 53 API 调用 AWS CloudTrail
Route 53 集成了 AWS CloudTrail,一项提供用户、角色或某人所采取操作记录的服务 AWS 在 53 号公路上服务。 CloudTrail 将 Route 53 的所有 API 调用捕获为事件,包括来自 Route 53 控制台的调用以及从 Route 53 API 的代码调用。如果您创建跟踪,则可以启用持续交付 CloudTrail 向 Amazon S3 存储桶发送事件,包括 Route 53 的事件。如果您未配置跟踪,仍可以在中查看最新事件 CloudTrail 控制台输入 事件历史。使用收集的信息 CloudTrail,您可以确定向 Route 53 发出的请求、发出请求的 IP 地址、谁提出了请求、何时提出请求以及其他详细信息。
53 号公路中的信息 CloudTrail
CloudTrail 已在您的上启用 AWS 创建账户时的账户。当活动发生在 Route 53 中时,该活动将记录在 CloudTrail 活动以及其他 AWS 中的服务事件 事件历史。您可以在您的网站上查看、搜索和下载最近的事件 AWS 账户。有关更多信息,请参阅 使用以下方式查看活动 CloudTrail 事件历史。
为了持续记录您的事件 AWS 账号(包括 Route 53 的事件)可创建路径。跟踪启用 CloudTrail 将日志文件传输到亚马逊 S3 存储桶。默认情况下,在控制台中创建跟踪记录时,此跟踪记录应用于所有区域。该跟踪记录了来自所有区域的事件 AWS 将日志文件分区并传输到您指定的 Amazon S3 存储桶。此外,你可以配置其他 AWS 服务,用于进一步分析中收集的事件数据并采取行动 CloudTrail 日志。有关更多信息,请参阅:
所有 Route 53 操作均由记录 CloudTrail 并记录在 亚马逊 Route 53 API 参考。例如,致电 CreateHostedZone, CreateHealthCheck,以及 RegisterDomain 操作在中生成条目 CloudTrail 日志文件。
每个事件或日志条目都包含有关生成请求的人员信息。身份信息可帮助您确定以下内容:
-
请求是使用根用户凭证还是 IAM 用户凭证发出的。
-
请求是使用角色还是联合用户的临时安全凭证发出的。
-
请求是否由其他人提出 AWS 服务。
有关更多信息,请参阅 CloudTrail userIdentity 元素。
在事件历史记录中查看 Route 53 事件
CloudTrail 允许您查看最近发生的事件 事件历史。要查看 Route 53 API 请求的事件,必须选择 美国东部(弗吉尼亚北部) 在控制台顶部的区域选择器中。有关更多信息,请参阅 使用以下方式查看活动 CloudTrail 事件历史 在 AWS CloudTrail 用户指南。
了解 Route 53 日志文件条目
跟踪是一种配置,它允许将事件作为日志文件传输到您指定的 Amazon S3 存储桶。 CloudTrail 日志文件包含一个或多个日志条目。事件代表来自任何来源的单个请求,包括有关请求的操作、操作的日期和时间、请求参数等的信息。 CloudTrail 日志文件不是公共 API 调用的有序堆栈跟踪,因此它们不按任何特定顺序出现。
eventName 元素可标识发生的操作。(在 CloudTrail 日志,域名注册操作的第一个字母是小写的,尽管操作名称中它是大写字母。例如, UpdateDomainContact 显示为 updateDomainContact 在日志中)。 CloudTrail 支持所有 Route 53 API 操作。以下示例显示了 CloudTrail 演示以下操作的日志条目:
列出与关联的托管区域 AWS 帐户
创建运行状况检查
创建两个记录
删除托管区域
为已注册的域更新信息
创建 Route 53 VPC 解析器出站端点
{ "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" } ] }