> 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/logging/appsec2-aws-62.md).

# S3 buckets do not have event notifications enabled misconfiguration detected in code

## Rule Details

|                        |                               |
| ---------------------- | ----------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_AWS\_62              |
| Category - Subcategory | Logging - Disabled or missing |
| Provider               | AWS                           |
| Severity               | LOW                           |
| Framework              | Terraform, Terraform Plan     |

## Impact

This rule detects if the S3 bucket event notifications are not enabled in AWS settings.

## How to Fix

*Resource:* aws\_s3\_bucket, aws\_s3\_bucket\_notification

* *Arguments:* queue, lambda\_function, topic

The issue can be fixed by enabling event notifications for the S3 bucket. You can do it by using the `aws_s3_bucket_notification` resource where you can specify the type of destination (Amazon SQS, Amazon SNS, or AWS Lambda) where you want Amazon S3 to publish the event.

Secure code example:

## The above code is secure as it enables event notifications for the S3 bucket and specifies Amazon SNS as the destination where Amazon S3 will publish the event. \[source,go]

resource "aws\_s3\_bucket" "bucket" { bucket = "bucket" }

resource "aws\_sns\_topic" "bucket\_notifications" { name = "bucket-notifications" }

resource "aws\_s3\_bucket\_notification" "bucket\_notification" { bucket = aws\_s3\_bucket.bucket.id

## topic { topic\_arn = aws\_sns\_topic.bucket\_notifications.arn events = \["s3:ObjectCreated:\*"] filter\_prefix = "logs/" } }


---

# 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/logging/appsec2-aws-62.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.
