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
188 stars 98 forks source link

Duplicate Inline Policies on AWS plugins #1343

Closed maxx225566 closed 1 year ago

maxx225566 commented 1 year ago

Describe the bug

If the AWS IAM User has multiple Inline Policies, the result will only display the first duplicate record

Steampipe version (steampipe -v) Example: steampipe version 0.16.4

To reproduce steampipe or steampipe-mod-aws-insights

Expected behavior Multiple Inline Policies should show multiple different records, not multiple same records.

Additional context Duplicate records will show the first created Inline Policy

e-gineer commented 1 year ago

Thanks @maxx225566 for raising this issue. I've transferred it to the AWS insights repo as it seems specific to that.

Which dashboard doors this relate to?

Could you provide some more context / example output for the problem you are seeing please?

maxx225566 commented 1 year ago

For example I have an IAM User with two Inline Policies(local, local2)

SELECT jsonb_array_length(inline_policies), inline_policies from aws_iam_user where name = 'iam_user'

result...

jsonb_array_length = 2 inline_policies = [{"PolicyName": "local", "PolicyDocument": {"Version": "2012-10-17", "Statement": [....], "Effect": "Allow", "Resource": ""}]}}, {"PolicyName": "local", "PolicyDocument": {"Version": "2012-10-17", "Statement": [....], "Effect": "Allow", "Resource": ""}]}}]

Although two records will be displayed, it is a duplicate record (PolicyName": "local")

maxx225566 commented 1 year ago

Also this is a plugins(aws) issue not mods, I have fixed the title.

misraved commented 1 year ago

Thanks @maxx225566 for adding the details of the issue.

I will transfer it to the AWS plugin repository.