aiskillstore/marketplace/secrets-gitleaks
Claude Code and agent skill by aiskillstore/marketplace
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Author "aiskillstore" has blocked skill(s)
Hardcoded secret detection and prevention in git repositories and codebases using Gitleaks. Identifies passwords, API keys, tokens, and credentials through regex-based pattern matching and entropy analysis. Use when: (1) Scanning repositories for exposed secrets and credentials, (2) Implementing pre-commit hooks to prevent secret leakage, (3) Integrating secret detection into CI/CD pipelines, (4) Auditing codebases for compliance violations (PCI-DSS, SOC2, GDPR), (5) Establishing baseline secret detection and tracking new exposures, (6) Remediating historical secret exposures in git history.
Install
npx vskill@latest install aiskillstore/marketplace/secrets-gitleaksSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as aiskillstore/marketplace/secrets-gitleaks.
Secrets Detection with Gitleaks
Overview
Gitleaks is a secret detection tool that scans git repositories, files, and directories for hardcoded credentials including passwords, API keys, tokens, and other sensitive information. It uses regex-based pattern matching combined with Shannon entropy analysis to identify secrets that could lead to unauthorized access if exposed.
This skill provides comprehensive guidance for integrating Gitleaks into DevSecOps workflows, from pre-commit hooks to CI/CD pipelines, with emphasis on preventing secret leakage before code reaches production.
Quick Start
Scan current repository for secrets:
Core Workflows
1. Repository Scanning
Scan existing repositories to identify exposed secrets:
When to use: Initial security audit, compliance checks, incident response.
2. Pre-Commit Hook Protection
Prevent secrets from being committed in the first place:
Use the bundled script for automated hook installation:
When to use: Developer workstation setup, team onboarding, mandatory security controls.
3. CI/CD Pipeline Integration
GitHub Actions
GitLab CI
When to use: Automated security gates, pull request checks, release validation.
4. Baseline and Incremental Scanning
Establish security baseline and track only new secrets:
When to use: Legacy codebase remediation, phased rollout, compliance tracking.
5. Configuration Customization
Create custom .gitleaks.toml configuration:
Use bundled configuration templates in assets/:
assets/config-strict.toml- Strict detection (low false negatives)assets/config-balanced.toml- Balanced detection (recommended)assets/config-custom.toml- Template for custom rules
When to use: Reducing false positives, adding proprietary secret patterns, organizational standards.
Security Considerations
Sensitive Data Handling
- Secret Redaction: Always use
--redactflag in logs and reports to prevent accidental secret exposure - Report Security: Gitleaks reports contain detected secrets - treat as confidential, encrypt at rest
- Git History: Detected secrets in git history require complete removal using tools like
git filter-repoorBFG Repo-Cleaner - Credential Rotation: All exposed secrets must be rotated immediately, even if removed from code
Access Control
- CI/CD Permissions: Gitleaks scans require read access to repository content and git history
- Report Access: Restrict access to scan reports containing sensitive findings
- Baseline Files: Baseline JSON files contain secret metadata - protect with same controls as findings
Audit Logging
Log the following for compliance and incident response:
- Scan execution timestamps and scope (repository, branch, commit range)
- Number and types of secrets detected
- Remediation actions taken (credential rotation, commit history cleanup)
- False positive classifications and allowlist updates
Compliance Requirements
- PCI-DSS 3.2.1: Requirement 6.5.3 - Prevent hardcoded credentials in payment applications
- SOC2: CC6.1 - Logical access controls prevent unauthorized credential exposure
- GDPR: Article 32 - Appropriate security measures for processing personal data credentials
- CWE-798: Use of Hard-coded Credentials
- CWE-259: Use of Hard-coded Password
- OWASP A07:2021: Identification and Authentication Failures
Bundled Resources
Scripts (scripts/)
install_precommit.sh- Automated pre-commit hook installation with configuration promptsscan_and_report.py- Comprehensive scanning with multiple output formats and severity classificationbaseline_manager.py- Baseline creation, comparison, and incremental scan management
References (references/)
detection_rules.md- Comprehensive list of built-in Gitleaks detection rules with CWE mappingsremediation_guide.md- Step-by-step secret remediation procedures including git history cleanupfalse_positives.md- Common false positive patterns and allowlist configuration strategiescompliance_mapping.md- Detailed mapping to PCI-DSS, SOC2, GDPR, and OWASP requirements
Assets (assets/)
config-strict.toml- High-sensitivity configuration (maximum detection)config-balanced.toml- Production-ready balanced configurationconfig-custom.toml- Template with inline documentation for custom rulesprecommit-config.yaml- Pre-commit framework configurationgithub-action.yml- Complete GitHub Actions workflow templategitlab-ci.yml- Complete GitLab CI pipeline template
Common Patterns
Pattern 1: Initial Repository Audit
First-time secret scanning for security assessment:
Pattern 2: Developer Workstation Setup
Protect developers from accidental secret commits:
Pattern 3: CI/CD Pipeline with Baseline
Progressive secret detection in continuous integration:
Pattern 4: Custom Rule Development
Add organization-specific secret patterns:
Integration Points
CI/CD Integration
- GitHub Actions: Use
gitleaks/gitleaks-action@v2for native integration with Security tab - GitLab CI: Docker-based scanning with artifact retention for audit trails
- Jenkins: Execute via Docker or installed binary in pipeline stages
- CircleCI: Docker executor with orb support
- Azure Pipelines: Task-based integration with results publishing
Security Tools Ecosystem
- SIEM Integration: Export JSON findings to Splunk, ELK, or Datadog for centralized monitoring
- Vulnerability Management: Import SARIF reports into Snyk, SonarQube, or Checkmarx
- Secret Management: Integrate findings with HashiCorp Vault or AWS Secrets Manager rotation workflows
- Ticketing Systems: Automated Jira/ServiceNow ticket creation for remediation tracking
SDLC Integration
- Design Phase: Include secret detection requirements in security architecture reviews
- Development: Pre-commit hooks provide immediate feedback to developers
- Code Review: PR/MR checks prevent secrets from reaching main branches
- Testing: Scan test environments and infrastructure-as-code
- Deployment: Final validation gate before production release
- Operations: Periodic scanning of deployed configurations and logs
Troubleshooting
Issue: Too Many False Positives
Symptoms: Legitimate code patterns flagged as secrets (test fixtures, examples, placeholders)
Solution:
- Review findings to identify patterns:
grep -i "example\|test\|placeholder" gitleaks-report.json - Add to allowlist in
.gitleaks.toml:
``toml [allowlist] paths = ['''test/''', '''examples/''', '''\.md$'''] stopwords = ["EXAMPLE", "PLACEHOLDER", "YOUR_API_KEY_HERE"] ``
- Use commit allowlists for specific false positives:
``toml [allowlist] commits = ["commit-sha-here"] ``
- Consult
references/false_positives.mdfor common patterns
Issue: Performance Issues on Large Repositories
Symptoms: Scans taking excessive time (>10 minutes), high memory usage
Solution:
- Use
--log-optsto limit git history:gitleaks detect --log-opts="--since=2024-01-01" - Scan specific branches:
gitleaks detect --log-opts="origin/main" - Use baseline approach to scan only recent changes
- Consider shallow clone for initial scans:
git clone --depth=1000 - Parallelize scans across multiple branches or subdirectories
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agentsecops/secrets-gitleaks/SKILL.md
Popularity
- Repository stars
- 429
- Repository forks
- 45
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooksconfigConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aiskillstore/marketplace/secrets-gitleaks)