

**에 대한 새로운 콘솔 환경 소개 AWS WAF**

이제 업데이트된 환경을 사용하여 콘솔의 모든 위치에서 AWS WAF 기능에 액세스할 수 있습니다. 자세한 내용은 [콘솔 작업을 참조하세요](https://docs.aws.amazon.com/waf/latest/developerguide/working-with-console.html).

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AND 규칙 문
<a name="waf-rule-statement-type-and"></a>

AND 규칙 문은 중첩된 문을 논리적 AND 연산과 결합하므로 AND 문이 일치하도록 모든 중첩된 문이 일치해야 합니다. 여기에는 적어도 두 개의 중첩 문이 필요합니다.

## 규칙 문 특성
<a name="and-rule-statement-characteristics"></a>

**중첩 가능** – 이러한 문 유형을 중첩할 수 있습니다.

**WCU** – 중첩된 문에 따라 다릅니다.

## 이 규칙 문을 찾을 수 있는 위치
<a name="and-rule-statement-where-to-find"></a>
+ 콘솔의 **규칙 빌더** – **요청의 경우**에서 **모든 문과 일치(AND)**를 선택한 다음, 중첩된 문을 입력합니다.
+ **API** – [AndStatement](https://docs.aws.amazon.com/waf/latest/APIReference/API_AndStatement.html)

## 예제
<a name="and-rule-statement-examples"></a>

다음 목록은 AND 및 NOT 논리 규칙 문을 사용하여 SQL 명령어 삽입 공격 문에 대한 일치 항목에서 거짓 긍정을 제거하는 방법을 보여줍니다. 이 예제의 경우 단일 바이트 일치 문을 작성하여 거짓 긍정을 초래하는 요청을 일치시킬 수 있다고 가정해 보겠습니다.

AND 문은 바이트 일치 문과 일치하지 않으면서 SQL 명령어 삽입 공격 문과 일치하는 요청과 일치합니다.

```
{
      "Name": "SQLiExcludeFalsePositives",
      "Priority": 0,
      "Statement": {
        "AndStatement": {
          "Statements": [
            {
              "NotStatement": {
                "Statement": {
                  "ByteMatchStatement": {
                    "SearchString": "string identifying a false positive",
                    "FieldToMatch": {
                      "Body": {
                        "OversizeHandling": "MATCH"
                      }
                    },
                    "TextTransformations": [
                      {
                        "Priority": 0,
                        "Type": "NONE"
                      }
                    ],
                    "PositionalConstraint": "CONTAINS"
                  }
                }
              }
            },
            {
              "SqliMatchStatement": {
                "FieldToMatch": {
                  "Body": {
                    "OversizeHandling": "MATCH"
                  }
                },
                "TextTransformations": [
                  {
                    "Priority": 0,
                    "Type": "NONE"
                  }
                ]
              }
            }
          ]
        }
      },
      "Action": {
        "Block": {}
      },
      "VisibilityConfig": {
        "SampledRequestsEnabled": true,
        "CloudWatchMetricsEnabled": true,
        "MetricName": "SQLiExcludeFalsePositives"
      }
    }
```

콘솔 규칙 시각 편집기를 사용하면 비논리문 또는 NOT 문을 OR 또는 AND 문 아래에 중첩할 수 있습니다. NOT 문의 중첩은 이전 예제에 나와 있습니다.

콘솔 규칙 시각적 편집기를 사용하면 대부분의 중첩이 가능한 명령문을 이전 예제와 같은 논리적 규칙 문 아래에 중첩할 수 있습니다. 시각적 편집기를 사용하여 OR 또는 AND 문을 중첩할 수는 없습니다. 이러한 유형의 중첩을 구성하려면 규칙 문을 JSON으로 제공해야 합니다. 예를 들어, 다음 JSON 규칙 목록에는 AND 문 내에 중첩된 OR 문이 포함됩니다.

```
{
  "Name": "match_rule",
  "Priority": 0,
  "Statement": {
    "AndStatement": {
      "Statements": [
        {
          "LabelMatchStatement": {
            "Scope": "LABEL",
            "Key": "awswaf:managed:aws:bot-control:bot:category:monitoring"
          }
        },
        {
          "NotStatement": {
            "Statement": {
              "LabelMatchStatement": {
                "Scope": "LABEL",
                "Key": "awswaf:managed:aws:bot-control:bot:name:pingdom"
              }
            }
          }
        },
        {
          "OrStatement": {
            "Statements": [
              {
                "GeoMatchStatement": {
                  "CountryCodes": [
                    "JM",
                    "JP"
                  ]
                }
              },
              {
                "ByteMatchStatement": {
                  "SearchString": "JCountryString",
                  "FieldToMatch": {
                    "Body": {}
                  },
                  "TextTransformations": [
                    {
                      "Priority": 0,
                      "Type": "NONE"
                    }
                  ],
                  "PositionalConstraint": "CONTAINS"
                }
              }
            ]
          }
        }
      ]
    }
  },
  "Action": {
    "Block": {}
  },
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "match_rule"
  }
}
```