Secret Verification with TruffleHog
Pipeleek integrates TruffleHog v3 to automatically detect and verify secrets in CI/CD logs and artifacts. TruffleHog provides many detectors for various services and platforms, each with built-in verification capabilities.
How It Works
When Pipeleek scans logs or artifacts, it uses two detection engines in parallel:
- Pattern-based detection: Custom YAML rules from
rules.ymlcollected by Secrets Patterns Database - TruffleHog detectors: Specialized detectors with active verification
The TruffleHog engine:
- Scans text for secrets using pattern matching
- Extracts potential credentials (API keys, tokens, passwords)
- Verifies credentials by attempting authentication with the target service
- Reports only verified secrets (by default)
Confidence Levels
Pipeleek assigns confidence levels to all detected secrets:
| Level | Source | Description | Verified |
|---|---|---|---|
| high-verified | TruffleHog | Actively verified and confirmed working | ✅ Yes |
| trufflehog-unverified | TruffleHog | Detected but not verified (verification disabled) | ❌ No |
| high | rules.yml | High confidence pattern match | ❌ No |
| medium | rules.yml | Medium confidence pattern match | ❌ No |
| low | rules.yml | Low confidence pattern match | ❌ No |
| custom | rules.yml | User-defined confidence level | ❌ No |
Disabling Verification
For operational security (OpSec) or simply due to privacy concerns, you should disable verification.
Use the --truffle-hog-verification=false flag:
Confidence Filtering
Results can be filtered by confidence, using the --confidence flag.
Custom Rules
To scan for a specific pattern, edit the rules.yml file Pipeleek creates on the first run. You can remove/add/alter rules as you like.
By default the rules look something like this:
You can create additional custom rules.
💡Tip: Test your regexes at regex101.com (select Golang flavor).
A simple example that detects strings that follow the Regex pattern PIPELEEK_.* and that are logged with a custom confidence:
When you run Pipeleek, you'll see results for your custom rule and any built-in rules: