Skip to content

Bugfix/trufflehog detectors yaml#355

Open
shreelshah12 wants to merge 2 commits into
release/0.9.0from
bugfix/trufflehog_detectors_yaml
Open

Bugfix/trufflehog detectors yaml#355
shreelshah12 wants to merge 2 commits into
release/0.9.0from
bugfix/trufflehog_detectors_yaml

Conversation

@shreelshah12

Copy link
Copy Markdown
Contributor

Description

The shipped configs/trufflehog_detectors.yaml was invalid YAML, so the secret scanner failed to load it and silently ran with only the 3 built-in fallback detectors — the file's detectors were never applied. This fixes the structure (detectors nested under a detectors: key with correct indentation) so all detectors load.

It also adds support for an optional, git-ignored custom_trufflehog_detectors.yaml that is merged into the shipped detectors at scan time (with a .sample template), so customers can add their own detectors without editing the shipped file or losing them on upgrade.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (non-code changes like README or docs)

…ctor files

The shipped configs/trufflehog_detectors.yaml was invalid YAML, so
load_config_from_file() always threw, silently fell back to 3 built-in
detectors, and never loaded the file's detectors (GitHub issue: custom
detectors not applied; 'mapping values are not allowed here, line 6').

Two structural bugs fixed:
- detector item keys were over-indented (the line-6 parse error)
- detectors were a bare top-level sequence instead of being nested under
  the top-level 'detectors:' key the loader reads

Also:
- Make the fallback loud: log at ERROR that custom detectors are NOT
  applied, instead of masking a broken config.
- Support an optional, git-ignored custom_trufflehog_detectors.yaml that
  is merged into the shipped detectors (custom wins on name clash), so
  customers add their own without editing the shipped file. Adds a
  .sample template and .gitignore entry.

Co-authored-by: Isaac
Remove references to past behavior/bugs from comments and the fallback
log message; describe only what the files and code do.

Co-authored-by: Isaac
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