# cve-analyzer **Repository Path**: tinktiny666/cve-analyzer ## Basic Information - **Project Name**: cve-analyzer - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-27 - **Last Updated**: 2026-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenEuler CVE 分析工具 从 GitCode (src-openeuler 组织) 搜索 CVE 问题,并与 Debian Security Tracker 进行对比分析。 ## 功能 - 从 GitCode API 获取 src-openeuler 组织中开启状态的 CVE 相关 issues - 过滤掉 kernel 仓库的 CVE 问题 - 在 Debian Security Tracker 中搜索对应的 CVE 补丁信息 - 在 NVD (National Vulnerability Database) 中搜索 CVE 参考信息 - 检查仓库的 openEuler-24.03-LTS-SP3 分支是否已有该 CVE 的 PR/Commit,如有则过滤 - 软件包匹配检查:过滤掉软件不匹配的 CVE - 输出 JSON 格式的分析结果 ## 环境要求 - Python 3.7+ - 依赖包: requests, beautifulsoup4 ## 安装 ```bash pip install requests beautifulsoup4 ``` ## 使用方法 ```bash 修改cve_analyzer.py中的GITCODE_TOKEN字段,填入自己的gitcode token python cve_analyzer.py ``` ## 输出 程序会在当前目录生成 `cve_analysis_results.json` 文件,包含 CVE 分析结果,每条记录包含: - `cve_id`: CVE 编号 - `gitcode_url`: GitCode 上的 issue 链接 - `repo`: 涉及的仓库 - `debian_patches`: Debian Security Tracker 中的补丁信息 - `nvd_patch_urls`: NVD 中的相关补丁链接 ## 筛选逻辑 程序按以下顺序进行筛选: 1. **搜索 CVE issues**: 获取 src-openeuler 组织中所有未关闭的 CVE-2026 相关 issues 2. **过滤 kernel**: 排除 kernel 仓库的 CVE 3. **获取补丁信息**: 从 Debian Security Tracker 和 NVD 获取补丁 4. **软件匹配检查**: 检查 CVE 对应的软件包是否与仓库匹配 5. **SP3 分支检查**: 检查 openEuler-24.03-LTS-SP3 分支是否已有该 CVE 的 PR/Commit,如有则过滤 6. **输出结果**: 输出有有效补丁信息的 CVE ## 测试 ```bash # 运行所有测试 python test_cve_analyzer.py # 运行特定测试类 python -m unittest test_cve_analyzer.TestCVEAnalyzer # 运行特定测试方法 python -m unittest test_cve_analyzer.TestCVEAnalyzer.test_cve_id_format ```