CVE Scanner는 오픈소스 소프트웨어의 보안 취약점(CVE)을 분석하고 리포트를 생성하는 스킬입니다.
# 기본 사용법
cve-scanner "패키지명" "버전"
# 예시
cve-scanner "log4j-core" "2.14.0"
cve-scanner "openssl" "1.1.1k" --severity HIGH,CRITICAL
cve-scanner "spring-framework" "5.3.18" --output excel
# 의존성 파일 분석
cve-scanner --file package.json
cve-scanner --file requirements.txt --output json
cve-scanner --file pom.xml --severity CRITICAL,HIGH
| 옵션 | 설명 | 기본값 |
|---|---|---|
| ------ | ------ | -------- |
--severity | 심각도 필터 (CRITICAL,HIGH,MEDIUM,LOW) | 전체 |
--output | 출력 형식 (markdown, excel, json, csv) | markdown |
--ecosystem | 생태계 지정 (npm, pypi, maven, golang 등) | 자동 감지 |
--file | 의존성 파일 경로 | - |
--quiet, -q | 경고 메시지 억제 (JSON 출력 시 권장) | - |
--no-cache | 캐시 사용 안 함 | - |
--max-retries | API 호출 재시도 횟수 | 3 |
--nvd-key | NVD API 키 (Rate Limit 증가) | - |
--github-token | GitHub 토큰 (Rate Limit 증가) | - |
package.json / package-lock.json (npm)requirements.txt / Pipfile.lock (PyPI)pom.xml / build.gradle (Maven)go.mod / go.sum (Go)Cargo.lock (Rust)composer.lock (PHP)Gemfile.lock (Ruby)# CVE Scanner 취약점 분석 리포트
## 📦 log4j-core
| 항목 | 내용 |
|------|------|
| 현재 버전 | 2.14.0 |
| 최신 버전 | 2.23.1 |
| 발견 CVE 수 | 3건 |
### 취약점 목록
| CVE ID | 심각도 | CVSS | 설명 |
|--------|--------|------|------|
| CVE-2021-44228 | 🔴 CRITICAL | 10.0 | Log4Shell |
# NVD API Key (Rate Limit 증가)
export NVD_API_KEY="your-api-key"
# GitHub Token (Rate Limit 증가)
export GITHUB_TOKEN="your-token"
pip install -r requirements.txt
CVE Scanner의 정확도(Precision/Recall/F1)를 검증하는 대규모 테스트 파이프라인이 포함되어 있습니다.
cd scripts
python3 run_accuracy_pipeline.py [--skip-existing] [--fp-verify-sample N]
| 단계 | 스크립트 | 설명 | 소요 시간 |
|---|---|---|---|
| ------ | --------- | ------ | ---------- |
| 1 | generate_test_cases_1000.py | ~1000개 테스트 케이스 생성 | ~2초 |
| 2 | scan_1000_test_cases.py | CVEScanner로 일괄 스캔 | ~20분* |
| 3 | build_ground_truth.py | OSV/NVD 기반 Ground Truth 구축 | ~5분 |
| 4 | verify_accuracy_1000.py | FP 2차 검증 + 정확도 계산 | ~10분 |
*NVD API Key 있을 시
# 테스트 케이스 생성
python3 scripts/generate_test_cases_1000.py
# CVE 스캔
python3 scripts/scan_1000_test_cases.py \
--test-cases /tmp/cve_test_cases/test_cases_1000.json \
--output-dir /tmp/cve_test_results
# Ground Truth 구축
python3 scripts/build_ground_truth.py \
--test-cases /tmp/cve_test_cases/test_cases_1000.json \
--output-dir /tmp/cve_ground_truth
# 정확도 검증
python3 scripts/verify_accuracy_1000.py \
--scan-results /tmp/cve_test_results/scan_results_1000.json \
--ground-truth /tmp/cve_ground_truth/ground_truth_1000.json \
--output-dir /tmp/cve_accuracy
/tmp/cve_accuracy/accuracy_report_1000.json # 최종 정확도 리포트
/tmp/cve_ground_truth/ground_truth_1000.json # Ground Truth 데이터
/tmp/cve_test_results/scan_results_1000.json # 스캔 결과
共 2 个版本