分析 AWS CloudTrail 日志文件条目 - Amazon EKS

帮助改进此页面

想为本用户指南做出贡献? 滚动到页面底部,然后选择在 GitHub 上编辑此页面。您的贡献有助于我们的用户指南为每个人提供更充分的参考。

分析 AWS CloudTrail 日志文件条目

跟踪是一种配置,可用于将事件作为日志文件传送到您指定的 Amazon S3 存储桶。CloudTrail 日志文件包含一个或多个日记账条目。一个事件表示来自任何源的一个请求,包括有关所请求的操作的信息。其中包括操作的日期和时间以及所使用的请求参数等信息。CloudTrail 日志文件不是公用 API 调用的有序堆栈跟踪,因此它们不会按任何具体顺序显示。

下面的示例显示了一个 CloudTrail 日志条目,该条目说明了 CreateCluster 操作。

{ "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/username", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "username" }, "eventTime": "2018-05-28T19:16:43Z", "eventSource": "eks.amazonaws.com", "eventName": "CreateCluster", "awsRegion": "region-code", "sourceIPAddress": "205.251.233.178", "userAgent": "PostmanRuntime/6.4.0", "requestParameters": { "resourcesVpcConfig": { "subnetIds": [ "subnet-a670c2df", "subnet-4f8c5004" ] }, "roleArn": "arn:aws:iam::111122223333:role/AWSServiceRoleForAmazonEKS-CAC1G1VH3ZKZ", "clusterName": "test" }, "responseElements": { "cluster": { "clusterName": "test", "status": "CREATING", "createdAt": 1527535003.208, "certificateAuthority": {}, "arn": "arn:aws:eks:region-code:111122223333:cluster/test", "roleArn": "arn:aws:iam::111122223333:role/AWSServiceRoleForAmazonEKS-CAC1G1VH3ZKZ", "version": "1.10", "resourcesVpcConfig": { "securityGroupIds": [], "vpcId": "vpc-21277358", "subnetIds": [ "subnet-a670c2df", "subnet-4f8c5004" ] } } }, "requestID": "a7a0735d-62ab-11e8-9f79-81ce5b2b7d37", "eventID": "eab22523-174a-499c-9dd6-91e7be3ff8e3", "readOnly": false, "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }

Amazon EKS 服务相关角色的日志条目

Amazon EKS 服务相关角色对AWS资源进行 API 调用。将显示由 Amazon EKS 服务相关角色进行的调用的 CloudTrail 日志条目以及 username: AWSServiceRoleForAmazonEKSusername: AWSServiceRoleForAmazonEKSNodegroup。有关 Amazon EKS 和服务相关角色的更多信息,请参阅 对 Amazon EKS 使用服务相关角色

以下示例显示了一个 CloudTrail 日志条目,该条目演示 AWSServiceRoleForAmazonEKSNodegroup 服务相关角色执行的 DeleteInstanceProfile 操作(在 sessionContext 中注明)。

{ "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AROA3WHGPEZ7SJ2CW55C5:EKS", "arn": "arn:aws:sts::111122223333:assumed-role/AWSServiceRoleForAmazonEKSNodegroup/EKS", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROA3WHGPEZ7SJ2CW55C5", "arn": "arn:aws:iam::111122223333:role/aws-service-role/eks-nodegroup.amazonaws.com/AWSServiceRoleForAmazonEKSNodegroup", "accountId": "111122223333", "userName": "AWSServiceRoleForAmazonEKSNodegroup" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-02-26T00:56:33Z" } }, "invokedBy": "eks-nodegroup.amazonaws.com" }, "eventTime": "2020-02-26T00:56:34Z", "eventSource": "iam.amazonaws.com", "eventName": "DeleteInstanceProfile", "awsRegion": "region-code", "sourceIPAddress": "eks-nodegroup.amazonaws.com", "userAgent": "eks-nodegroup.amazonaws.com", "requestParameters": { "instanceProfileName": "eks-11111111-2222-3333-4444-abcdef123456" }, "responseElements": null, "requestID": "11111111-2222-3333-4444-abcdef123456", "eventID": "11111111-2222-3333-4444-abcdef123456", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }