証跡は、指定した S3 バケットにイベントをログファイルとして配信するように設定できます。CloudTrail ログファイルには、1 つ以上のログエントリがあります。イベントはあらゆるソースからの単一のリクエストを表し、リクエストされたアクション、アクションの日時、リクエストのパラメータなどの情報が含まれます。CloudTrail ログファイルは、パブリック API コールの順序付けられたスタックトレースではないため、特定の順序では表示されません。
注記
機密情報を保護するために、CodeBuild ログでは次の情報が非表示になっています。
-
AWS アクセスキー ID。詳細については、AWS Identity and Access Management ユーザーガイドの IAM ユーザーのアクセスキーの管理を参照してください。
-
パラメータストアを使用して指定された文字列。詳細については、「Amazon EC2 Systems Manager ユーザーガイド」の「Systems Manager パラメータストア」および「Systems Manager パラメータストアコンソールのチュートリアル」を参照してください。
-
AWS Secrets Manager を使用して指定された文字列。詳細については、「キー管理」を参照してください。
次の例は、CodeBuild でビルドプロジェクトを作成する方法を示す CloudTrail ログエントリを示しています。
{
"eventVersion": "1.05",
"userIdentity": {
"type": "FederatedUser",
"principalId": "account-ID
:user-name
",
"arn": "arn:aws:sts::account-ID
:federated-user/user-name
",
"accountId": "account-ID
",
"accessKeyId": "access-key-ID
",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2016-09-06T17:59:10Z"
},
"sessionIssuer": {
"type": "IAMUser",
"principalId": "access-key-ID
",
"arn": "arn:aws:iam::account-ID
:user/user-name
",
"accountId": "account-ID
",
"userName": "user-name
"
}
}
},
"eventTime": "2016-09-06T17:59:11Z",
"eventSource": "codebuild.amazonaws.com",
"eventName": "CreateProject",
"awsRegion": "region-ID
",
"sourceIPAddress": "127.0.0.1",
"userAgent": "user-agent
",
"requestParameters": {
"awsActId": "account-ID
"
},
"responseElements": {
"project": {
"environment": {
"image": "image-ID",
"computeType": "BUILD_GENERAL1_SMALL",
"type": "LINUX_CONTAINER",
"environmentVariables": []
},
"name": "codebuild-demo-project",
"description": "This is my demo project",
"arn": "arn:aws:codebuild:region-ID
:account-ID
:project/codebuild-demo-project:project-ID
",
"encryptionKey": "arn:aws:kms:region-ID
:key-ID
",
"timeoutInMinutes": 10,
"artifacts": {
"location": "arn:aws:s3:::codebuild-region-ID
-account-ID
-output-bucket",
"type": "S3",
"packaging": "ZIP",
"outputName": "MyOutputArtifact.zip"
},
"serviceRole": "arn:aws:iam::account-ID
:role/CodeBuildServiceRole",
"lastModified": "Sep 6, 2016 10:59:11 AM",
"source": {
"type": "GITHUB",
"location": "https://github.com/my-repo.git"
},
"created": "Sep 6, 2016 10:59:11 AM"
}
},
"requestID": "9d32b228-745b-11e6-98bb-23b67EXAMPLE",
"eventID": "581f7dd1-8d2e-40b0-aeee-0dbf7EXAMPLE",
"eventType": "AwsApiCall",
"recipientAccountId": "account-ID
"
}