Reuse embedded per-platform SBOMs and consolidate duplicate generation
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- devops, docker, github-actions, shell
- 领域
- devops, infrastructure, security
调研方向
Start by reading .github/workflows/wc-build-push.yml around platform SBOM generation, index merge, and the standalone scan; then inspect the inventory script and helpers/add-sbom-note/add-sbom-note.sh. Reproduce the documented registry inspection for the immutable sample index and compare embedded SPDX with standalone Syft output. Done means tested, validated per-platform extraction and coverage mappings preserve all consumers, with redundant scanning removed only where equivalent.
由索引模型根据 Issue 内容生成。
描述
Goal
Use the existing per-platform BuildKit SBOMs as the canonical source wherever they meet consumer requirements, prove their coverage survives image assembly, and remove redundant post-build scanning without losing release SBOMs, dependency snapshots, or curated tool inventory.
This is not a request to add another scanner or assume platform SBOM generation is missing. Cryptographic signing and verification remain in philips-software/amp-devcontainer#1135.
Findings: two SBOM producers, not a Trivy multi-platform SBOM
Source inspected at af840070c907d71ce06334ea65eded00dc3946a4. Recheck before implementation.
| Path | Current behavior | Consumers |
|---|---|---|
docker/build-push-action, sbom: true |
BuildKit generates SPDX evidence during each platform build, attached through attestation manifests | Image consumers via registry/index |
anchore/sbom-action in merge-image |
Runs Syft again against the merged index without explicit platform selection; writes sbom.spdx.json |
Workflow/release assets, GitHub dependency snapshot, optional curated inventory |
Scheduled crazy-max/ghaction-container-scan |
Trivy vulnerability scanning with JSON/SARIF outputs; workflow does not configure SPDX/CycloneDX generation or a platform matrix | GitHub code-scanning reports |
BuildKit uses its Syft scanner by default unless a generator is overridden; none is specified here. The standalone action also runs Syft. Syft's documented default for an index is linux/amd64, not a scan of all its platforms. Thus there is overlapping generation, but the outputs may differ because of scanner versions/configuration: they must be compared before one is removed.
Real registry evidence
Read-only inspection of public ghcr.io/philips-software/amp-devcontainer-base:edge resolved index:
sha256:5dd8934f7527dbc675901f87357e8d235e4eab480c25ed2facbeaa4a058121f3
| Platform | Image manifest digest | Embedded SPDX blob digest |
|---|---|---|
linux/amd64 |
sha256:19a6a003b06ce3e87059d7eb1c035690cc76ada378a1b2d0e860c74279bcbe5b |
sha256:edf7c16c124ed939bdaf497489d4001411461944208e62101cde41844572ecf3 |
linux/arm64 |
sha256:e6308bce07ca214048ad4a4ff960f6ea10824be91d8af2779546b44facf38e49 |
sha256:efeefb25024ce2c3db4f4ffeddb5527643072e9e3490420bed18d4613f0626a1 |
Both embedded statements:
- Have
predicateType: https://spdx.dev/DocumentandspdxVersion: SPDX-2.3. - Identify their corresponding platform manifest as the subject.
- Report creators
syft-v1.51.0andbuildkit-v0.34.2. - Contain 336 package entries each. Equal counts do not imply identical packages or architecture-independent coverage.
The index therefore already contains an SBOM for each of these two platforms. This proves that sample's coverage and assembly preservation, not every flavor or historical release. The evidence is an in-toto statement stored in the image index, not by itself a cryptographically signed GitHub/Sigstore attestation.
Reproduce without pulling runnable image layers:
image='ghcr.io/philips-software/amp-devcontainer-base@sha256:5dd8934f7527dbc675901f87357e8d235e4eab480c25ed2facbeaa4a058121f3'
docker buildx imagetools inspect "${image}" --raw \
| jq '.manifests[] | {digest, platform, annotations}'
docker buildx imagetools inspect "${image}" --format '{{json .SBOM}}' \
| jq 'to_entries[] | {
platform: .key,
creators: .value.SPDX.creationInfo.creators,
packages: (.value.SPDX.packages | length)
}'
The evidence above was obtained through read-only registry API requests, with descriptor/blob SHA256 checks and subject-to-platform checks. The Docker commands are the documented equivalent inspection path.
Starting points
.github/workflows/wc-build-push.yml: platform generation around lines 118–132, digest handoff and index merge, standalone scan around lines 297–303, and inventory consumers..github/actions/generate-tool-inventory/generate-tool-inventory.sh: consumes one SPDX document and currently deduplicates tools by name.helpers/add-sbom-note/add-sbom-note.sh: custom ELF metadata used to make downloaded tools visible to Syft..github/workflows/vulnerability-scan.yml: separate vulnerability reporting, not the SBOM publication path.docs/reusable-build-system.md,docs/requirements/security.feature, and release-evidence consumers.
Implementation requirements
- Inventory required platforms from the actual runnable image descriptors of the immutable final index. Do not hard-code only the observed architectures or mistake attestation descriptors with
unknown/unknownfor runnable platforms. - Resolve and extract existing embedded SPDX predicates through their attestation manifests. Validate descriptor/blob digests, statement subject, platform association, expected predicate/schema, and nonempty usable package data. Preserve relationships back to the final index. Use supported registry tooling and the existing authentication model for GHCR and external registries.
- Emit a deterministic coverage manifest mapping final index digest → platform → runnable manifest digest → SBOM file/digest and generator metadata. Preserve separate platform documents; do not concatenate package lists into a document that silently conflates architectures or discards differing versions.
- Compare extracted output with the current standalone Syft output on representative images, including custom ELF notes, manually installed tools, purls, versions, and SPDX relationships. Reuse the embedded source when it meets the contract. If a necessary cataloger/configuration difference exists, align the build-time generator where feasible; retain a second scan only with demonstrated necessity and documented scope.
- Preserve every consumer before removing
anchore/sbom-action: workflow artifacts, release attachments, dependency snapshots, curated inventory, and signing inputs for philips-software/amp-devcontainer#1135. File extraction and format conversion do not require rescanning the image filesystem. - Make platform scope explicit for consumers that currently accept one document. Keep their existing compatibility contract with an explicitly identified platform or extend it deliberately with migration guidance. Do not silently flatten conflicting per-platform tool versions, overwrite release assets, or drop dependency information. Ensure outputs have unique flavor/platform names and stable digest mappings.
- Prefer extraction and reuse, not a new scan for every platform. Missing/corrupt/mismatched expected SBOMs must fail the evidence gate clearly; do not silently substitute the host platform's scan and report complete coverage.
- Document generation versus extraction versus signing, expected final-filesystem coverage, and any build-stage/context limitations. Update requirement/test traceability and consumer documentation. Preserve provenance generation and verification.
Required tests
- A multi-platform fixture has architecture-distinct packages/versions. Every runnable platform gets the correct extracted document and subject mapping after index assembly.
- Missing platform SBOM, incorrect subject, altered blob, unsupported/malformed document, duplicate/conflicting candidates, and missing registry permissions fail with actionable diagnostics.
- Extraction handles attestation descriptors without treating them as platforms and works with immutable index references rather than mutable-tag races.
- Existing curated tools, including custom ELF-note packages, remain discoverable; existing consumer tests pass and platform conflicts are not silently deduplicated.
- Release assets and workflow artifacts contain the expected uniquely named documents; dependency snapshots remain valid; signed predicates can consume the same canonical files without regeneration.
- Demonstrate coverage across supported flavors/platforms using a justified shared-workflow test matrix and representative real evidence.
- Show removal of the redundant standalone scan, or record the measured functional reason for any retained scan. Run relevant workflow lint and integration checks.
Acceptance criteria
- Existing platform coverage is proven and continuously checked, rather than assumed missing or complete.
- Canonical per-platform SBOMs and index/platform/digest mappings are available to downstream consumers.
- Redundant generation is removed where equivalent; any retained second scan has an evidenced purpose.
- Release artifacts, dependency snapshots, tool inventory, and provenance keep their intended behavior.
- No platform conflation, unsigned-as-signed claim, or unnecessary additional scanning is introduced.
- Automated positive/negative tests and consumer documentation cover the chosen design.
Coordination
This issue owns canonical SBOM selection, extraction, coverage checks, and consolidation. philips-software/amp-devcontainer#1135 owns cryptographic signing/verification of those documents; it must not treat index attachment alone as sufficient. This issue can complete without waiting for signing, avoiding a circular dependency.
Follow philips-software/amp-devcontainer#1134 for retention of platform subjects and associated registry evidence. Broader vulnerability-scanner coverage is not required here; do not remove the scheduled Trivy scan merely because SBOM generation is consolidated.
References
- 主要语言
- Shell
- 星标
- 136
- 派生
- 8
- 平均合并
- 17 小时 19 分钟
- 30 天内合并 PR
- 53
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
philips-software/amp-devcontainer 的其他 Issue
-
Inventory smoke tests can hang despite command timeout; fail with bounded diagnostics可能已有人在做 @rjaegers 于 23 天前认领。 未关闭
philips-software/amp-devcontainer#1569 · 1 个 reaction · 已指派 2 人 ·
维护者通常 1 天内回复
-
scheduled stale tool-versions
难度 4/5 3-5 天 新手友好度 48/100
philips-software/amp-devcontainer#1475 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
philips-software/amp-devcontainer#1433 · 1 条评论 ·
维护者通常 1 天内回复
-
scheduled tool-versions
难度 4/5 3-5 天 新手友好度 48/100
philips-software/amp-devcontainer#1222 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
philips-software/amp-devcontainer#1136 ·
维护者通常 1 天内回复
查看 philips-software/amp-devcontainer 的全部 Issue
相似的 Issue
-
documentation enhancement
难度 2/5 1-3 小时 新手友好度 82/100
aws/aws-networking-best-practices#256 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
openai-directory
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 68/100
smores56/homelab-platform#289 ·
维护者通常 1 天内回复