Registry / auth-security / trufflehogregexes

trufflehogregexes

JSON →
library0.0.7pypypiunverified

trufflehogregexes is a Python package that provides the core regular expressions used by the TruffleHog secrets scanner. It offers a structured list of dictionaries, each containing a regex pattern, ID, name, and tags for various sensitive information. Currently at version 0.0.7, it has a low release cadence, primarily serving as a data dependency for the main TruffleHog application.

auth-security
Install & Compatibility
Where this runs
tested against v0.0.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

from truffleHogRegexes import regexes

This example demonstrates how to import and inspect the `regexes` list. It also shows a basic way to iterate and apply one of the regexes using Python's `re` module, as the package only provides the patterns, not the matching logic.

from trufflehogregexes import regexes # The 'regexes' variable is a list of dictionaries print(f"Total regexes available: {len(regexes)}") if regexes: first_regex = regexes[0] print(f"\nExample regex entry:") print(f" ID: {first_regex.get('id')}") print(f" Name: {first_regex.get('name')}") print(f" Regex: {first_regex.get('regex')}") print(f" Tags: {first_regex.get('tags')}") # To actually use a regex, you'd compile and run it: import re test_string = "My private key is: AKIAIOSFODNN7EXAMPLE" for r_entry in regexes: pattern = r_entry.get('regex') if pattern: # Note: some regexes might require 're.DOTALL' or other flags match = re.search(pattern, test_string) if match: print(f"\nMatch found for '{r_entry.get('name')}': {match.group(0)}") break # Found one match for demonstration
Debug
Known footguns
gotchaThe `regexes` list is a module-level variable, not a function. Do not attempt to call it or use a `get_regexes()` style accessor.
gotchaThis package provides only the regular expression patterns as data; it does not include any regex matching or scanning functionality. Users must integrate their own regex engine (e.g., Python's `re` module) to apply these patterns.
gotchaAs a pre-1.0.0 package (current version 0.0.7), the structure of regex entries (e.g., dictionary keys like 'id', 'name', 'regex', 'tags') might change in minor versions without strict backward compatibility guarantees.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
4
ahrefsbot
4
petalbot
2
script
1
googlebot
1
Resources