【问题标题】:AWS WafV2 OR Statement / IPSetReferenceAWS WafV2 OR 语句/IPSetReference
【发布时间】:2020-04-09 22:32:41
【问题描述】:

我正在尝试理解这个很棒的文档: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-orstatementone.html

这告诉我要这样写:

Statements: 
    - StatementTwo

我想做的事: 我想确保 IP 位于我创建的两个 - 三个不同的 IPSet 之一中。我想避免创建多个规则,因为据我了解,每个规则每月花费 1 美元。我想要拥有多个 IP 集的唯一原因是要明确为什么将每个 IP 添加到每个集。 (家庭办公室、常规办公室、顾问等)。

我已经尝试过 一些 的变体:

 Rules:
        - Name: WafIpRule
          Priority: 1
          Action:
            Allow: {}
          VisibilityConfig:
            SampledRequestsEnabled: false
            CloudWatchMetricsEnabled: true
            MetricName: !Sub web${Environment}AllowWhitelistedIps
          Statement:
            Statements:
              - IPSetReferenceStatement:
                  Arn: !GetAtt IpStuff1.Arn
              - IPSetReferenceStatement:
                  Arn: !GetAtt IpStuff2.Arn

这甚至可能吗?如果是怎么办?还是我应该去合并 IpSets/Do 单独的规则?

我似乎可以通过控制台做到这一点,所以它似乎应该是可能的......

【问题讨论】:

    标签: amazon-web-services amazon-waf amazon-acl


    【解决方案1】:

    有点尴尬,因为这与我尝试的方法非常接近,但一点点橡皮擦也有很长的路要走。

    我不确定 AWS 是否真的将其计为 2 条(或更多)规则,但它们确实计算了 WCU 的使用量(所以我认为它会)。

      Statement:
        OrStatement:
          Statements:
            - IPSetReferenceStatement:
                Arn: !GetAtt IpList1.Arn
            - IPSetReferenceStatement:
                Arn: !GetAtt IpList2.Arn
    

    我将把这个留在这里,以备日后的 Google-fu 使用

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-14
    • 2014-07-06
    • 2017-12-15
    相关资源
    最近更新 更多