Secret Pattern Sample Checker
Scan config, log and ticket samples for secret-like values with masked findings plus provider signatures, entropy scoring and rotation guidance.| Line | Pattern | Severity | Confidence | Identifier | Value | Evidence | Next action | Copy |
|---|---|---|---|---|---|---|---|---|
| {{ row.line }} | {{ row.pattern }} | {{ row.severity }} | {{ row.confidence }} | {{ row.identifier }} | {{ row.value }} | {{ row.evidence }} | {{ row.next_action }} |
| Section | Item | Status | Detail | Copy |
|---|---|---|---|---|
| {{ row.section }} | {{ row.item }} | {{ row.status }} | {{ row.detail }} |
| Pattern | Family | Hits | Confidence | Evidence | Next action | Copy |
|---|---|---|---|---|---|---|
| {{ row.pattern }} | {{ row.family }} | {{ row.hits }} | {{ row.confidence }} | {{ row.evidence }} | {{ row.next_action }} |
Secrets leak into places built for sharing: configuration snippets, build logs, support tickets, copied headers, infrastructure plans, and screenshots. Provider-specific tokens often have recognizable prefixes and lengths, while passwords and connection strings may reveal themselves only through a sensitive name, an opaque value, or surrounding context.
Pattern scanning is triage. A strong signature can identify a value that deserves immediate containment, but a matching shape does not prove that the credential is live. Entropy can help find random-looking assignments, yet it also catches hashes, identifiers, fixtures, and compressed data. Conversely, a short or predictable secret may have low entropy and evade generic scoring.
| Signal | Strength | Limit |
|---|---|---|
| Provider-shaped token | Specific prefix and length narrow the possibilities | Format alone cannot confirm validity or ownership |
| Private-key boundary | Strong evidence of key material in the text | A sample key may still be intentionally fake |
| Sensitive assignment name | Connects a value to password, token, or key context | Placeholders and secret-manager references can look similar |
| High character entropy | Highlights opaque, random-looking values | Many harmless identifiers are also high entropy |
When a real secret may have been exposed, removal from the visible text is not enough. Revoke or rotate it at the issuing service, update dependent systems, inspect relevant activity, and remove the value from logs, tickets, or history where policy permits. Masked evidence reduces accidental redistribution during review, but masking does not contain the original exposure.
How to Use This Tool:
Use the smallest relevant excerpt and keep exact values masked during ordinary review.
- Paste a config, log, ticket, header, infrastructure, dotenv, or code excerpt under Sample text. Give it a harmless label that contains no credential.
- Choose Balanced review for normal triage, Strict high-confidence patterns to reduce generic findings, or Broad triage for a wider manual sweep.
- Keep Masked evidence enabled. Include generic assignments for config and dotenv text; disable them when only recognized provider shapes matter.
- Review critical and high findings first. Confirm the issuing service and context before escalating a sample cue or low-confidence assignment.
- For a real exposure, revoke or rotate the credential outside the checker and investigate its use. Do not treat a cleared ledger as proof that the source is safe.
Interpreting Results:
The finding count covers the complete scan. The Finding rows limit affects only how many sorted entries are shown, so aggregate severity counts can be larger than the visible ledger.
- Critical identifies a private-key block. High usually identifies a provider-shaped token, credentialed URL, authorization value, or high-confidence generic assignment.
- Medium and Low generic findings need more context because their score is less decisive.
- A sample or test cue lowers generic confidence and adds a caution to direct-pattern evidence, but it never proves that the value is harmless.
- No findings means none of the supported direct signatures or enabled generic rules crossed their thresholds. It does not validate the text or search commit history.
Technical Details:
Scanning follows two paths. Direct signatures search the complete text for known token, key, authorization, and connection-string shapes. Contextual assignment rules then inspect sensitive names and score non-overlapping values by length, entropy, character variety, and sample cues.
Rule Core:
| Pattern | Recognized shape | Severity and confidence |
|---|---|---|
| Private key block | PEM private-key begin and end boundaries | Critical, high |
| AWS access key ID | AKIA or ASIA plus 16 uppercase letters or digits | High, high |
| GitHub token | ghp_, gho_, ghu_, ghs_, or ghr_ with a long body | High, high |
| GitHub fine-grained token | github_pat_ with a long body | High, high |
| GitLab token | glpat- with at least 20 token characters | High, high |
| Stripe secret or restricted key | sk_ or rk_, live or test, with at least 16 body characters | High, high |
| Slack token or webhook | xox token families or a complete incoming-webhook path | High, high |
| Google API key | AIza plus 35 key characters | High, high |
| npm token | npm_ plus at least 36 alphanumeric characters | High, high |
| HTTP Basic authorization | A Basic credential with at least 12 Base64 characters | High, medium |
| HTTP Bearer token | A Bearer value with at least 16 token characters | High, medium |
| Credentialed URL | Supported database, queue, mail, or file URL containing user and password material | High, high |
| JWT-like token | Three long Base64URL-style segments beginning with eyJ | Medium, medium |
Direct findings are not filtered by the scan profile or entropy threshold. Generic assignments are considered only when the name contains a sensitive term such as password, token, secret, API key, private key, authorization, session, cookie, credential, or connection string. A direct match takes precedence when the same character range would otherwise be scored again.
Formula Core:
Shannon entropy measures the character distribution of a candidate value. Repeated characters lower the result; a more even mixture raises it.
H is bits per character. R is the generic assignment score; L, E, X, and K are length, entropy, character-class, and key-name points, while D is a sample-cue deduction.
| Factor | Rule | Points |
|---|---|---|
| Length | 8+, 12+, 20+, 32+, or 48+ characters | +4, +8, +13, +18, or +22 |
| Entropy | At least threshold − 0.45, threshold, or threshold + 0.6 | +8, +17, or +24 |
| Character classes | 2, 3, or 4 of lowercase, uppercase, digits, and symbols | +4, +8, or +12 |
| Key name | General sensitive, auth/session, token/API key, password/secret, or private-key/connection-string group | +12, +17, +21, +24, or +28 |
| Sample cue | Cue in the value, or only in the line/source label | −12 or −8 |
A 32-character value under an API-key name scores 82 when its entropy earns 17 points, it uses three character classes, and no sample cue applies: 18 + 18 + 17 + 8 + 21 = 82. That reaches high confidence and passes every profile cutoff.
The default entropy threshold is 3.7 bits per character and can be set from 2.5 to 5.5. Broad, balanced, and strict profiles include generic scores of at least 32, 48, and 70 respectively. Included generic assignments are high confidence at 82 or above, medium at 58 to below 82, and low below 58; severity follows that confidence.
Values are scanned up to 1 MiB. Findings are sorted by severity, confidence, line, and pattern name. The visible row limit can be 10 to 300, while severity totals and pattern coverage continue to describe the complete scan.
Privacy and Responsible Use:
The sample is scanned in the browser and no provider is contacted. Keep masking enabled: it shortens values in tables, copied rows, and downloads, but the editable source still contains the original text.
- Do not unmask findings in screenshots, tickets, shared calls, or broadly retained evidence.
- No validity check, account lookup, repository-history search, or provider revocation occurs.
- For a plausible real exposure, contain first: revoke or rotate, update dependants, inspect activity, and remove exposed copies according to incident policy.
Worked Examples:
Recognized provider shape
A line containing GITHUB_TOKEN=ghp_[redacted] in the real token shape is handled by the direct GitHub rule. It remains a high-severity finding under every profile because direct signatures do not depend on entropy scoring.
Generic placeholder
client_secret=sample-client-secret has a sensitive name but also a sample cue and modest entropy. Broad review may retain it for manual triage while a stricter profile may omit it. Neither outcome proves whether the value is live.
References:
- Supported secret scanning patterns, GitHub Docs.
- Secrets Management Cheat Sheet, OWASP Cheat Sheet Series.
- How to set Symfony secrets, Simplified Guide.