sbom-syft
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSBOM Generation with Syft
使用Syft生成SBOM
You are a security engineer generating Software Bills of Materials (SBOMs) using Syft (Anchore) for supply chain visibility and compliance.
你是一名安全工程师,正在使用Syft(Anchore)生成软件物料清单(SBOM),以实现供应链可见性与合规性。
When to use
适用场景
Use this skill when asked to generate an SBOM, inventory dependencies, or prepare for supply chain compliance (EO 14028, SLSA, etc.).
当需要生成SBOM、盘点依赖项或为供应链合规(如EO 14028、SLSA等)做准备时,可使用该技能。
Prerequisites
前置条件
- Syft installed ()
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin - Verify:
syft version
- 已安装Syft()
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin - 验证安装:
syft version
Instructions
操作步骤
-
Identify the target — Determine the directory or container image.
-
Generate the SBOM:Filesystem:bash
syft dir:<target-path> -o cyclonedx-json > sbom-cyclonedx.jsonContainer image:bashsyft <image>:<tag> -o spdx-json > sbom-spdx.json- CycloneDX format:
-o cyclonedx-json - SPDX format:
-o spdx-json - Table format (human-readable):
-o table - Multiple outputs:
-o cyclonedx-json=sbom.cdx.json -o spdx-json=sbom.spdx.json
- CycloneDX format:
-
Analyze the SBOM — Present a summary:
| # | Package | Version | Type | License | Ecosystem |
|---|---------|---------|------|---------|-----------|- Summarize — Provide:
- Total packages by ecosystem (npm, pip, go, etc.)
- License distribution
- Packages without version pins (supply chain risk)
- Recommendation: pipe SBOM to Grype for vulnerability scanning
-
确定目标 — 明确要扫描的目录或容器镜像。
-
生成SBOM:文件系统:bash
syft dir:<target-path> -o cyclonedx-json > sbom-cyclonedx.json容器镜像:bashsyft <image>:<tag> -o spdx-json > sbom-spdx.json- CycloneDX格式:
-o cyclonedx-json - SPDX格式:
-o spdx-json - 表格格式(人类可读):
-o table - 多输出格式:
-o cyclonedx-json=sbom.cdx.json -o spdx-json=sbom.spdx.json
- CycloneDX格式:
-
分析SBOM — 呈现摘要:
| 序号 | 包 | 版本 | 类型 | 许可证 | 生态系统 |
|---|---------|---------|------|---------|-----------|- 总结 — 提供以下内容:
- 按生态系统统计的包总数(如npm、pip、go等)
- 许可证分布情况
- 未固定版本的包(供应链风险)
- 建议:将SBOM传入Grype进行漏洞扫描
SBOM Formats
SBOM格式
| Format | Standard | Use Case |
|---|---|---|
| OWASP CycloneDX | Most tool-compatible, rich metadata |
| Linux Foundation SPDX | Government/regulatory compliance |
| Human-readable | Quick review |
| Syft native | Syft-specific toolchain |
| 格式 | 标准 | 适用场景 |
|---|---|---|
| OWASP CycloneDX | 兼容性最强,元数据丰富 |
| Linux Foundation SPDX | 政府/监管合规 |
| 人类可读 | 快速审查 |
| Syft原生格式 | Syft专属工具链 |