feat(modules): add fingerprint module type#356
Open
TBX3D wants to merge 3 commits into
Open
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.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #356 +/- ##
=======================================
Coverage ? 55.04%
=======================================
Files ? 83
Lines ? 6965
Branches ? 0
=======================================
Hits ? 3834
Misses ? 2852
Partials ? 279 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pr summary13 files changed (+588 -46)
|
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 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) - the framework detectors' scoring approach, in the module format, so a custom tech fingerprint can live 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.
depends on #355: the first two commits here are that PR's shared sifpath/httpx helpers (fingerprint.go uses httpx.ReadCappedBody), included so this branch builds standalone. once #355 merges, rebasing this one should drop those two commits as already-applied and leave only the fingerprint commit.