我可以将两个或多个 Web ACL (WAF) 关联到单个 Cloudfront 分配吗?

Can I associate two or more Web ACLs (WAF) to a single Cloudfront distribution?

因此,在 Cloudfront 的控制台 (web ui) 中,当创建分配时,有一个用于我们要分配给它的 WAF 的保管箱。但是如果我想给它分配第二个,它会替换第一个。

在文档中,我没有明确发现分配 2 个 WAF 是不可能的。那么有没有办法可以使用 awscli 或任何其他方法来实现这一点?

不,您不能将多个 Web ACL 关联到 CloudFront 分配。但是,您可以将所有规则合二为一,并在可能的情况下将该 ACL 与 CF 分布相关联。

没有。您不能将多个 Web ACL 关联到一个资源类型(例如:cloudfront/API 网关等)。

Restrictions on multiple associations

You can associate a single web ACL with one or more AWS resources, according to the following restrictions:

You can associate each AWS resource with only one web ACL. The relationship between web ACL and AWS resources is one-to-many.

You can associate a web ACL with one or more CloudFront distributions. You can't associate a web ACL that you've associated with a CloudFront distribution with any other AWS resource type.

https://docs.aws.amazon.com/waf/latest/developerguide/web-acl-associating-aws-resource.html