Skip to content

Conversation

@vlsi
Copy link
Contributor

@vlsi vlsi commented Nov 12, 2025

This commit adds the ability to detect and flag binary artifacts in git repositories.

Changes:

  • Add isBinaryFile() method in FileUtils.java that detects binary files by checking if the first 16KiB contains zero bytes
  • Add matchesAnyPattern() method to support pattern-based exclusions
  • Add binary-exclude configuration option in dictionary format to whitelist known binary files by name patterns
  • Update RunnableSigsLoader to load binary exclusion patterns from dictionary
  • Modify RunnableScanner to detect binary files before text scanning and flag them as BINARY_ARTIFACT if not excluded
  • Update README.md with documentation and examples for the new feature

The feature allows users to:

  1. Automatically detect binary files in repositories (files with zero bytes in first 16KiB)
  2. Exclude known/legitimate binary files using regex patterns
  3. Get warnings for unexpected binary artifacts that may have been accidentally committed

This commit adds the ability to detect and flag binary artifacts in git repositories.

Changes:
- Add isBinaryFile() method in FileUtils.java that detects binary files by checking if the first 16KiB contains zero bytes
- Add matchesAnyPattern() method to support pattern-based exclusions
- Add binary-exclude configuration option in dictionary format to whitelist known binary files by name patterns
- Update RunnableSigsLoader to load binary exclusion patterns from dictionary
- Modify RunnableScanner to detect binary files before text scanning and flag them as BINARY_ARTIFACT if not excluded
- Update README.md with documentation and examples for the new feature

The feature allows users to:
1. Automatically detect binary files in repositories (files with zero bytes in first 16KiB)
2. Exclude known/legitimate binary files using regex patterns
3. Get warnings for unexpected binary artifacts that may have been accidentally committed
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.

2 participants