> 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/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-codebuild-project-environment-variables-contain-plaintext-aws-credentials.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS CodeBuild project environment variables contain plaintext AWS credentials

### Synopsis

| Field               | Value                                                                         |
| ------------------- | ----------------------------------------------------------------------------- |
| Rule Type           | Detection                                                                     |
| Finding Type        | AWS CodeBuild project environment variables contain plaintext AWS credentials |
| Finding ID          | 60000944                                                                      |
| Generates a Finding | This detection rule also generates a finding                                  |
| Severity            | Low                                                                           |
| Category            | CONFIGURATION                                                                 |
| Cloud Providers     | AWS                                                                           |
| Platform Module     | CSPM                                                                          |
| Asset Types         | AWS\_CODEBUILD\_PROJECT                                                       |
| ATT\&CK Tactic      | TA0112 (TA0112)                                                               |
| ATT\&CK Technique   | T1685 (T1685)                                                                 |

### Description

AWS CodeBuild projects with environment variables storing AWS credentials ('AWS\_ACCESS\_KEY\_ID', 'AWS\_SECRET\_ACCESS\_KEY', 'Password') in plaintext represent a significant security risk. Storing these credentials directly exposes them to unauthorized access, potentially leading to a complete compromise of the AWS account.

CodeBuild projects utilize environment variables for build configurations and sensitive data. Plaintext storage of credentials bypasses any security mechanisms, allowing anyone with access to the project's configuration to gain unauthorized access to AWS resources. This could enable attackers to perform malicious actions such as data exfiltration, resource modification, or deploying malware.

A misconfiguration exposing these credentials could result in a complete breach of the AWS account and its associated resources. Storing sensitive credentials securely is crucial for maintaining confidentiality and integrity. This best practice prevents unauthorized access and maintains the security posture of the AWS environment.

Implement secure credential management practices. Use AWS Secrets Manager or AWS Systems Manager Parameter Store to store and retrieve sensitive information like AWS credentials during the CodeBuild process. This ensures that credentials are not directly exposed in the environment variables, minimizing the risk of compromise.

### Remediation

**Manual steps:**

AWS CodeBuild Project - Manual remediation steps:

To remove environment variables from a AWS CodeBuild project,

1. Log in to the AWS Management Console.
2. In the console, select the specific region from the region drop-down in the top right corner, for which the alert is generated.
3. Navigate to 'Developer Tools' from the 'Services' dropdown and select the 'CodeBuild'.
4. In the navigation pane, choose 'Build projects'.
5. Select the reported Build project and choose Edit, then click 'Environment' and Expand 'Additional configuration'.
6. Choose 'Remove' next to the environment variables that contain plaintext credentials.
7. When you have finished changing your CodeBuild environment configuration, click 'Update environment'.

You can store environment variables with sensitive values in the AWS Systems Manager Parameter Store or AWS Secrets Manager and then retrieve them from your build spec according to your business requirements.


---

# 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/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-codebuild-project-environment-variables-contain-plaintext-aws-credentials.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.
