You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every AWS region has a default VPC. So describeVpcs always returns at least one item, and the engine then issues 9 sequential per-VPC calls — in all 17 regions, regardless of whether the account uses that region. That is ~12 API calls per region floor, versus 1 for lambda or kms.
Batch the VPC actions. Most of those nine are describe* calls that accept filters — several could take Filters: [{vpc-id, [ids]}] once per region instead of once per VPC. Fewer calls, same data.
Skip regions with only a default and empty VPC. Cheaper than the Tagging API prune (PERF-16 · Revisit region-pruning defaults #79) and safer, since "default VPC with no instances, no NAT, no endpoints" is a positive signal rather than an absence of tags. Needs care — an empty-looking VPC can still hold a misconfigured security group or NACL, which is exactly what some rules look for.
Option 2 is the one that keeps coverage identical. Option 3 changes what gets looked at and needs the same scrutiny the Tagging API prune got.
Open questions
Are all nine per-VPC actions actually consumed by rules? scan:validate-rules reports 54 collected methods against 74 rules across 3 rulesets — worth checking whether any of these nine collect data no rule reads.
Priority: P1 — biggest single service cost, but #69 dilutes it, so this is not on the critical path
Part of #63. Found by the #64 baseline.
Problem
ec2 is 35% of total scan time — 259s of a 735s scan, at 15.24s per region against 2.1–3.4s for every other service:
The slowest jobs include regions with nothing in them —
ec2/sa-east-133s,ec2/eu-north-118s.Cause
rules/tasks/ec2/tasks.jsondeclares two tasks, and the second fans out hard:Every AWS region has a default VPC. So
describeVpcsalways returns at least one item, and the engine then issues 9 sequential per-VPC calls — in all 17 regions, regardless of whether the account uses that region. That is ~12 API calls per region floor, versus 1 forlambdaorkms.Options
describe*calls that accept filters — several could takeFilters: [{vpc-id, [ids]}]once per region instead of once per VPC. Fewer calls, same data.Option 2 is the one that keeps coverage identical. Option 3 changes what gets looked at and needs the same scrutiny the Tagging API prune got.
Open questions
scan:validate-rulesreports 54 collected methods against 74 rules across 3 rulesets — worth checking whether any of these nine collect data no rule reads.Priority: P1 — biggest single service cost, but #69 dilutes it, so this is not on the critical path