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

# WAF rule does not have any actions misconfiguration detected in code

## WAF rule does not have any actions misconfiguration detected in code

### Rule Details

|                        |                                    |
| ---------------------- | ---------------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_342                   |
| Category - Subcategory | Public Exposure - Ingress Controls |
| Provider               | AWS                                |
| Severity               | LOW                                |
| Framework              | Terraform, Terraform Plan          |

### Impact

This rule ensures that the Web Application Firewall (WAF) rule has any actions set. The absence of actions in a WAF rule could lead to potential security vulnerabilities. WAF rules are intended to block, allow, or monitor (count) web requests based on conditions that you define. If a WAF rule has no actions set, it wouldn't be able to perform its function, leaving the application exposed to potential security threats. Therefore, this rule checks that there are actions defined in the WAF rule, enhancing the application's security.

### How to Fix

*Resource:* aws\_cloudfront\_distribution

* *Arguments:* failover\_criteria and origin\_id

### To fix this issue, you need to configure origin failover for your CloudFront distributions in your Terraform code and ensure you have two `member` parameters. \[source,go]

resource "aws\_cloudfront\_distribution" "pass" { origin\_group { origin\_id = "groupS3"

* failover\_criteria {
* status\_codes = \[403, 404, 500, 502]
* }
* member {
* origin\_id = "primaryS3"
* }
* member {
* origin\_id = "failoverS3"
* } }

origin { domain\_name = aws\_s3\_bucket.primary.bucket\_regional\_domain\_name origin\_id = "primaryS3"

s3\_origin\_config { origin\_access\_identity = aws\_cloudfront\_origin\_access\_identity.default.cloudfront\_access\_identity\_path } }

origin { domain\_name = aws\_s3\_bucket.failover.bucket\_regional\_domain\_name origin\_id = "failoverS3"

s3\_origin\_config { origin\_access\_identity = aws\_cloudfront\_origin\_access\_identity.default.cloudfront\_access\_identity\_path } }

default\_cache\_behavior {

## ... other configuration ...

target\_origin\_id = "groupS3" }

### enabled = false restrictions {} viewer\_certificate {} }


---

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