소스 코드, 웹 URL, CI/CD 전반에 걸쳐 170개 이상의 규칙으로 자격 증명과 비밀을 찾아내고, 벤더 API에 대해 검증하며, SARIF, JSONL, HTML, PDF 또는 Excel 보고서를 생성합니다.
실시간 검증, 소스맵 파싱, CI 네이티브 리포팅을 갖춘 DAST + SAST 시크릿 스캐너, 그리고 SAST 취약점 및 설정 오류 엔진.
소스 트리, 실행 중인 웹 앱, CI 로그에서 유출된 자격 증명을 찾아냅니다. 벤더 API에 대해 실시간으로 검증합니다. 동일한 소스 트리에서 코드 취약점과 설정 오류를 스캔합니다. 코드 스캐닝 대시보드용 SARIF, SOAR 파이프라인용 JSONL, 또는 고객 보고서용 Excel/PDF/HTML로 출력합니다.
혼잡한 시장(gitleaks, trufflehog, detect-secrets)은 git 트리에 대한 SAST에는 뛰어나지만 거기서 멈추며, 시크릿만 스캔합니다. scan4secrets는 그들이 커버하지 못하는 공백을 채웁니다 — 시크릿 탐지 위에 라이브 웹 DAST, 라이브 벤더 검증, 코드 취약점 / 설정 오류 엔진을 추가합니다:
| 기능 | gitleaks | trufflehog | detect-secrets | scan4secrets |
|---|---|---|---|---|
| SAST 시크릿 탐지 | Y | Y | Y | Y |
| DAST 라이브 웹 크롤링 | - | - | - | Y |
| JS 소스맵 파싱 | - | - | - | Y |
| JS 엔드포인트 추출 | - | - | - | Y |
| HTTP 헤더 시크릿 스캔 | - | - | - | Y |
| 라이브 토큰 검증 | - | Y | - | Y |
| SARIF 출력 | Y | - | - | Y |
| Excel / PDF / HTML 보고서 | - | - | - | Y |
| 엔트로피 게이트 + 허용 목록 | Y | Y | Y | Y |
| YAML 규칙 스키마 | - (TOML) | - | - | Y |
| 인증된 DAST (cookie/header/proxy) | n/a | n/a | n/a | Y |
| SAST 취약점 / 설정 오류 탐지 | - | - | - | Y |
이것은 gitleaks의 보완재이지 대체재가 아닙니다. 둘 다 사용하세요: git 히스토리 SAST에는 pre-commit + CI에서 gitleaks를, 스테이징/프로덕션에 대한 라이브 DAST에는 scan4secrets를 사용하세요.
# from source
git clone https://github.com/m14r41/scan4secrets
cd scan4secrets
pip install -e .
# OR via pipx
pipx install git+https://github.com/m14r41/scan4secrets
# OR Docker
docker run --rm -v $(pwd):/scan ghcr.io/m14r41/scan4secrets:latest --path /scan
설치 후 scan4secrets 명령이 PATH에 등록됩니다.
# SAST: scan a local directory
scan4secrets --path /code
# DAST: crawl a live target
scan4secrets --url https://staging.example.com --threads 32
# DAST runs ALL bundled wordlists by default (1279 paths: /.env, /wp-config.php, /backup.zip, ...)
scan4secrets --url https://target.com
# Use YOUR OWN wordlist file (replaces the bundled set)
scan4secrets --url https://target.com --wordlist /path/to/my-paths.txt
# Combine multiple custom wordlist files
scan4secrets --url https://target.com --wordlist seclists/Common.txt internal-paths.txt
# Restrict to specific bundled wordlists by stem
scan4secrets --url https://wp.example.com --wordlist-only wordpress common env
# Turn wordlist seeding off entirely (only follow live links)
scan4secrets --url https://target.com --no-wordlist
# Full audit with verification + HTML report
scan4secrets --path . --url https://app.example.com \
--verify --report html sarif json \
--output reports/audit-$(date +%F)
# Authenticated DAST with proxy (works with Burp / ZAP)
scan4secrets --url https://app.example.com \
--cookie "session=abc123" \
--header "X-Tenant: acme" \
--proxy http://127.0.0.1:8080
# CI gate (exit 1 if anything >= high)
scan4secrets --path . --report sarif --fail-on high \
--output reports/scan
# SAST: secrets + code vulnerabilities / misconfigurations
scan4secrets --path ./src --misconfig
# SAST: vulnerabilities / misconfigurations only (skip secret detection)
scan4secrets --path ./src --misconfig-only
--misconfig)시크릿 외에도 scan4secrets는 코드 취약점과 설정 오류를 위한 SAST 엔진을 제공합니다. 시크릿과 취약점을 모두 스캔하려면 --misconfig를, 취약점만 스캔하려면 --misconfig-only를 추가하세요:
scan4secrets --path ./src --misconfig # secrets + vulnerabilities
scan4secrets --path ./src --misconfig-only # vulnerabilities only
scan4secrets --path . --misconfig --report html --output report
오탐을 낮게 유지하기 위한 taint/컨텍스트 게이팅과 함께 다음을 탐지합니다 — SQL 인젝션, NoSQL 인젝션, OS 명령 인젝션, 코드 인젝션 (eval), SSTI, XXE, 안전하지 않은 역직렬화, LFI / 경로 순회, LDAP & XPath 인젝션, SSRF, 오픈 리다이렉트, CORS 설정 오류, CSRF 비활성화, 프로토타입 오염, XSS (11개 템플릿 엔진 전반에 걸친 반사형/저장형/DOM: EJS, Handlebars, Pug, Jinja, Thymeleaf, Razor, Blade, ERB, Vue, Angular, React), 취약한 암호화 (DES/RC4/ECB/정적 IV/취약한 RSA), 안전하지 않은 난수, JWT 결함 (alg:none, 알고리즘 혼동, 하드코딩된 서명 시크릿, 검증 비활성화), TLS 우회, 타이밍 안전하지 않은 시크릿 비교, SAML 서명 미요구, 하드코딩된 자격 증명, 민감 데이터 로깅, 그리고 IaC/설정 오류 (Terraform, Kubernetes, Dockerfile, GitHub Actions, ASP.NET web.config, WCF/SOAP).
지원 언어: python, node, javascript, typescript, react, php, ruby, go, java, kotlin, csharp/.NET, sql, 그리고 XML/WSDL, JSP, Terraform/HCL, Kubernetes YAML, Dockerfile.
각 취약점 발견 항목은 풍부한 레코드를 포함합니다: 취약점 이름, 심각도, 설명, 증거 (file:line), 취약한 코드, 안전한 코드, 완화 조치, 기술적 영향, 비즈니스 영향, 그리고 CWE + OWASP Top-10 매핑.
라인별 엔진 외에도, 전체 파일 패스는 라인 스캐너가 놓치는 시크릿을 잡아냅니다: 중첩된 XML 태그 (<SMS_API_KEY><value>…</value></SMS_API_KEY>), 분리된 <key>/<value> 쌍, JSON 키/값 객체, 여러 줄 YAML/properties, 그리고 Base64로 인코딩된 시크릿. 또한 엔트로피 게이트의 사각지대를 해소합니다 — 자격 증명 이름이 붙은 할당 (예: AM_CLIENT_SECRET=…)은 엔트로피 하한 없이 이름 신호로 플래그되므로, 실제 낮은 엔트로피의 시크릿이 더 이상 조용히 누락되지 않습니다.
총 416개 규칙 — 193개 시크릿 규칙 + 223개 취약점 / 설정 오류 규칙.
시크릿 규칙이 커버하는 범위:
전체 레퍼런스와 사용자 정의 규칙 추가 방법은 docs/rules-engine.md를 참조하세요.
--verify를 사용하면 scan4secrets는 탐지된 토큰마다 벤더 API에 HTTP 요청을 한 번 보내 자격 증명이 여전히 라이브인지 확인합니다: