Loading...
Loading...
Compare original and translation side by side
undefinedundefined
Syft supports over 30 package ecosystems including npm, PyPI, Maven, Go modules, apt, apk, and RPM. The generated SBOM includes package names, versions, licenses, CPE identifiers, and PURL (Package URL) references.
Syft支持超过30种包生态系统,包括npm、PyPI、Maven、Go模块、apt、apk和RPM。生成的SBOM包含包名称、版本、许可证、CPE标识符和PURL(包URL)引用。{
"bomFormat": "CycloneDX",
"specVersion": "1.5",
"components": [
{
"type": "library",
"name": "lodash",
"version": "4.17.20",
"purl": "pkg:npm/lodash@4.17.20",
"cpe": "cpe:2.3:a:lodash:lodash:4.17.20:*:*:*:*:*:*:*",
"licenses": [{"license": {"id": "MIT"}}]
}
],
"dependencies": [
{"ref": "pkg:npm/express@4.18.2", "dependsOn": ["pkg:npm/lodash@4.17.20"]}
]
}{
"spdxVersion": "SPDX-2.3",
"packages": [
{
"name": "lodash",
"versionInfo": "4.17.20",
"externalRefs": [
{"referenceType": "purl", "referenceLocator": "pkg:npm/lodash@4.17.20"},
{"referenceType": "cpe23Type", "referenceLocator": "cpe:2.3:a:lodash:lodash:4.17.20:*:*:*:*:*:*:*"}
],
"licenseConcluded": "MIT"
}
],
"relationships": [
{"spdxElementId": "SPDXRef-express", "relatedSpdxElement": "SPDXRef-lodash",
"relationshipType": "DEPENDS_ON"}
]
}{
"bomFormat": "CycloneDX",
"specVersion": "1.5",
"components": [
{
"type": "library",
"name": "lodash",
"version": "4.17.20",
"purl": "pkg:npm/lodash@4.17.20",
"cpe": "cpe:2.3:a:lodash:lodash:4.17.20:*:*:*:*:*:*:*",
"licenses": [{"license": {"id": "MIT"}}]
}
],
"dependencies": [
{"ref": "pkg:npm/express@4.18.2", "dependsOn": ["pkg:npm/lodash@4.17.20"]}
]
}{
"spdxVersion": "SPDX-2.3",
"packages": [
{
"name": "lodash",
"versionInfo": "4.17.20",
"externalRefs": [
{"referenceType": "purl", "referenceLocator": "pkg:npm/lodash@4.17.20"},
{"referenceType": "cpe23Type", "referenceLocator": "cpe:2.3:a:lodash:lodash:4.17.20:*:*:*:*:*:*:*"}
],
"licenseConcluded": "MIT"
}
],
"relationships": [
{"spdxElementId": "SPDXRef-express", "relatedSpdxElement": "SPDXRef-lodash",
"relationshipType": "DEPENDS_ON"}
]
}import requests
NVD_API = "https://services.nvd.nist.gov/rest/json/cves/2.0"
def search_cves_by_cpe(cpe_name, api_key=None):
params = {"cpeName": cpe_name, "resultsPerPage": 50}
headers = {"apiKey": api_key} if api_key else {}
resp = requests.get(NVD_API, params=params, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json().get("vulnerabilities", [])
def search_cves_by_keyword(keyword, version=None, api_key=None):
params = {"keywordSearch": keyword, "resultsPerPage": 50}
headers = {"apiKey": api_key} if api_key else {}
resp = requests.get(NVD_API, params=params, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json().get("vulnerabilities", [])import requests
NVD_API = "https://services.nvd.nist.gov/rest/json/cves/2.0"
def search_cves_by_cpe(cpe_name, api_key=None):
params = {"cpeName": cpe_name, "resultsPerPage": 50}
headers = {"apiKey": api_key} if api_key else {}
resp = requests.get(NVD_API, params=params, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json().get("vulnerabilities", [])
def search_cves_by_keyword(keyword, version=None, api_key=None):
params = {"keywordSearch": keyword, "resultsPerPage": 50}
headers = {"apiKey": api_key} if api_key else {}
resp = requests.get(NVD_API, params=params, headers=headers, timeout=30)
resp.raise_for_status()
return resp.json().get("vulnerabilities", [])import networkx as nx
def build_dependency_graph(sbom):
G = nx.DiGraph()
# Add nodes for each component
for comp in sbom["components"]:
G.add_node(comp["purl"], name=comp["name"], version=comp["version"])
# Add edges from dependency relationships
for dep in sbom.get("dependencies", []):
for child in dep.get("dependsOn", []):
G.add_edge(dep["ref"], child)
return Gimport networkx as nx
def build_dependency_graph(sbom):
G = nx.DiGraph()
# Add nodes for each component
for comp in sbom["components"]:
G.add_node(comp["purl"], name=comp["name"], version=comp["version"])
# Add edges from dependency relationships
for dep in sbom.get("dependencies", []):
for child in dep.get("dependsOn", []):
G.add_edge(dep["ref"], child)
return GRisk Score Calculation:
━━━━━━━━━━━━━━━━━━━━━━
Component Risk = max(CVSS scores of all CVEs affecting the component)
Weighted Risk = Component Risk * Dependency Factor
where Dependency Factor = 1.0 + (0.1 * in_degree)
(more dependents = higher organizational impact)
Overall SBOM Risk = weighted average of all component risks
weighted by dependency centrality
Risk Levels:
CRITICAL: CVSS >= 9.0 or known exploited (CISA KEV)
HIGH: CVSS >= 7.0
MEDIUM: CVSS >= 4.0
LOW: CVSS < 4.0风险评分计算:
━━━━━━━━━━━━━━━━━━━━━━
组件风险 = 影响该组件的所有CVE的最高CVSS评分
加权风险 = 组件风险 × 依赖因子
其中依赖因子 = 1.0 + (0.1 × 入度)
(依赖者越多=组织影响越大)
整体SBOM风险 = 所有组件风险的加权平均值
按依赖中心性加权
风险等级:
严重:CVSS >= 9.0 或已被利用(CISA KEV)
高:CVSS >= 7.0
中:CVSS >= 4.0
低:CVSS < 4.0undefinedundefined
Grype pulls vulnerability data from NVD, GitHub Security Advisories, Alpine SecDB, Red Hat, Debian, Ubuntu, Amazon Linux, and Oracle security databases, providing broader coverage than NVD alone.
Grype从NVD、GitHub安全公告、Alpine SecDB、Red Hat、Debian、Ubuntu、Amazon Linux和Oracle安全数据库获取漏洞数据,提供比NVD更广泛的覆盖范围。SBOM VULNERABILITY ANALYSIS REPORT
====================================
SBOM File: app-sbom-cyclonedx.json
Format: CycloneDX v1.5
Analysis Date: 2026-03-19
Total Components: 247
Total Dependencies: 1,842 (direct: 34, transitive: 213)
VULNERABILITY SUMMARY
Critical: 3 components / 5 CVEs
High: 11 components / 18 CVEs
Medium: 27 components / 41 CVEs
Low: 8 components / 12 CVEs
CRITICAL FINDINGS
1. lodash@4.17.20
CVE-2021-23337 (CVSS 7.2) - Command Injection via template
CVE-2020-28500 (CVSS 5.3) - ReDoS in trimEnd
Dependents: 14 components (high blast radius)
Fix: Upgrade to 4.17.21+
2. log4j-core@2.14.1
CVE-2021-44228 (CVSS 10.0) - Log4Shell RCE [CISA KEV]
CVE-2021-45046 (CVSS 9.0) - Incomplete fix bypass
Dependents: 8 components
Fix: Upgrade to 2.17.1+
DEPENDENCY GRAPH RISKS
Most depended-on: core-util@1.2.3 (47 dependents)
Deepest chain: app -> framework -> adapter -> codec -> zlib (5 levels)
Bottleneck components: 3 components on >50% of dependency paths
LICENSE COMPLIANCE
Copyleft licenses found: 2 (GPL-3.0 in libxml2, AGPL-3.0 in mongodb-driver)
Review required for commercial distributionSBOM漏洞分析报告
====================================
SBOM文件: app-sbom-cyclonedx.json
格式: CycloneDX v1.5
分析日期: 2026-03-19
组件总数: 247
依赖项总数:1,842(直接:34,传递性:213)
漏洞摘要
严重: 3个组件 / 5个CVE
高: 11个组件 / 18个CVE
中: 27个组件 / 41个CVE
低: 8个组件 / 12个CVE
严重漏洞发现
1. lodash@4.17.20
CVE-2021-23337(CVSS 7.2)- 模板注入命令执行
CVE-2020-28500(CVSS 5.3)- trimEnd中的正则表达式拒绝服务(ReDoS)
依赖者:14个组件(影响范围大)
修复方案:升级至4.17.21+
2. log4j-core@2.14.1
CVE-2021-44228(CVSS 10.0)- Log4Shell远程代码执行 [CISA KEV]
CVE-2021-45046(CVSS 9.0)- 不完整修复绕过
依赖者:8个组件
修复方案:升级至2.17.1+
依赖图风险
被依赖最多的组件:core-util@1.2.3(47个依赖者)
最深依赖链:app -> framework -> adapter -> codec -> zlib(5层)
瓶颈组件:3个组件位于超过50%的依赖路径上
许可证合规性
发现Copyleft许可证:2个(libxml2中的GPL-3.0,mongodb-driver中的AGPL-3.0)
商业分发需进行审查| Term | Definition |
|---|---|
| SBOM | Software Bill of Materials; a formal inventory of all components, libraries, and dependencies in a software product |
| CycloneDX | OWASP-maintained SBOM standard supporting JSON, XML, and protobuf formats with dependency graph and vulnerability data |
| SPDX | Linux Foundation SBOM standard focused on license compliance with support for package, file, and snippet-level detail |
| PURL | Package URL; a standardized scheme for identifying software packages across ecosystems (e.g., pkg:npm/lodash@4.17.21) |
| CPE | Common Platform Enumeration; NIST naming scheme for IT products used to correlate with NVD CVE data |
| NVD | National Vulnerability Database; US government repository of vulnerability data indexed by CVE identifiers |
| Transitive Dependency | A dependency not directly declared but pulled in through the dependency chain of direct dependencies |
| CISA KEV | CISA Known Exploited Vulnerabilities catalog; CVEs confirmed to be actively exploited in the wild |
| 术语 | 定义 |
|---|---|
| SBOM | 软件物料清单;软件产品中所有组件、库和依赖项的正式清单 |
| CycloneDX | OWASP维护的SBOM标准,支持JSON、XML和protobuf格式,包含依赖图和漏洞数据 |
| SPDX | Linux基金会的SBOM标准,专注于许可证合规,支持包、文件和代码片段级别的细节 |
| PURL | 包URL;跨生态系统识别软件包的标准化方案(例如:pkg:npm/lodash@4.17.21) |
| CPE | 通用平台枚举;NIST制定的IT产品命名方案,用于关联NVD CVE数据 |
| NVD | 国家漏洞数据库;美国政府维护的漏洞数据仓库,按CVE标识符索引 |
| Transitive Dependency | 传递性依赖;未直接声明但通过直接依赖的依赖链引入的依赖项 |
| CISA KEV | CISA已知被利用漏洞目录;已确认在野外被主动利用的CVE |