implementing-secrets-scanning-in-ci-cd
하는 일
이 도구는 실수로 프로젝트 코드에 들어간 비밀 정보(비밀번호나 API 키 등)를 찾는 데 도움을 줍니다. 운영 환경으로 가기 전에 코드를 검사해 보안 유출을 막습니다.
사용하는 경우
- ✓프로젝트의 보안을 설정할 때.
- ✓새 버전의 소프트웨어를 출시하기 전에 검사해야 할 때.
- ✓민감한 정보가 유출되지 않았는지 확인해야 할 때.
스킬 링크
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-secrets-scanning-in-ci-cd/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“공개하기 전에 코드에서 유출된 비밀 정보가 있는지 검사해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 도구는 다른 프로그램(Gitleaks와 TruffleHog)을 사용해 코드에서 비밀 정보의 패턴을 찾습니다. 의심스러운 것을 발견하면 알려 주며, 공개를 막을 수도 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
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": [...]
}
자주 묻는 질문
비밀 정보(secrets)란 무엇인가요?
비밀번호, API 키, 액세스 토큰 및 기타 인증 정보처럼 코드에서 공개적으로 노출되면 안 되는 민감한 정보입니다.
CI/CD란 무엇인가요?
소프트웨어의 빌드, 테스트, 배포를 자동화하는 과정입니다. 이 도구는 그 과정에 보안 계층을 더합니다.
도구가 비밀 정보를 찾으면 어떻게 되나요?
코드가 공개되지 않도록 막을 수 있으며, 무엇이 발견되었는지 자세한 보고서를 만들어 문제를 고칠 수 있게 합니다.
상세 정보
작성자의 원본 설명
Integrate gitleaks and trufflehog into CI/CD pipelines to detect leaked secrets before deployment
인기도
- GitHub 스타
- 35k
- 순위
- #8115
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.