Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)35k · #8115

implementing-secrets-scanning-in-ci-cd

Was er macht

Dieses Tool hilft dir, Secrets (wie Passwörter oder API-Schlüssel) zu finden, die versehentlich in den Code deines Projekts gelangt sind. Es prüft deinen Code, bevor er in die Produktion geht, um Sicherheitslecks zu verhindern.

Wann du ihn nutzt

  • ✓Wenn du die Sicherheit deines Projekts einrichtest.
  • ✓Vor der Veröffentlichung einer neuen Version deiner Software.
  • ✓Wenn du sicherstellen willst, dass keine sensiblen Informationen abgeflossen sind.

Link zum Skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-secrets-scanning-in-ci-cd/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-secrets-scanning-in-ci-cd/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Scanne meinen Code vor dem Veröffentlichen auf geleakte Secrets.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool nutzt weitere Programme (Gitleaks und TruffleHog), um im Code nach Mustern von Secrets zu suchen. Findet es etwas Verdächtiges, schlägt es Alarm und kann die Veröffentlichung sogar stoppen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Implementing Secrets Scanning in CI/CD

Overview

This skill covers implementing automated secrets scanning in CI/CD pipelines using gitleaks and trufflehog. It enables security teams to detect API keys, tokens, passwords, and other credentials that have been accidentally committed to source code repositories, providing a CI gate that blocks deployments containing high-severity findings.

Gitleaks scans git repositories and directories for hardcoded secrets using regex patterns and entropy analysis. TruffleHog performs filesystem and git history scans with optional secret verification against live services. Together they provide comprehensive coverage for secrets detection.

When to Use

  • When deploying or configuring implementing secrets scanning in ci cd capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Python 3.9 or later
  • gitleaks v8.x installed and available on PATH
  • trufflehog v3.x installed and available on PATH
  • A git repository or directory to scan
  • Access to CI/CD platform (GitHub Actions, GitLab CI, Jenkins)

Steps

  1. Install scanning tools: Install gitleaks via package manager or binary download. Install trufflehog via brew install trufflehog or download from GitHub releases.

  2. Configure gitleaks: Create a .gitleaks.toml configuration file in the repository root to define custom rules, allowlists, and path exclusions. Use --config flag to point to custom configs.

  3. Run gitleaks directory scan: Execute gitleaks dir --source . --report-format json --report-path gitleaks-report.json to scan the working directory and generate a JSON report.

  4. Run trufflehog filesystem scan: Execute trufflehog filesystem /path/to/repo --json > trufflehog-report.json to scan files and output JSON findings to a report file.

  5. Parse and filter findings: Use the agent script to parse both JSON reports, filter findings by severity (critical, high, medium, low), and determine whether the CI pipeline should pass or fail.

  6. Integrate into CI pipeline: Add the scanning step to your GitHub Actions workflow, GitLab CI config, or Jenkins pipeline as a pre-deployment gate. Use --exit-code flag in gitleaks to control pipeline behavior.

  7. Configure pre-commit hooks: Set up gitleaks as a pre-commit hook using gitleaks protect --staged to catch secrets before they are committed.

  8. Review and triage findings: Examine the JSON output for false positives, add legitimate entries to .gitleaksignore, and rotate any confirmed leaked credentials immediately.

Expected Output

The agent script produces a JSON report containing:

  • Total findings count from each scanner
  • Findings grouped by severity level
  • Individual finding details including file path, line number, rule ID, and redacted secret
  • A CI gate verdict (pass/fail) based on the configured severity threshold
  • Execution metadata including scan duration and tool versions
{
  "scan_summary": {
    "tool": "both",
    "total_findings": 3,
    "critical": 1,
    "high": 1,
    "medium": 1,
    "low": 0,
    "ci_gate": "FAIL",
    "fail_reason": "Found 1 critical and 1 high severity findings"
  },
  "findings": [...]
}
Häufige Fragen

Was sind 'Secrets'?

Secrets sind sensible Informationen wie Passwörter, API-Schlüssel, Zugriffstoken und andere Zugangsdaten. Sie sollten nicht öffentlich im Code stehen.

Was ist CI/CD?

CI/CD ist ein Prozess, der das Bauen, Testen und Ausliefern von Software automatisiert. Dieses Tool fügt diesem Prozess eine Sicherheitsebene hinzu.

Was passiert, wenn das Tool ein Secret findet?

Es kann verhindern, dass der Code veröffentlicht wird, und einen detaillierten Bericht erstellen, was gefunden wurde. So kannst du das Problem beheben.

Details

Originalbeschreibung des Autors

Integrate gitleaks and trufflehog into CI/CD pipelines to detect leaked secrets before deployment

repo: mukul975/Anthropic-Cybersecurity-Skills

Beliebtheit

GitHub-Sterne
35k
Platz im Ranking
#8115
Lizenz
Apache-2.0
Aktualisiert
31.8.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills