> 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/public-exposure/appsec-aws-303.md).

# AWS SSM documents are public misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_303                     |
| Category - Subcategory | Public Exposure - Storage Buckets    |
| Provider               | AWS                                  |
| Severity               | MEDIUM                               |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | 998d0466-d498-4662-b41a-cefaadd94c40 |

## Impact

This rule is checking to ensure that SSM (Simple Systems Manager) documents are not public. SSM documents are a set of instructions that an instance follows, such as software configurations. Making them publicly accessible can pose a security risk as it exposes potentially sensitive information. Unauthorized users could gain insight into the system’s configuration, dependencies, or other valuable data, which can be exploited leading to data breaches or system compromises.

## How to Fix

*Resource:* aws\_ssm\_document

* *Arguments:* permissions.account\_ids

To fix the issue, you should ensure that AWS SSM documents have permissions that restrict public access. You can modify the "permissions" argument of the aws\_ssm\_document resource to exclude "all", which represents public access. Here is an example:

## This code is securing the SSM Document by restricting its access only to the specified AWS account. Instead of allowing public access with "All", it's specifying an AWS Role as the transfer. This means only those with that specific role in the specified AWS account can get this document. This helps limit who has access to this SSM Document, enhancing the security of your AWS resources. \[source,go]

resource "aws\_ssm\_document" "example" { name = "example" document\_type = "Command"

permissions = { type = "Share"

* account\_ids = All
* account\_ids = \[data.aws\_caller\_identity.current.account\_id] } ... }

***


---

# 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/public-exposure/appsec-aws-303.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.
