turbot / steampipe-plugin-aws

Use SQL to instantly query AWS resources across regions and accounts. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/aws
Apache License 2.0
189 stars 104 forks source link

Can't list CloudFront related AWS Web Acls using aws_wafv2_web_acl #1747

Closed SarasaGunawardhana closed 1 year ago

SarasaGunawardhana commented 1 year ago

Describe the bug I have CloudFront and Regional level AWS WAF V2 WebAcls.

aws_wafv2_web_acl query isn't listing CloudFront related Web Acls. Only Regional Web Acls are listing.

Steampipe version (steampipe -v) Steampipe v0.19.4

Plugin version (steampipe plugin list) +--------------------------------------------+---------+-------------+ | Installed Plugin | Version | Connections | +--------------------------------------------+---------+-------------+ | hub.steampipe.io/plugins/turbot/aws@latest | 0.101.0 | aws_dev | | hub.steampipe.io/plugins/turbot/rss@latest | 0.4.0 | rss | +--------------------------------------------+---------+-------------+

To reproduce

  1. First install steappipe cli and steampipe aws plugin.
  2. Configure aws.spc file and This is my steampipe aws config:
connection "aws_dev" {
 plugin = "aws"
 regions = ["*"] # Specific regions
 profile = "development"
}
  1. I wanted to list all aws Web Acls ( Cloudfront and Regional ). I wrote below query,
select
  name,
  scope
from
  aws_wafv2_web_acl;

output: +--------+----------+ | name | scope | +--------+----------+ | XXXXXX | REGIONAL | +--------+----------+

So I saw that this steampipe table isn't listing Cloudfront related WebAcls but only listing Regional data.

Then I wrote shell script using AWS CLI query to retrieve data and find the code below,

for region in $(aws ec2 describe-regions --profile development --output text | cut -f4); do
    echo "Region: ${region}"
    aws wafv2 list-web-acls --profile development --scope="CLOUDFRONT" --region="${region}"
    echo ""
done

And using this AWS CLI script, it is returning Cloudfront related web acls, but not from steampipe query.

Expected behavior Steampipe query (aws_wafv2_web_acl) should return both CloudFront and Regional AWS WAF V2 Web Acls

misraved commented 1 year ago

Welcome to Steampipe @SarasaGunawardhana, great to have you here 🎉 !!

Thanks for reporting the bug in such a detailed manner. We will try to get a fix out for this issue early next week 👍.