Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpc_rules_per_sg is returning incorrect count for one of the SG #44

Open
agrevtsev opened this issue Jan 8, 2023 · 2 comments
Open

Comments

@agrevtsev
Copy link

Hi! I'm getting incorrect rules count for specific SG (according to AWS console - this group have 230 inbound, 1 outbound rule).
Other SGs have (inbound+outbound)<10 and displayed correctly. Maybe it's some paging issue?
I got such results on latest master, fix-cf-stack-counting branches.

Best regards!

AWS console

When checking rules count over aws cli

aws ec2 describe-security-group-rules --region us-east-1 --profile sso-prod --filter Name="group-id",Values="sg-xxxx" | jq -r '.SecurityGroupRules | length'
231

When checking rules count using aws-quota-checker

/usr/local/bin/aws-quota-checker check vpc_rules_per_sg
AWS profile: default | AWS region: us-east-1 | Active checks: vpc_rules_per_sg
Collecting checks  [####################################]  100%
Rules per VPC security group [****/us-east-1/sg-xxxx]: 66/333 ✓
@agrevtsev
Copy link
Author

Yep it seems amazon returns wrong number

aws ec2 describe-security-groups --region us-east-1 --profile sso-prod --filter Name="group-id",Values="sg-xxxx" | grep IpProtocol | wc -l
66

@agrevtsev
Copy link
Author

It seems that IpPermissions it's not exactly equivalent of SecurityGroupRules. IpPermissions it's kind a summary, where one IpPermission object can describe a couple of SecurityGroupRules. IMHO it's a little bit incorrect to use IpPermissions vs vpc_rules_per_sg_limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant