feat(modules): bridge fingerprint modules into framework detection#359
Open
TBX3D wants to merge 9 commits into
Open
feat(modules): bridge fingerprint modules into framework detection#359TBX3D wants to merge 9 commits into
TBX3D wants to merge 9 commits into
Conversation
the modules loader and the framework custom-signature loader each hand-rolled the same ~/.config/sif/<sub> (and %LocalAppData%\sif\<sub> on windows) path. extract internal/sifpath.UserSubdir and route both through it so the per-user layout is defined in one place. no behavior change: the helper reproduces the existing paths exactly.
the frameworks detector and the module executor each defined their own 5 MB body cap and ran the same io.ReadAll(io.LimitReader(...)) read. move the cap and the read into httpx.MaxBodySize / httpx.ReadCappedBody so both scanners share one ceiling instead of two consts that can drift. no behavior change: the cap value and read semantics are unchanged.
a `fingerprint` module identifies a technology by weighted body/header signatures scored into a confidence, with an optional version regex, rather than a boolean match. it fires one finding carrying the score once it reaches the threshold (default 0.5). this is the framework detectors' scoring in the module format, so a custom tech fingerprint lives alongside other modules. validated at load (signatures present, non-empty patterns, finite weights, confidence in [0,1], version regex compiles) and covered by yaml round-trip, validation, header, version and default-threshold tests. documented in docs/modules.md. shares the response body cap via httpx.ReadCappedBody.
pr summary18 files changed (+1089 -46)
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #359 +/- ##
=======================================
Coverage ? 55.20%
=======================================
Files ? 84
Lines ? 7009
Branches ? 0
=======================================
Hits ? 3869
Misses ? 2863
Partials ? 277 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e2ba979 to
76ae304
Compare
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.
a fingerprint module (feat: add fingerprint module type, this PR's first three commits) and a framework detector can independently identify the same technology, which would surface it twice in a scan's output. this bridges default-confidence, root-scoped fingerprint modules into the framework detector registry, so a fingerprint hit that matches a framework detector's own coverage is deduplicated rather than double-reported, and marks the legacy custom-signature (signatures dir) path as deprecated in favor of fingerprint modules going forward without removing it. covered by tests proving the fingerprint and framework confidence scorers agree on shared inputs, pinning the zero-weight divergence and strict-detection-threshold edge cases, and freezing the legacy signature path's existing load/score behavior so this doesn't quietly change it.
stacked on #355 (shared sifpath/httpx helpers) and #356 (fingerprint module type) - both open. this branch includes their commits so it builds standalone; rebasing after they merge should drop those commits as already-applied.