【发布时间】:2021-11-10 03:36:35
【问题描述】:
为此问题设计的示例,基于 aws 文档,我使用 WAF 定义了 WAFv2 资源类型、规则和 IP 集列表。以下工作,它阻止了我指定的 IP,但是如何允许某些 IP 列表并阻止所有其他 IP?
Resources:
WebAcl:
Type: AWS::WAFv2::WebACL
Properties:
Name: sample-acl
Scope: REGIONAL
Description: sample ACL.
DefaultAction:
Allow: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: sample-acl
Rules:
- Name: blockIPList
Priority: 4
Action:
Block: {}
VisibilityConfig:
SampledRequestsEnabled: true
CloudWatchMetricsEnabled: true
MetricName: IPListMetric
Statement:
IPSetReferenceStatement:
Arn: !GetAtt myIPSet.Arn
myIPSet:
Type: 'AWS::WAFv2::IPSet'
Properties:
Name: sampleIPlistIPv4
Scope: REGIONAL
IPAddressVersion: IPV4
Addresses:
- 70.25.14.172/32
【问题讨论】:
-
你能提供你关注的文档的链接吗?此外,您想要做什么也不是很清楚。你能详细说明一下吗?
-
@Marcin - 谢谢。我想通过 WAF 阻止/允许 IP 列表。我按照 WAF v2 上的 aws 文档创建了一个 WAF 资源,现在我想定义一个规则来阻止/允许 IP 列表。
标签: amazon-cloudformation amazon-waf