Skip to content

detectors: emit unverified results instead of dropping them on verify…#4896

Draft
shahzadhaider1 wants to merge 1 commit intotrufflesecurity:mainfrom
shahzadhaider1:INS-288
Draft

detectors: emit unverified results instead of dropping them on verify…#4896
shahzadhaider1 wants to merge 1 commit intotrufflesecurity:mainfrom
shahzadhaider1:INS-288

Conversation

@shahzadhaider1
Copy link
Copy Markdown
Contributor

@shahzadhaider1 shahzadhaider1 commented Apr 17, 2026

Many detectors silently dropped results (via continue) when verification hit an indeterminate error: no host in cache, body-read failure, request construction failure, etc. This broke the contract that unverified results must still be emitted so downstream consumers can track last-seen state.
Replace those drops with SetVerificationError so the result is still returned with the error attached.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Touches verification paths across many detectors, changing control flow to always return findings with VerificationError instead of dropping them; broad surface area could affect result volume and downstream expectations.

Overview
Ensures detectors always emit a Result even when verification can’t be completed, replacing many continue/early-exit paths with Result.SetVerificationError(...) (including cached no such host, request/response body read failures, and other indeterminate errors).

Standardizes host/ID “no such host” caching behavior to skip verification but still return an unverified finding with an attached error across multiple detectors (e.g., Algolia, Artifactory, Azure variants, Salesforce, URI).

Improves MongoDB verification to treat authentication failures as determinate invalid credentials (returns false, nil) rather than surfacing them as verification errors.

Reviewed by Cursor Bugbot for commit dc3f466. Bugbot is set up for automated code reviews on this repo. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant