> 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/compute/appsec-aws-335.md).

# ECS task definitions have their own unique process namespace or share the host's process namespace m

## Rule Details

|                        |                                       |
| ---------------------- | ------------------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_335                      |
| Category - Subcategory | Compute - Default Credentials Or Auth |
| Provider               | AWS                                   |
| Severity               | MEDIUM                                |
| Framework              | Terraform, Terraform Plan             |

## Impact

This rule is checking for Amazon Elastic Container Service (ECS) task definitions that are configured to share the host's process namespace. This is considered a bad or risky configuration because it could potentially allow a process within a container to gain unrestricted access to all processes running on the host system. This would breach the isolation barriers of containers, paving way for potential security threats such as unauthorized access and data leakages. Therefore, ECS task definitions should be configured with their own isolated process namespaces to uphold the security and integrity of the host system and other containers.

## How to Fix

*Resource:* aws\_ecs\_task\_definition

* *Arguments:* container\_definitions.pidMode

## To fix this issue, you need to declare `pid_mode` in the `aws_ecs_task_definition` resource, and do not set it to `host`. \[source,go]

resource "aws\_ecs\_task\_definition" "fail" { family = "service" container\_definitions = jsonencode(\[ { name = "first" image = "service-first" cpu = 10 memory = 512 essential = true portMappings = \[ { containerPort = 80 hostPort = 80 } ] }, { name = "second" image = "service-second" cpu = 10 memory = 256 essential = true privilege = true

* pidMode = "host" portMappings = \[ { containerPort = 443 hostPort = 443 } ] } ])

volume { name = "service-storage" host\_path = "/ecs/service-storage" }

## placement\_constraints { type = "memberOf" expression = "attribute:ecs.availability-zone in \[us-west-2a, us-west-2b]" } }


---

# 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/compute/appsec-aws-335.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.
