> 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/monitoring/appsec2-aws-47.md).

# AWS CloudFront attached WAFv2 WebACL is not configured with AMR for Log4j Vulnerability misconfigura

## AWS CloudFront attached WAFv2 WebACL is not configured with AMR for Log4j Vulnerability misconfiguration detected in code

### Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC2\_AWS\_47                     |
| Category - Subcategory | Public Exposure - APIs               |
| Provider               | AWS                                  |
| Severity               | MEDIUM                               |
| Framework              | Terraform                            |
| Mapped CSPM/KSPM Rule  | c8bbb7a9-c13a-482b-a0f3-96b4f5ff2ce0 |

### Impact

This rule identifies AWS CloudFront attached with WAFv2 WebACL which is not configured with AWS Managed Rules (AMR) for Log4j Vulnerability. As per the guidelines given by AWS, CloudFront attached with WAFv2 WebACL should be configured with AWS Managed Rules (AMR) AWSManagedRulesKnownBadInputsRuleSet and AWSManagedRulesAnonymousIpList to protect from Log4j Vulnerability (CVE-2021-44228).

For more information please refer to <https://aws.amazon.com/security/security-bulletins/AWS-2021-006/>

### How to Fix

*Resource:* aws\_cloudfront\_distribution, aws\_wafv2\_web\_acl

* *Arguments:* rule.statement.managed\_rule\_group\_statement.name \[source,go]

***

resource "aws\_cloudfront\_distribution" "pass" { origin { domain\_name = aws\_s3\_bucket.b.bucket\_regional\_domain\_name origin\_access\_control\_id = aws\_cloudfront\_origin\_access\_control.default.id origin\_id = local.s3\_origin\_id }

enabled = true is\_ipv6\_enabled = true comment = "Some comment" default\_root\_object = "index.html"

aliases = \["mysite.example.com", "yoursite.example.com"]

default\_cache\_behavior { allowed\_methods = \["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"] cached\_methods = \["GET", "HEAD"] target\_origin\_id = local.s3\_origin\_id

forwarded\_values { query\_string = false

cookies { forward = "none" } }

viewer\_protocol\_policy = "allow-all" min\_ttl = 0 default\_ttl = 3600 max\_ttl = 86400 }

## Cache behavior with precedence 0

ordered\_cache\_behavior { path\_pattern = "/content/immutable/\*" allowed\_methods = \["GET", "HEAD", "OPTIONS"] cached\_methods = \["GET", "HEAD", "OPTIONS"] target\_origin\_id = local.s3\_origin\_id

forwarded\_values { query\_string = false headers = \["Origin"]

cookies { forward = "none" } }

min\_ttl = 0 default\_ttl = 86400 max\_ttl = 31536000 compress = true viewer\_protocol\_policy = "redirect-to-https" }

price\_class = "PriceClass\_200"

restrictions { geo\_restriction { restriction\_type = "whitelist" locations = \["US", "CA", "GB", "DE"] } }

tags = { Environment = "production" }

viewer\_certificate { cloudfront\_default\_certificate = true } web\_acl\_id = aws\_wafv2\_web\_acl.pass\_acl.arn }

resource "aws\_wafv2\_web\_acl" "pass\_acl" { name = "managed-rule-example" description = "Example of a managed rule." scope = "REGIONAL"

default\_action { allow {} }

rule { name = "rule-1" priority = 1

override\_action { count {} }

statement { managed\_rule\_group\_statement { name = "AWSManagedRulesAnonymousIpList" vendor\_name = "AWS"

excluded\_rule { name = "SizeRestrictions\_QUERYSTRING" }

scope\_down\_statement { geo\_match\_statement { country\_codes = \["US", "NL"] } } } }

visibility\_config { cloudwatch\_metrics\_enabled = false metric\_name = "friendly-rule-metric-name" sampled\_requests\_enabled = false } }

rule { name = "rule-2" priority = 2

override\_action { count {} }

statement { managed\_rule\_group\_statement { name = "AWSManagedRulesKnownBadInputsRuleSet" vendor\_name = "AWS"

excluded\_rule { name = "SizeRestrictions\_QUERYSTRING" }

scope\_down\_statement { geo\_match\_statement { country\_codes = \["US", "NL"] } } } }

visibility\_config { cloudwatch\_metrics\_enabled = false metric\_name = "friendly-rule-metric-name" sampled\_requests\_enabled = false } }

tags = { Tag1 = "Value1" Tag2 = "Value2" }

### visibility\_config { cloudwatch\_metrics\_enabled = false metric\_name = "friendly-metric-name" sampled\_requests\_enabled = false } }


---

# 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/monitoring/appsec2-aws-47.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.
