๐ CredHound - ๋ก์ปฌ ํ์ผ ๋ณด์ credential ํ์ง ๋๊ตฌ (์ ๊ณ ํ์ค ์ค์)
Project description
๐ CredHound
๋ก์ปฌ ํ์ผ์์ ๋ฏผ๊ฐํ credential์ ํ์งํ๋ ๋ณด์ ๋๊ตฌ. OWASP, SARIF 2.1.0, CWE-798/321 ๋ฑ ์ ๊ณ ํ์ค ์ค์.
์ฃผ์ ๊ธฐ๋ฅ
- 29๊ฐ ํ์ง ๊ท์น โ AWS, GitHub, Slack, JWT, DB, ํจ์ค์๋, Private Key ๋ฑ
- ์ํธ๋กํผ ๋ถ์ โ Shannon ์ํธ๋กํผ ๊ธฐ๋ฐ ๋ฏธ์ง์ ์ํฌ๋ฆฟ ํ์ง
- ๋ค์ค ์ถ๋ ฅ โ HTML ๋ฆฌํฌํธ, JSON, SARIF 2.1.0, ์ฝ์
- CI/CD ์ฐ๋ โ exit code, ๋น๋ํํ ๋ชจ๋, pre-commit ํ
- ๋ณ๋ ฌ ์ฒ๋ฆฌ โ ThreadPoolExecutor ๊ธฐ๋ฐ ๊ณ ์ ์ค์บ
- credential ๋ง์คํน โ ๊ฒฐ๊ณผ ํ์ผ์ ์ค์ ๊ฐ ๋ ธ์ถ ๋ฐฉ์ง (๊ธฐ๋ณธ ON)
- false positive ๊ด๋ฆฌ โ baseline ํ์ผ + ์ธ๋ผ์ธ ํ์ฉ๋ชฉ๋ก (
# credhound:ignore) - CWE ๋งคํ โ SARIF ์ถ๋ ฅ์ CWE-798/321 ์ฐธ์กฐ ๋ฐ remediation ๊ฐ์ด๋ ํฌํจ
- ์ค์ ๋ถ๋ฆฌ โ ๊ธ๋ก๋ฒ(config.yaml) + ๊ฐ์ธ(config.local.yaml) ์๋ ๋ณํฉ
์ค์น
pip install credhound
๋น ๋ฅธ ์์
# ์ธํฐ๋ํฐ๋ธ ๋ชจ๋ (HTML ๋ฆฌํฌํธ ์๋ ์์ฑ)
credhound
# ๊ฒฝ๋ก ์ง์
credhound --path ~/project
# ๋ณ๋ ฌ + HIGH ์ด์๋ง
credhound --path ~ --parallel --severity HIGH
์ถ๋ ฅ ํ์
# HTML ๋ฆฌํฌํธ (์๊ฐ์ , ๊ถ์ฅ)
credhound --path ~ --format html -o report.html
# JSON (ํ๋ก๊ทธ๋๋ฐ์ ์๋น)
credhound --path ~ --format json -o results.json
# SARIF 2.1.0 (GitHub Code Scanning ์ฐ๋)
credhound --path ~ --format sarif -o results.sarif
# ์ฝ์ (๊ธฐ๋ณธ)
credhound --path ~
CI/CD ํ์ดํ๋ผ์ธ
# CI ๋ชจ๋ (๋น๋ํํ, exit code ๋ฐํ)
credhound --path . --ci --severity HIGH
# exit 0 = clean, exit 1 = findings, exit 2 = error
# SARIF + CI
credhound --path . --ci --format sarif -o results.sarif
# Pre-commit ํ
์ค์น
credhound --install-hook --path .
์ธ๋ผ์ธ ํ์ฉ๋ชฉ๋ก
False positive๋ฅผ ์ฝ๋์์ ์ง์ ์ ์ธํ ์ ์์ต๋๋ค:
API_KEY = "some_value" # credhound:ignore
PASSWORD = "test123" # pragma: allowlist secret
์ ์ฒด ์ต์
| ์ต์ | ์ค๋ช | ๊ธฐ๋ณธ๊ฐ |
|---|---|---|
--path, -p |
์ค์บ ๊ฒฝ๋ก | ์ธํฐ๋ํฐ๋ธ ์ ๋ ฅ |
--format, -f |
์ถ๋ ฅ ํ์ (console/json/sarif/html) | console |
--output, -o |
๊ฒฐ๊ณผ ์ ์ฅ ๊ฒฝ๋ก | - |
--severity, -s |
์ต์ ์ฌ๊ฐ๋ (CRITICAL/HIGH/MEDIUM/LOW) | LOW |
--parallel |
๋ณ๋ ฌ ์ฒ๋ฆฌ ํ์ฑํ | OFF |
--ci |
CI ๋ชจ๋ (๋น๋ํํ) | OFF |
--unmask |
credential ๋ง์คํน ํด์ | ๋ง์คํน ON |
--group |
๊ฐ์ credential ๊ทธ๋ฃนํ | OFF |
--cache |
mtime ๊ธฐ๋ฐ ์บ์ (๋ณ๊ฒฝ ํ์ผ๋ง ์ค์บ) | OFF |
--incremental |
Git ๋ณ๊ฒฝ ํ์ผ๋ง ์ค์บ | OFF |
--no-entropy |
์ํธ๋กํผ ๋ถ์ ๋นํ์ฑํ | ์ํธ๋กํผ ON |
--entropy |
์ํธ๋กํผ ๋ถ์ ํ์ฑํ (config์์ OFFํ ๊ฒฝ์ฐ) | ์ํธ๋กํผ ON |
--baseline |
baseline ํ์ผ ๊ฒฝ๋ก | .credscan-baseline.json |
--update-baseline |
์ธํฐ๋ํฐ๋ธ baseline ์ ๋ฐ์ดํธ | - |
--install-hook |
Pre-commit ํ ์ค์น | - |
--config |
์ค์ ํ์ผ ๊ฒฝ๋ก | config.yaml |
--rules |
๊ท์น ํ์ผ ๊ฒฝ๋ก | rules.yaml |
--verbose, -v |
์์ธ ๋ก๊ทธ ์ถ๋ ฅ | OFF |
์ค์ ์ปค์คํฐ๋ง์ด์ง
config.yaml ์์ config.local.yaml์ ๋ง๋ค๋ฉด ์๋์ผ๋ก ๋ณํฉ๋ฉ๋๋ค:
# config.local.yaml (๊ฐ์ธ ํ๊ฒฝ ์ ์ฉ, .gitignore์ ์ถ๊ฐ)
exclude_dirs:
- .oh-my-zsh
- my-large-folder
exclude_patterns:
- ".*๋ด_ํน์ _ํ์ผ.*"
- ๋ฆฌ์คํธ ๊ฐ์ ๊ธฐ์กด์ ํฉ์ณ์ง๊ณ , ๋จ์ผ ๊ฐ์ ๋ฎ์ด์๋๋ค
config.yaml์ ์์ ํ์ง ๋ง์ธ์ โ ์ ๋ฐ์ดํธ ์ ์ด๊ธฐํ๋ฉ๋๋ค
ํ์ง ๊ท์น (29๊ฐ)
| ์นดํ ๊ณ ๋ฆฌ | ๊ท์น | ์ฌ๊ฐ๋ |
|---|---|---|
| AWS | Access Key (AKIA), Secret Key, Session Token | CRITICAL |
| Private Key | RSA, DSA, EC, OPENSSH, PGP | CRITICAL |
| HashiCorp | Vault Token (hvs.) | CRITICAL |
| GitHub | Personal/OAuth/Server Token (ghp_, gho_, ghs_) | HIGH |
| Slack | Token (xoxb/xoxp), Webhook | HIGH |
| Azure | Storage Connection String | HIGH |
| Stripe | Secret/Publishable/Restricted Key | HIGH |
| Twilio | API Key, Account SID | HIGH |
| SendGrid | API Key (SG.) | HIGH |
| GitLab | Personal Access Token (glpat-) | HIGH |
| Shopify | API Token (shpat_, shpss_) | HIGH |
| Password | ํ๋์ฝ๋ฉ๋ ํจ์ค์๋, URL ๋ด ํจ์ค์๋ | HIGH |
| API Key (AIza) | MEDIUM | |
| JWT | JSON Web Token (eyJ) | MEDIUM |
| Database | MongoDB, PostgreSQL, MySQL URL | MEDIUM |
| Telegram | Bot Token | MEDIUM |
| Firebase | Database URL | MEDIUM |
| Generic | API Key, Encryption Key | MEDIUM/HIGH |
| Entropy | ๊ณ ์ํธ๋กํผ ๋ฌธ์์ด | LOW |
๊ท์ ์ค์
| ํ์ค | ์ค์์จ |
|---|---|
| OWASP Secrets Management | 95% |
| SARIF 2.1.0 (OASIS) | 100% |
| CWE-798 / CWE-321 | 100% |
| NIST SP 800-53 Rev 5 | 100% |
| PCI DSS v4.0 | 100% |
์ฐธ๊ณ ๊ธฐ์ค
- OWASP Secrets Management Cheat Sheet
- SARIF 2.1.0 (OASIS)
- CWE-798 / CWE-321
- Basak et al. (2023) โ Secret Detection Tools ์ค์ฆ ์ฐ๊ตฌ
ํ ์คํธ
python -m unittest test_scanner -v
# 33 tests, 0.5s
๋ผ์ด์ ์ค
MIT License โ LICENSE ์ฐธ์กฐ
๋ฉด์ฑ ์กฐํญ
๋ณธ ๋๊ตฌ๋ "์๋ ๊ทธ๋๋ก(AS IS)" ์ ๊ณต๋ฉ๋๋ค. ์์ธ ๋ด์ฉ์ DISCLAIMER.md๋ฅผ ์ฐธ์กฐํ์ธ์.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file credhound-2.9.6.tar.gz.
File metadata
- Download URL: credhound-2.9.6.tar.gz
- Upload date:
- Size: 34.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97bf130a35dcbf621af4df4d24c9ba764c7ed6a88f00b5d155e5d418738e1dee
|
|
| MD5 |
d85ca799b8eb2e50f15896359855123b
|
|
| BLAKE2b-256 |
0a1b9301a7f7d79d828d88140c093d8196382227a1b77d3ee596991c83149fe0
|
Provenance
The following attestation bundles were made for credhound-2.9.6.tar.gz:
Publisher:
publish.yml on milv0/credhound
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
credhound-2.9.6.tar.gz -
Subject digest:
97bf130a35dcbf621af4df4d24c9ba764c7ed6a88f00b5d155e5d418738e1dee - Sigstore transparency entry: 1022378294
- Sigstore integration time:
-
Permalink:
milv0/credhound@b194fca09a99b614df4b057105241e4491837592 -
Branch / Tag:
refs/tags/v2.9.6 - Owner: https://github.com/milv0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b194fca09a99b614df4b057105241e4491837592 -
Trigger Event:
push
-
Statement type:
File details
Details for the file credhound-2.9.6-py3-none-any.whl.
File metadata
- Download URL: credhound-2.9.6-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e28125b9c9ae0b1368907f76f810554d9130c10f9c8c056d6b91486a5b30de9
|
|
| MD5 |
be2198f242c9086232a8d505e04b7ecf
|
|
| BLAKE2b-256 |
11722ba8635db2247de8503e5cdc89bc99d87df000eb075c79a3dd1dead9b9eb
|
Provenance
The following attestation bundles were made for credhound-2.9.6-py3-none-any.whl:
Publisher:
publish.yml on milv0/credhound
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
credhound-2.9.6-py3-none-any.whl -
Subject digest:
5e28125b9c9ae0b1368907f76f810554d9130c10f9c8c056d6b91486a5b30de9 - Sigstore transparency entry: 1022378331
- Sigstore integration time:
-
Permalink:
milv0/credhound@b194fca09a99b614df4b057105241e4491837592 -
Branch / Tag:
refs/tags/v2.9.6 - Owner: https://github.com/milv0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b194fca09a99b614df4b057105241e4491837592 -
Trigger Event:
push
-
Statement type: