Registry / security / trufflehog3

trufflehog3

JSON →
library3.0.10pypypi✓ verified 81d ago

A secret scanner that finds hardcoded credentials, tokens, and secrets in your codebase. Version 3.0.10 supports Python >=3.7. Active development with regular releases.

pip install trufflehog3
INSTALL
IMPORT
SIG · TRUFFLEHOG3
T
trufflehog3
securitypythonv3.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DEFAULT_CONFIG_FILE
from trufflehog3 import DEFAULT_CONFIG_FILE
from trufflehog3 import scan
set_debug
from trufflehog3 import set_debug
from trufflehog3 import scan
helper
from trufflehog3 import helper
from trufflehog3 import scan

Run a basic secret scan on a directory.

from trufflehog3 import scan # Scan a directory for secrets with default rules results = scan(targets=['/path/to/repo']) for issue in results: print(issue.path, issue.line_number, issue.secret)
Debug
Known issues
breakingtrufflehog3 v3.0 introduced a completely rewritten API. The old CLI and Python API from v2 are incompatible.
fix
Use the new Python API: from trufflehog3 import scan, Config. Do not import from old modules like trufflehog.scanner.
affects: >=3.0.0
gotchaThe scan function returns a list of Issue objects, not a file handle or dict. Iterate directly over the result.
fix
Ensure results are iterated as shown in quickstart.
affects: all
deprecatedThe CLI command 'trufflehog3' still works but is considered legacy. The Python API is preferred for integration.
fix
Use the Python module instead of subprocess calls to trufflehog3 CLI.
affects: >=3.0.0
Upgrade
Version history
3.0.10latest on PyPI · released May 24, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
Resources
trufflehog3 — pip install trufflehog3 · libregistry