> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/logging/appsec-aws-314.md).

# AWS CodeBuild project not configured with logging configuration misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_314                     |
| Category - Subcategory | Logging - Disabled or missing        |
| Provider               | AWS                                  |
| Severity               | LOW                                  |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | 5699ae73-275f-4d38-bd2f-512da77d4744 |

## Impact

This rule is checking that AWS CodeBuild project environments have a logging configuration set. AWS CodeBuild is a fully managed build service that compiles source code, runs tests, and produces software packages. The rule is ensuring that these CodeBuild projects have appropriate logging configurations to capture details about what happens during a build process.

The absence of a logging configuration is not advised because it can make it difficult to debug and identify issues in CodeBuild processes. This missing configuration could also lead to non-compliance with standards that mandate comprehensive monitoring and logging of activities in the application lifecycle. Not having proper logs can complicate troubleshooting, impede visibility into application processes, and could potentially mask malicious activities if security incidents occur.

## How to Fix

*Resource:* aws\_codebuild\_project

* *Arguments:* logs\_config.cloudwatch\_logs, logs\_config.s3\_logs

To fix this issue, you need to enable logging configuration for your AWS CodeBuild Project. This can be done by adding a logging block in your resource.

## The above Terraform script ensures that the `aws_codebuild_project` resource has log configuration enabled. The logs are sent to both CloudWatch Logs and Amazon S3. This configuration helps to maintain a secure environment by ensuring that all events are logged and traceable, which is a best practice for regulatory and operational troubleshooting. The logs would provide detailed information, including source IP addresses, the request made, request timestamp, and additional data. This can help during investigations, audits, or debugging sessions to understand exactly what occurred. \[source,go]

resource "aws\_codebuild\_project" "example" { name = "test-project" description = "test\_codebuild\_project" build\_timeout = "5" service\_role = aws\_iam\_role.example.arn

artifacts { type = "NO\_ARTIFACTS" }

environment { compute\_type = "BUILD\_GENERAL1\_SMALL" image = "aws/codebuild/standard:4.0" type = "LINUX\_CONTAINER" image\_pull\_credentials\_type = "CODEBUILD" }

source { type = "GITHUB" location = "<https://github.com/user/repo.git>" git\_clone\_depth = 1 }

## logs\_config { cloudwatch\_logs { group\_name = "log-group" stream\_name = "log-stream" } s3\_logs { status = "ENABLED" location = aws\_s3\_bucket.example.bucket } } }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/logging/appsec-aws-314.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
