Logo di Secrets Detection Patterns

Secrets Detection Patterns

Organizzazione
RedHatProductSecurity
secrets-detection-patterns

Detect hardcoded secrets in source code using pattern-based scanning for API keys, tokens, passwords, private keys, and connection strings. Use before committing, during code review, or for post-incident history scanning. Self-contained — no external tools required.

Add to TypingMind

Panoramica

Pubblicato daRedHatProductSecurity
Repositoryprodsec-skills
Nome della skillsecrets-detection-patterns
Stelle
56
Fork
9
File inclusi
Solo istruzioni
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da RedHatProductSecurity su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Secrets Detection Patterns in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/secrets-detection-patterns
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RedHatProductSecurity/prodsec-skills.git /tmp/prodsec-skills
mkdir -p .claude/skills
cp -r /tmp/prodsec-skills/ge-core/secrets-detection-patterns .claude/skills/secrets-detection-patterns
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Secrets Detection Patterns in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Secrets Detection Patterns non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Secrets Detection Patterns non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Secrets Detection Patterns

Overview

Pattern-based secrets detection for source code. This skill provides regex patterns, false positive filtering criteria, and remediation guidance for detecting hardcoded secrets. It is self-contained — no external tools (trufflehog, gitleaks) are required, though they are recommended as complementary tooling.

Zero Tolerance Policy

Any confirmed secret in code results in a BLOCKED verdict. There is no passing threshold — secrets in code are a critical finding. A secret is either present or it is not.

Redaction Rule

Reports must NEVER include actual secret values. Report secret type, file path, and line number only. Pattern matches are redacted to show type and location: e.g., "AWS Access Key at src/config.js:42".

Scan Scope Options

  • Staged — scan git staged files only (pre-commit gate)
  • All — scan entire working directory
  • History — scan git commit history (post-incident review)

Detection Patterns

Pattern 1: AWS Access Keys

Format: AKIA followed by 16 alphanumeric characters.

AKIA[0-9A-Z]{16}

Pattern 2: AWS Secret Access Keys

40-character base64-like strings after a known label.

(aws_secret_access_key|aws_secret_key)\s*[=:]\s*[A-Za-z0-9/+=]{40}

Pattern 3: GitHub Personal Access Tokens

Prefixes: ghp_, gho_, ghu_, ghs_, ghr_.

(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9_]{36}

Pattern 4: Private Key Material

RSA, EC, DSA, and OpenSSH private key headers.

-----BEGIN (RSA |EC |DSA |OPENSSH |PRIVATE )PRIVATE KEY-----

Pattern 5: Generic Passwords (Labeled)

High-confidence labeled password assignments with values >= 8 characters.

(password|passwd|pwd|secret|api_key|apikey|api_secret|client_secret|auth_token|access_token)\s*[=:]\s*['"][^'"]{8,}['"]

Pattern 6: Database Connection Strings

Connection strings with embedded credentials.

(mysql|postgresql|postgres|mongodb|redis|amqp|jdbc)://[^@\s]+:[^@\s]+@

Pattern 7: JWT Tokens

Three-part base64url segments separated by dots, starting with eyJ.

eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}

Pattern 8: Slack Tokens

Prefix: xox[bpaso]-.

xox[bpaso]-[A-Za-z0-9-]{10,}

Pattern 9: Google API Keys

Prefix: AIza.

AIza[0-9A-Za-z_-]{35}

Pattern 10: Stripe API Keys

Prefixes: sk_live_, pk_live_, rk_live_, sk_test_.

(sk_live_|pk_live_|rk_live_|sk_test_)[0-9a-zA-Z]{24,}

False Positive Filtering

Classify a match as FALSE POSITIVE if:

  • The match is in a test fixture file (path contains: test/, tests/, spec/, fixtures/, __tests__/, testdata/)
  • The match is in a documentation file (.md, .rst, .txt, .adoc) showing an example format
  • The match is in a comment explaining what a secret looks like (e.g., # example: AKIA...)
  • The match is an obvious placeholder (e.g., AKIAIOSFODNN7… — AWS's documented sample key — your-secret-here, <YOUR_API_KEY>, xxx...xxx)
  • The match is in a .env.example, .env.sample, or .env.template file
  • The match is in a README or CONTRIBUTING file describing configuration
  • The value is clearly a test/dummy value (e.g., password: 'test' in test files)
  • The match is in a mock or stub (file path contains mock, stub, fake)

Classify a match as CONFIRMED if:

  • The match appears in a source code file that would be executed
  • The match appears in a configuration file that is NOT an example/template
  • The match appears in a script file or Dockerfile
  • The value appears to be a real credential format (not a placeholder)
  • The match appears in a git diff as an added line (staged scope)

Remediation Guidance

When secrets are detected:

  1. Remove the secret and rotate the credential (strongly recommended)
  2. Add the file to .gitignore if it must not be committed
  3. Use environment variables or a secrets manager instead of hardcoded values
  4. If this is a test fixture or example, rename the file to include example or fixture and use obviously fake values

If secrets have been committed to git history, consider:

  • Rotating the credential immediately (the secret is compromised regardless of git cleanup)
  • Using git filter-branch or BFG Repo-Cleaner to remove from history
  • Scanning with trufflehog or gitleaks for comprehensive history review

Complementary Tooling

For production use, consider also deploying:

  • trufflehog — entropy-based scanning for unstructured secrets
  • gitleaks — pre-commit hook integration with configurable rules
  • A secrets manager (HashiCorp Vault, AWS Secrets Manager, etc.) to eliminate secrets from code entirely

Note: The patterns in this skill use regex-based detection only. Entropy-based detection (for unstructured high-entropy strings) requires external tooling.

Domande frequenti

Cosa fa la skill IA Secrets Detection Patterns?

Detect hardcoded secrets in source code using pattern-based scanning for API keys, tokens, passwords, private keys, and connection strings. Use before committing, during code review, or for post-incident history scanning. Self-contained — no external tools required.

Perché usare Secrets Detection Patterns su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Secrets Detection Patterns è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Secrets Detection Patterns in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/secrets-detection-patterns. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Secrets Detection Patterns?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Secrets Detection Patterns?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Secrets Detection Patterns: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Secrets Detection Patterns è gratuita?

Sì. È pubblicata su GitHub da RedHatProductSecurity con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇