Implementing secrets scanning in ci cd
Skill henriquescastilho/my-claude/.claude/skills/implementing-secrets-scanning-in-ci-cd
Setup público e sanitizado de um Claude Code full-stack: 8 sub-agents com roteamento por modelo, 792 skills, hooks de segurança, MCP servers e metodologia opinativa. Desenhado para um agente de IA se auto-configurar.
npx -y skills add henriquescastilho/my-claude --skill implementing-secrets-scanning-in-ci-cdAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Integrate gitleaks and trufflehog into CI/CD pipelines to detect leaked secrets before deployment
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.7 KB, as published. Nobody here has run it
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
-
Install scanning tools: Install gitleaks via package manager or binary download. Install trufflehog via
brew install trufflehogor download from GitHub releases. -
Configure gitleaks: Create a
.gitleaks.tomlconfiguration file in the repository root to define custom rules, allowlists, and path exclusions. Use--configflag to point to custom configs. -
Run gitleaks directory scan: Execute
gitleaks dir --source . --report-format json --report-path gitleaks-report.jsonto scan the working directory and generate a JSON report. -
Run trufflehog filesystem scan: Execute
trufflehog filesystem /path/to/repo --json > trufflehog-report.jsonto scan files and output JSON findings to a report file. -
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.
-
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-codeflag in gitleaks to control pipeline behavior. -
Configure pre-commit hooks: Set up gitleaks as a pre-commit hook using
gitleaks protect --stagedto catch secrets before they are committed. -
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": [...]
}