> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
