> 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/iam/appsec-aws-283.md).

# IAM Policy Document Allows All or Any AWS Principal Permissions to Resources misconfiguration detect

## Rule Details

|                        |                           |
| ---------------------- | ------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_283          |
| Category - Subcategory | IAM - Overly Permissive   |
| Provider               | AWS                       |
| Severity               | HIGH                      |
| Framework              | Terraform, Terraform Plan |

## Impact

This rule is checking to ensure that no Identity and Access Management (IAM) policy documents are allowing "ALL" or any AWS principal permissions to the resource. This is potentially harmful because it signifies that there are overly permissive policies in place. If all AWS principals have permission, it means any entity in AWS can potentially access or modify the resource, which can lead to unintended access, data leaks, or security breaches. Any security best practices recommend least privilege approach - the permission should only be given to the required and authorized entities.

## How to Fix

*Resource:* aws\_iam\_policy\_document

* *Arguments:* statement

To fix this issue, you need to specify the principals in your IAM policy, instead of using wildcard "\*". Additionally, regulate the actions that can be performed by each principal, instead of allowing all actions.

## The above code is secure because it illustrates best practices for IAM policy creation. Rather than using a wildcard "\*", which would allow all principals to access the policy, specific principals are listed. Furthermore, the permitted actions are listed, rather than allowing all actions. \[source,go]

resource "aws\_iam\_policy" "example" { name = "example\_policy" path = "/" description = "An example policy"

## policy = <\<EOF { "Version": "2012-10-17", "Statement": \[ { "Action": \[ "s3:ListBucket" ], "Effect": "Allow", "Resource": "arn:aws:s3:::example\_bucket", "Principal": { "AWS": \[ "arn:aws:iam::ACCOUNT\_ID:root" ] } } ] } EOF }


---

# 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/iam/appsec-aws-283.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.
