> 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-355.md).

# IAM policy document allows all resources with restricted actions misconfiguration detected in code

## Rule Details

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

## Impact

This rule checks IAM policies for statements that allow unrestricted resource access ('\*') for actions that can and should be restricted to specific resources. This behavior is potentially unsafe because it broadens the scope of access controls and increases the risk of unauthorized access. Prisma Cloud checks the AWS documentation for IAM actions that can be restricted to a resource and recommends defining a specific resource rather than '\*'. For example, the s3:PutObject action can be restricted to a specific S3 bucket instead of allowing uploads to any S3 bucket using '\*'. It is best security practice to define granular permissions to each user access, as unrestricted access can lead to unwanted manipulations or data breaches. Therefore, it is recommended to specify restrictions and assign minimum necessary access rights.

## How to Fix

*Resource:* aws\_iam\_policy

* *Arguments:* policy

Review your IaC IAM policies to identify if any resources are set to "\*" that can be restricted, which grants full access to all resources of that type. For each identified statement, replace "\*" with the specific Amazon Resource Names (ARNs) corresponding to the resources users or roles actually need access to.

## The following Terraform code example describes how to define specific resources in the Resource field of the Statement block, replacing "\*". \[source,go]

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

policy = jsonencode({ Version = "2012-10-17" Statement = \[ { Action = \[ "states:CreateStateMachine", ] Effect = "Allow"

* Resource = "\*"
* Resource = "arn:aws:\<resource\_type>:::" }, ] }) }

***


---

# 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-355.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.
