feat(findings): one finding for a rule that fires all over a repository (#464) #477

Merged
sharang merged 2 commits from feat/464-group-findings into main 2026-10-05 23:52:07 +00:00
Owner

Closes #464.

Grouping

If one scanner's rule produces more than 5 low/info findings in one repository, they become a single finding (pipeline/grouping.rs). It is applied after the vendor filter and before each stage saves its findings. Example: 38× mobsfscan android_logging → 1 finding.

  • Finding::occurrences holds every place (file:line). file_path/line_number point to the first one. The description lists up to 50 places, followed by "and N more".
  • The fingerprint is ("group", repo, scanner, rule) and does not depend on the places. Triage and status therefore carry over from scan to scan. A later scan updates the stored group's places, description and location (write_back).
  • Findings that were stored one per place are closed as Resolved with the new scan change Grouped, not NoLongerFound. Their tracker issues get a German/English comment saying so. Decided findings (false positive, accepted risk, …) are left alone. Lint findings at grouped places are closed this way too, even though lint never counts as "completed".
  • Issue sync creates one issue per group. The issue body lists the places. The existing-issue lookup for a group searches by fingerprint only: the group shares its title with the single findings' issues, so a title search would have matched one of those (which are being closed) and the group would never get an issue.
  • Configuration, checked at startup: FINDING_GROUP_THRESHOLD (default 5, or off), FINDING_GROUP_SCANNERS (mobsfscan=3,gitleaks=off) and FINDING_GROUP_SEVERITIES (default low,info).

gitleaks *.launch

generic-api-key no longer fires in Eclipse *.launch debugger configurations, which contain hex ids of probes and memory regions. Every hit in the pilot firmware repos was one of these. All other gitleaks rules still apply to those files. This is filtered on the Prüfwerk side, like the existing Firebase de-duplication.

Behaviour to be aware of

  • If a group shrinks to ≤ threshold, the group is closed as "no longer found" and the single findings come back (FoundAgain).
  • Existing .launch gitleaks findings will be closed as "no longer found" on the next gitleaks run.
  • A group does not inherit status from its members. If all 38 single findings were marked as false positives, the new group still opens as open. Follow-up if wanted.
  • The group fingerprint hashes the stored rule_id. Merge #473 (bare semgrep ids) first, otherwise semgrep groups move once.

Tests: unit tests for grouping, policy parsing, issue body/search and gitleaks. tests/group_findings.rs runs against Mongo and covers: 38 stored → 1 group plus 37 closed as grouped, rescan finds nothing new, places change and status is kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

Closes #464. ## Grouping If one scanner's rule produces more than 5 low/info findings in one repository, they become a single finding (`pipeline/grouping.rs`). It is applied after the vendor filter and before each stage saves its findings. Example: 38× mobsfscan `android_logging` → 1 finding. - `Finding::occurrences` holds every place (`file:line`). `file_path`/`line_number` point to the first one. The description lists up to 50 places, followed by "and N more". - The fingerprint is `("group", repo, scanner, rule)` and does not depend on the places. Triage and status therefore carry over from scan to scan. A later scan updates the stored group's places, description and location (`write_back`). - Findings that were stored one per place are closed as `Resolved` with the new scan change `Grouped`, not `NoLongerFound`. Their tracker issues get a German/English comment saying so. Decided findings (false positive, accepted risk, …) are left alone. Lint findings at grouped places are closed this way too, even though lint never counts as "completed". - Issue sync creates one issue per group. The issue body lists the places. The existing-issue lookup for a group searches by fingerprint only: the group shares its title with the single findings' issues, so a title search would have matched one of those (which are being closed) and the group would never get an issue. - Configuration, checked at startup: `FINDING_GROUP_THRESHOLD` (default 5, or `off`), `FINDING_GROUP_SCANNERS` (`mobsfscan=3,gitleaks=off`) and `FINDING_GROUP_SEVERITIES` (default `low,info`). ## gitleaks `*.launch` `generic-api-key` no longer fires in Eclipse `*.launch` debugger configurations, which contain hex ids of probes and memory regions. Every hit in the pilot firmware repos was one of these. All other gitleaks rules still apply to those files. This is filtered on the Prüfwerk side, like the existing Firebase de-duplication. ## Behaviour to be aware of - If a group shrinks to ≤ threshold, the group is closed as "no longer found" and the single findings come back (`FoundAgain`). - Existing `.launch` gitleaks findings will be closed as "no longer found" on the next gitleaks run. - A group does not inherit status from its members. If all 38 single findings were marked as false positives, the new group still opens as `open`. Follow-up if wanted. - The group fingerprint hashes the stored `rule_id`. Merge #473 (bare semgrep ids) first, otherwise semgrep groups move once. Tests: unit tests for grouping, policy parsing, issue body/search and gitleaks. `tests/group_findings.rs` runs against Mongo and covers: 38 stored → 1 group plus 37 closed as grouped, rescan finds nothing new, places change and status is kept. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang force-pushed feat/464-group-findings from 7b65b59213 to 65e14a2c4f 2026-10-05 23:11:37 +00:00 Compare
sharang force-pushed feat/464-group-findings from 65e14a2c4f to fd513cd6e8 2026-10-05 23:26:48 +00:00 Compare
sharang added 2 commits 2026-10-05 23:43:24 +00:00
More than five low or info findings of one scanner's rule in one
repository are now one finding that lists every place (file:line), so
38 identical logging findings in an Android app are one finding and one
tracker issue. Its fingerprint comes from (repository, scanner, rule),
not from a place, so triage and status stay with it from scan to scan;
a later scan updates its list of places.

Findings stored one per place before are closed with the new scan change
"grouped" (not "no longer found"), with a comment on their issues that
says so; a person's decision on one of them stays.

Configurable: FINDING_GROUP_THRESHOLD (default 5, or off),
FINDING_GROUP_SCANNERS (per scanner, e.g. mobsfscan=3,gitleaks=off),
FINDING_GROUP_SEVERITIES (default low,info); checked at startup.

gitleaks' generic-api-key no longer reports the hex ids in Eclipse
*.launch debugger configurations; every such hit in the pilot firmware
repositories was one. Its other rules still apply there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
fix(findings): a group's issue is found by its fingerprint only (#464)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m20s
687aed2c8c
A group has the title of its rule's single findings, so the title
fallback of the issue search found one of their issues (being closed as
grouped) and no issue was opened for the group. The refreshed places of
a stored group also set updated_at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang force-pushed feat/464-group-findings from fd513cd6e8 to 687aed2c8c 2026-10-05 23:43:24 +00:00 Compare
sharang merged commit 918c871a25 into main 2026-10-05 23:52:07 +00:00
Sign in to join this conversation.