cloudcheck: skip storage-bucket regex pass for IP-only events - #3107
Merged
Conversation
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.
Contributor
🚀 Performance Benchmark Report
📊 Current Results (cloudcheck-skip-bucket-regex-for-ips) - Click to expandResults
🐍 Python Version 3.11.15 |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
ausmaster
self-requested a review
May 20, 2026 16:24
ausmaster
approved these changes
May 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inCloudCheck.handle_eventwhen every host inhosts_to_checkis an IP.Most useful on scans where
speculateexpands largeIP_RANGEevents into per-IPIP_ADDRESSevents, which then all flow through the single-threaded intercept chain.Benchmark
New
bbot/test/benchmarks/test_intercept_throughput_benchmarks.pyexercises 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):
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.