Skip to content

cloudcheck: skip storage-bucket regex pass for IP-only events - #3107

Merged
liquidsec merged 1 commit into
devfrom
cloudcheck-skip-bucket-regex-for-ips
May 20, 2026
Merged

cloudcheck: skip storage-bucket regex pass for IP-only events#3107
liquidsec merged 1 commit into
devfrom
cloudcheck-skip-bucket-regex-for-ips

Conversation

@liquidsec

Copy link
Copy Markdown
Collaborator

Summary

Bucket-hostname regexes (.amazonaws.com, .r2.dev, .blob.core.windows.net, etc.) are anchored to literal cloud-provider suffixes and can never match a bare IP literal. Skip the regex loop in CloudCheck.handle_event when every host in hosts_to_check is an IP.

Most useful on scans where speculate expands large IP_RANGE events into per-IP IP_ADDRESS events, which then all flow through the single-threaded intercept chain.

Benchmark

New bbot/test/benchmarks/test_intercept_throughput_benchmarks.py exercises the intercept pipeline under IP-heavy workloads (no module-specific assumptions, reusable for future intercept-chain changes).

Median runtime, /22 + /20 IP_RANGE scans (3 rounds + 1 warmup, pytest-benchmark):

scenario before after Δ
/22 (1024 IPs) 774 ms 748 ms −3.3%
/20 (4096 IPs) 701 ms 669 ms −4.5%

Small but consistent. The regex skip is essentially free in the not-IP case (one all(is_ip(h)) check) and behavior is unchanged for any hostname workload.

Bucket-hostname regexes are anchored to provider-specific suffixes
(`.amazonaws.com`, `.r2.dev`, etc.) and can never match a bare IP
literal. Skip the regex loop when every host in `hosts_to_check` is
an IP — relevant for scans where `speculate` expands large IP_RANGE
events into per-IP IP_ADDRESS events.

Adds a generic intercept-pipeline throughput benchmark covering the
single-threaded intercept chain (dnsresolve, cloudcheck, speculate,
etc.) under an IP-heavy workload.
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Performance Benchmark Report

ℹ️ No baseline benchmark data available

Showing current results for cloudcheck-skip-bucket-regex-for-ips only.

📊 Current Results (cloudcheck-skip-bucket-regex-for-ips) - Click to expand

Results

Test Name Mean Time Ops/sec Min Max
Bloom Filter Dns Mutation Tracking Performance 4.25ms 235.1 ops/sec 4.23ms 4.31ms
Bloom Filter Large Scale Dns Brute Force 17.44ms 57.3 ops/sec 17.10ms 17.72ms
Large Closest Match Lookup 354.87ms 2.8 ops/sec 351.17ms 358.36ms
Realistic Closest Match Workload 190.29ms 5.3 ops/sec 188.47ms 191.28ms
Event Memory Medium Scan 2.133s 0.5 ops/sec 2.081s 2.192s
Event Memory Large Scan 10.666s 0.1 ops/sec 10.547s 10.739s
Event Validation Full Scan Startup Small Batch 407.32ms 2.5 ops/sec 401.62ms 410.15ms
Event Validation Full Scan Startup Large Batch 586.02ms 1.7 ops/sec 567.42ms 631.99ms
Make Event Autodetection Small 30.88ms 32.4 ops/sec 30.57ms 31.13ms
Make Event Autodetection Large 316.71ms 3.2 ops/sec 315.08ms 318.89ms
Make Event Explicit Types 13.94ms 71.8 ops/sec 13.84ms 14.10ms
Excavate Single Thread Small 3.947s 0.3 ops/sec 3.881s 4.028s
Excavate Single Thread Large 9.715s 0.1 ops/sec 9.569s 9.856s
Excavate Parallel Tasks Small 4.138s 0.2 ops/sec 4.070s 4.174s
Excavate Parallel Tasks Large 6.562s 0.2 ops/sec 6.518s 6.602s
Intercept Throughput Small 996.07ms 1.0 ops/sec 969.84ms 1.048s
Intercept Throughput Medium 1.025s 1.0 ops/sec 969.37ms 1.071s
Is Ip Performance 3.18ms 314.2 ops/sec 3.13ms 6.69ms
Make Ip Type Performance 11.44ms 87.4 ops/sec 11.36ms 11.73ms
Mixed Ip Operations 4.52ms 221.2 ops/sec 4.48ms 4.85ms
Memory Use Web Crawl 521ns 1919.4K ops/sec 521ns 521ns
Memory Use Subdomain Enum 541ns 1848.4K ops/sec 541ns 541ns
Memory Use Deep Chain 592ns 1689.2K ops/sec 592ns 592ns
Memory Use Parallel Chains 611ns 1636.7K ops/sec 611ns 611ns
Scan Throughput 100 4.182s 0.2 ops/sec 4.077s 4.305s
Scan Throughput 1000 31.505s 0.0 ops/sec 31.113s 31.935s
Typical Queue Shuffle 64.03µs 15.6K ops/sec 58.36µs 828.25µs
Priority Queue Shuffle 728.63µs 1.4K ops/sec 676.96µs 1.55ms

🐍 Python Version 3.11.15

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.82609% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 90%. Comparing base (d56548d) to head (8f03afe).
⚠️ Report is 37 commits behind head on dev.

Files with missing lines Patch % Lines
...benchmarks/test_intercept_throughput_benchmarks.py 43% 12 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3107   +/-   ##
=====================================
- Coverage     90%     90%   -0%     
=====================================
  Files        444     445    +1     
  Lines      38383   38399   +16     
=====================================
+ Hits       34320   34334   +14     
- Misses      4063    4065    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ausmaster
ausmaster self-requested a review May 20, 2026 16:24
@liquidsec
liquidsec merged commit b4778f3 into dev May 20, 2026
20 checks passed
@liquidsec liquidsec mentioned this pull request Jun 9, 2026
@ausmaster
ausmaster deleted the cloudcheck-skip-bucket-regex-for-ips branch June 11, 2026 01:27
@ausmaster ausmaster added this to the BBOT 3.0 - blazed_elijah milestone Jun 26, 2026
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

Successfully merging this pull request may close these issues.

2 participants