Skip to content

feat(modules): add fingerprint module type#356

Open
TBX3D wants to merge 3 commits into
vmfunc:mainfrom
TBX3D:spike/fingerprint-type
Open

feat(modules): add fingerprint module type#356
TBX3D wants to merge 3 commits into
vmfunc:mainfrom
TBX3D:spike/fingerprint-type

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.

TBX3D added 3 commits July 9, 2026 15:14
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.
@TBX3D
TBX3D requested a review from vmfunc as a code owner July 9, 2026 22:15
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 27 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/modules/fingerprint.go 80.23% 9 Missing and 8 partials ⚠️
internal/sifpath/sifpath.go 42.85% 2 Missing and 2 partials ⚠️
internal/httpx/httpx.go 0.00% 2 Missing ⚠️
internal/modules/loader.go 33.33% 1 Missing and 1 partial ⚠️
internal/modules/yaml.go 71.42% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
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.
📢 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.

@github-actions github-actions Bot added scan changes to scan engine modules changes to scan modules docs documentation changes tests test changes size/xl 500+ lines changed labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

pr summary

13 files changed (+588 -46)

category files
go source 12
tests 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs documentation changes modules changes to scan modules scan changes to scan engine size/xl 500+ lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants