GitGuardian / ggshield

Find and fix 400+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
https://gitguardian.com
MIT License
1.59k stars 139 forks source link

Improve identification of binaries #841

Open agateau-gg opened 6 months ago

agateau-gg commented 6 months ago

Environment

Describe the bug

When iterating on a directory or a Docker image, ggshield often hits binaries, like executable files. We should not try to scan these files by default, at least until #396 is done.

Steps to reproduce:

  1. Scan a directory containing binaries, such as /usr/bin on a Unix system (ggshield secret scan path -ry /usr/bin)
  2. Notice ggshield tries to detect the encoding of the files

Expected result:

ggshield should silently skip binary files.