Skip to content

Support logical rule statements in wafv2-controller #2534

@takeshi-hatamoto

Description

@takeshi-hatamoto

Is your feature request related to a problem?

The following code deploys a rule in labelMatchStatement.

  rules:
   - name: Allowbot
      priority: 12
      action:
        allow: {}
      visibilityConfig:
        metricName: Allowbot
        sampledRequestsEnabled: true
        cloudWatchMetricsEnabled: true
      statement:
        labelMatchStatement: 
          scope: LABEL
          key: "awswaf:managed:aws:bot-control:bot:name:googlebot"

However, when I use “orStatement” to apply the or condition of labelMatchStatement, I get the following error, which I would like to improve.

strict decoding error: unknown field “spec.rules[12].statement.orStatement.statements”

    - name: Allowbot
      priority: 13
      action:
        allow: {}
      visibilityConfig:
        metricName: Allowbot
        sampledRequestsEnabled: true
        cloudWatchMetricsEnabled: true
      statement:
        orStatement: 
          statements:
            - labelMatchStatement:
                scope: LABEL
                key: "awswaf:managed:aws:bot-control:bot:user_triggered:verified"
            - labelMatchStatement:
              scope: LABEL
              key: "awswaf:managed:aws:bot-control:bot:name:googlebot"

Describe the solution you'd like

Please let me know if you have already implemented this and if there is a way to solve this problem with orStatement.
I would like to eventually be able to use not only orStatement but also andStatement and NotStatement.
Using logical rule statements in AWS WAF

Metadata

Metadata

Assignees

Labels

service/wafv2Indicates issues or PRs that are related to wafv2-controller.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions