HOW CAN WE LIST ALL Web ACLs and the all the rules inside of those Web ACLs.

0

I'm trying to find any code in cli which I can execute in cloudshell to extract the LIST of ALL Web ACLs and the all the rules inside of those Web ACLs using some for loop. The output should be in text or it can be in csv format.

In both ways using AWS WAF Classic or the new AWS WAF.

2개 답변
0

There is no direct way to list ACLs alongwith rules, needs to be two step process, first you list ACLs and then rules. Please check the below two links.

https://docs.aws.amazon.com/cli/latest/reference/waf/list-web-acls.html https://docs.aws.amazon.com/cli/latest/reference/wafv2/list-resources-for-web-acl.html

AWS
Rishi
답변함 일 년 전
0

WAFv2 (the newest WAF) has a nice property where all rules are explicitly listed inside web ACL. You have to fetch the list of web ACLs using list-web-acls and then cycle through the list to fetch individual web ACL using get-web-acl. Pipe the output into a file.

For WAF Classic, the process is similar but rules are referenced from web ACL. So you need to do addition step of cycling through the rules inside web ACL and then fetch individual rule using get-rule. Note the difference in API documentation for WAF Classic and WAFv2.

Doable in most shell using CLI but probably easier to use scripting language like Python for better formatting.

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠