如何解决在cloudformation模板的不同WAFv2 WebACL中重用同一规则
在旧版WAF中,我可以定义一个规则,然后在不同的WebACL中使用它,如下所示:
HasAutorization:
Type: "AWS::WAFRegional::ByteMatchSet"
Properties:
Name: "ByteMatch for matching Authorization header"
ByteMatchTuples:
- FieldToMatch:
Type: "HEADER"
Data: "Authorization"
TargetString: "bearer"
TextTransformation: "LOWERCASE"
PositionalConstraint: "CONTAINS_WORD"
AuthorizationRule:
Type: AWS::WAFRegional::Rule
Properties:
MetricName: AuthorizationRule
Name: AuthorizationRule
Predicates:
- DataId: !Ref HasAutorization
Negated: false
Type: ByteMatch
DashboardACL:
Type: "AWS::WAFRegional::WebACL"
Properties:
Name: "Protect backend from attacks"
DefaultAction:
Type: "BLOCK"
MetricName: "DashboardACL"
Rules:
- Action:
Type: "ALLOW"
Priority: 1
RuleId: !Ref "AuthorizationRule"
GatewayACL:
Type: "AWS::WAFRegional::WebACL"
Properties:
Name: "Protect platform from attacks"
DefaultAction:
Type: "BLOCK"
MetricName: "DashboardACL"
Rules:
- Action:
Type: "ALLOW"
Priority: 1
RuleId: !Ref "AuthorizationRule"
有没有一种方法可以在WAFv2中做同样的事情?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。