Skip to content

Back to the catalog

Hawk-Eye
github.comrepo

Hawk-Eye

Hawk-Eye is a Python CLI tool that scans S3, MySQL, PostgreSQL, MongoDB, CouchDB, Google Drive, Slack, Redis, Firebase, GCS, and local filesystems for PII and secrets exposure. It uses OCR and text analysis to inspect documents (docx, xlsx, pptx, pdf), images, archives, and video files, with configurable regex fingerprints, Slack alerting, and JSON output for CI/CD integration.

TL;DR CLI tool for scanning cloud storage, databases, and messaging platforms for PII and hardcoded secrets.
Document

What it is

Hawk-Eye (installed as the hawk-scanner / hawk_scanner package) is a Python CLI for scanning data sources for PII and secrets. Beyond the capability list in the summary, the page documents concrete operational details an adopter needs before committing: install-time dependency quirks, a default-behavior gotcha, and a Python-library embedding path.

How to run it

Each source has its own subcommand (fs, s3, gcs, mysql, redis, firebase, slack, postgresql, couchdb, gdrive, text). Two YAML files drive it: connection.yml (source profiles + Slack notify block with redacted and suppress_duplicates options) and fingerprint.yml (regex fingerprints). Typical run:

hawk_scanner all --connection connection.yml --fingerprint fingerprint.yml --json output.json --debug

For CI/CD, connection config can be passed inline instead of by file, with --stdout --quiet:

hawk_scanner fs --connection-json '{"sources": {"fs": {"fs1": {"quick_scan": true, "path": "/path/KYC_PDF.pdf"}}}}' --stdout --quiet --fingerprint fingerprint.yml

It can also be embedded in Python, optionally with inline fingerprints:

from hawk_scanner.internals import system
pii = system.scan_file("/path/Resume.pdf")
print(pii)

Preconditions / gotchas

  • Default runs everything. If you invoke it with no subcommand, it runs all scanners (firebase, fs, gcs, mysql, text, couchdb, gdrive, gdrive workspace, slack, postgresql, redis) by default — scope your command explicitly.
  • PostgreSQL needs a manual dependency. psycopg2-binary is not shipped with the package (author cites Windows incompatibility): pip3 install psycopg2-binary.
  • RedHat/OCR dependency. The cv2 dependency can error on RedHat until you install yum install mesa-libGL.
  • Docker usage requires mounting both connection.yml and fingerprint.yml into /app and passing --platform linux/amd64.

Install

pip3 install hawk-scanner

Or from source: clone, pip3 install -r requirements.txt, then python3 hawk_scanner/main.py.

Caveats

Commercial support is offered via the author's LinkedIn/Twitter/Slack rather than a formal channel. The page is largely README/marketing prose; the feature list matches the summary, and no versioning, benchmark, or accuracy data is given for the "advanced algorithms" / OCR detection it claims.

Technologies named here

  • Hawk Eye
  • psycopg2-binary
  • cv2
  • Amazon S3
  • MySQL
  • PostgreSQL
  • MongoDB
  • CouchDB
  • Google Cloud Storage

Techniques named here

  • PII and secret detection via deep scanning
  • Customizable fingerprint-based scanning
  • Real-time Slack alerting with mentions