> 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-privileged-mode-is-enabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS CodeBuild project environment privileged mode is enabled

### Synopsis

| Field               | Value                                                        |
| ------------------- | ------------------------------------------------------------ |
| Rule Type           | Detection                                                    |
| Finding Type        | AWS CodeBuild project environment privileged mode is enabled |
| Finding ID          | 60000818                                                     |
| Generates a Finding | This detection rule also generates a finding                 |
| Severity            | Informational                                                |
| 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 privileged mode enabled pose a significant security risk. Enabling privileged mode grants the build process unrestricted access to the host system, including the Docker daemon.

CodeBuild projects utilize container environments for building software. The privileged mode setting within these environments allows containers to access all host system devices and resources. Disabling this mode restricts container access to only necessary resources, mitigating the risk of unauthorized access or modification of the host system. An attacker could exploit a compromised build process running in privileged mode to gain complete control of the host system.

A misconfiguration allowing privileged mode could lead to data breaches, system compromise, and resource exhaustion. Restricting access to host resources ensures that even if a build process is compromised, the damage is limited. Best practices dictate limiting privileges to only what's necessary, adhering to the principle of least privilege.

To mitigate this risk, disable privileged mode on all CodeBuild projects unless strictly required for building Docker images. Regularly review project configurations to ensure privileged mode is only enabled where essential. Implement strong access controls and monitor build processes for suspicious activity.

### Remediation

**Manual steps:**

AWS CodeBuild Project - Manual remediation steps:

To disable the Privileged mode for the 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 Click on 'Edit' button.
6. On the Edit project page, expand the 'Additional configuration' under the Environment section.
7. Uncheck the checkbox 'Enable this flag if you want to build Docker images or want your builds to get elevated privileges.' under the 'Privileged' section.
8. When you have finished changing your CodeBuild environment configuration, click 'Update Project'.


---

# 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-privileged-mode-is-enabled.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.
