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