Skip to content

feat(finding): pluggable false-positive-history candidate filter#15238

Merged
Maffooch merged 1 commit into
devfrom
feat/fp-history-candidate-filter
Jul 14, 2026
Merged

feat(finding): pluggable false-positive-history candidate filter#15238
Maffooch merged 1 commit into
devfrom
feat/fp-history-candidate-filter

Conversation

@Maffooch

Copy link
Copy Markdown
Contributor

Supersedes #15155, which GitHub auto-closed when its base branch (#15143 feat/cwe-vuln-id-consolidation) was merged and its branch deleted. Same commit, authored by @valentijnscholten, rebased cleanly onto current dev (post #15145 + #15143 merges) — no code changes, conflict-free.

What this does

Adds a pluggable false-positive-history candidate filter. do_false_positive_history_batch resolves get_custom_method("FINDING_FALSE_POSITIVE_HISTORY_CANDIDATE_FILTER_METHOD") once per batch and applies it per finding (existing = fp_candidate_filter(finding, existing)). When no custom method is configured the guard skips it, so default behavior is byte-identical to before. This lets DefectDojo Pro plug in set-based (vulnerability-id / CWE) false-positive-history matching.

Includes unittests/test_false_positive_history_logic.py coverage (passthrough equivalence + the hook path).

🤖 Generated with Claude Code

Add FINDING_FALSE_POSITIVE_HISTORY_CANDIDATE_FILTER_METHOD hook to
do_false_positive_history_batch. When configured, the per-finding candidate
list resolved by the deduplication algorithm is passed through the plugin
method before the FP decision, letting a plugin (Pro) narrow candidates by
fields excluded from the hash string but compared per pair (set-match tokens
on vulnerability_ids / CWEs). Resolved once via get_custom_method; a no-op
when unset, so default behavior is unchanged.

Tests: hook can suppress matches (drops candidates -> no FP replication) and
passthrough matches the default path.
@Maffooch
Maffooch requested a review from blakeaowens as a code owner July 14, 2026 04:11
@Maffooch Maffooch added this to the 3.2.0 milestone Jul 14, 2026
@Maffooch
Maffooch requested a review from Jino-T July 14, 2026 05:59
@Maffooch
Maffooch merged commit 55ca4f8 into dev Jul 14, 2026
148 checks passed
@Maffooch
Maffooch deleted the feat/fp-history-candidate-filter branch July 14, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants