Skip to content

Migrate to asndb library#2957

Merged
liquidsec merged 11 commits intoasn-as-targetsfrom
migrate-to-asndb-library
Mar 6, 2026
Merged

Migrate to asndb library#2957
liquidsec merged 11 commits intoasn-as-targetsfrom
migrate-to-asndb-library

Conversation

@liquidsec
Copy link
Collaborator

No description provided.

- BaseTarget no longer subclasses RadixTarget; uses composition instead
- Rename strict_dns_scope -> strict_scope everywhere
- Update host_size_key import path for radixtarget 4.x
- Handle radixtarget 4.x API changes (strings-only, no _add, hash is int)
- Skip acl_mode when strict_scope is True (mutually exclusive in 4.x)
- Update test assertions for new hash values and string-based hosts

Work in progress - more test fixes needed.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Performance Benchmark Report

Failed to generate detailed benchmark comparison

The benchmark comparison failed to run. This might be because:

  • Benchmark tests don't exist on the base branch yet
  • Dependencies are missing
  • Test execution failed

Please check the workflow logs for details.

Benchmark artifacts may be available for download from the workflow run.

…cope filtering

- Remove ASN event emission (already handled by asn report module via asndb)
- Replace scope_distance_modifier+filter_event with proper in_scope_only class attr
- Dynamically set scope_distance_modifier=1 when in_scope_only option is disabled
- Add tests for in_scope_only=True and in_scope_only=False behavior
@property
def hash(self):
"""Blacklist hash includes both hosts and regex patterns."""
h = (self._rt.hash ^ _fnv1a_64(sorted(r.pattern for r in self.blacklist_regexes))) & 0xFFFFFFFFFFFFFFFF
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the & 0xFFFFFFFFFFFFFFFF necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python, integers have arbitrary precision — the ^ (XOR) of two values could produce a result wider than 64 bits depending on the inputs. The mask ensures we get a consistent unsigned 64-bit value.

Copy link
Collaborator

@TheTechromancer TheTechromancer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

@liquidsec liquidsec merged commit e0dc57f into asn-as-targets Mar 6, 2026
13 of 14 checks passed
@liquidsec liquidsec deleted the migrate-to-asndb-library branch March 6, 2026 17:15
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 94.71154% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 92%. Comparing base (c2052a4) to head (7f33c76).
⚠️ Report is 653 commits behind head on asn-as-targets.

Files with missing lines Patch % Lines
bbot/scanner/target.py 90% 10 Missing ⚠️
bbot/core/event/helpers.py 92% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           asn-as-targets   #2957     +/-   ##
================================================
- Coverage              92%     92%     -0%     
================================================
  Files                 409     436     +27     
  Lines               34189   36158   +1969     
================================================
+ Hits                31129   32917   +1788     
- Misses               3060    3241    +181     

☔ 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.

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