Skip to content

Graceful asndb failure handling and report-phase cache fix - #3219

Merged
liquidsec merged 4 commits into
devfrom
asndb-fallback
Jun 23, 2026
Merged

Graceful asndb failure handling and report-phase cache fix#3219
liquidsec merged 4 commits into
devfrom
asndb-fallback

Conversation

@liquidsec

@liquidsec liquidsec commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #3215
Closes #3227

  • ASN-as-targets (bbot -t ASN:15169): retries 3 times with a 3-second delay between attempts. If all retries fail, the scan aborts cleanly with a message directing the user to look up CIDR ranges manually and pass them directly with -t.
  • Mid-scan ASN lookups (asn report module, waf_bypass): circuit breaker on ASNHelper trips after 5 consecutive failures, logs a single prominent warning, and returns UNKNOWN_ASN for all subsequent calls without hitting the network. The scan continues without ASN enrichment data.
  • Cache key type normalization: asn_to_subnets() (used by ASN-as-target seed expansion) normalizes its input to int before calling asndb's lookup_asn(), matching asndb's int-keyed LRU cache so repeated lookups hit the cache instead of the network.
  • Shared ASNHelper for seed expansion: ASN seed expansion routes through the shared, API-key-aware ASNHelper instead of a throwaway un-keyed ASNDB() client. generate_children() takes a required helpers argument.
  • Report-phase network elimination: report() reads ASN metadata stored during handle_event() instead of re-fetching it from the API. Zero network calls at end of scan.
  • Regression tests: report() makes no network requests; ASN-as-target retry/abort behavior; and seed expansion through the shared ASNHelper.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🚀 Performance Benchmark Report

⚠️ No current benchmark data available

This might be because:

  • Benchmarks failed to run
  • No benchmark tests found
  • Dependencies missing

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.32432% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90%. Comparing base (ef65b09) to head (e310d5f).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
bbot/core/event/helpers.py 86% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             dev   #3219    +/-   ##
======================================
+ Coverage     90%     90%    +1%     
======================================
  Files        453     453            
  Lines      46101   46203   +102     
======================================
+ Hits       41211   41325   +114     
+ Misses      4890    4878    -12     

☔ View full report in Codecov by Harness.
📢 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.

@liquidsec liquidsec added this to the BBOT 3.0 - blazed_elijah milestone Jun 19, 2026
@liquidsec liquidsec added the bug Something isn't working label Jun 20, 2026
@liquidsec liquidsec changed the title Graceful asndb API failure handling Graceful asndb failure handling and report-phase cache fix Jun 20, 2026
@ausmaster
ausmaster self-requested a review June 23, 2026 18:29
@liquidsec
liquidsec merged commit 6e27452 into dev Jun 23, 2026
17 checks passed
@liquidsec
liquidsec deleted the asndb-fallback branch June 23, 2026 19:48
@liquidsec liquidsec mentioned this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high-priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants