mokkunsuzuki-code/stage238

GitHub: mokkunsuzuki-code/stage238

Stage238是一个基于GitHub Actions可复用工作流和策略治理的SLSA对齐构建系统,用于标准化供应链证据生成和构建流程。

Stars: 0 | Forks: 0

Stage238:通过可复用工作流和策略实现 SLSA 对齐构建 ## 概述 Stage238 将构建和证明模型从单一工作流实现升级为**策略治理的可复用工作流架构**。 此阶段确保: - 所有构建来源均通过集中式可复用工作流生成 - SBOM 生成和证明标准化 - 构建逻辑不再在工作流中重复 - 供应链证据生成变得受策略约束 ## 关键概念 上一阶段: Stage237 → 生成证明 Stage238: → **通过可复用工作流 + 策略标准化和强制执行证明生成** ## 架构 ### 1. 调用方工作流(策略入口点) `.github/workflows/stage238-slsa-policy.yml` - 定义允许的入口点 - 将执行委托给可复用工作流 - 不直接实现构建逻辑 ### 2. 可复用工作流(策略核心) `.github/workflows/reusable-slsa-build.yml` 负责: - 工件构建 - SHA256 摘要生成 - SBOM 生成(通过 Syft 的 SPDX) - 工件上传 - 构建来源证明 - SBOM 证明 ### 3. 策略文档 `docs/slsa_policy.md` 定义: - 允许的构建路径 - 所需权限 - 预期输出 - 审核人验证点 ## 构建输出 - `stage238-source-bundle.tar.gz` - `stage238-source-bundle.sha256` - SPDX SBOM(`.spdx.json`) - GitHub 构建来源证明 - GitHub SBOM 证明 - Sigstore 签名 - Rekor 透明度日志条目 ## 安全含义 此阶段**不**声称: - 完整 SLSA 合规性 - 完整的供应链安全保证 相反,它提供: - 对来源生成方式的治理 - 可重现且可审计的构建结构 - 标准化的证明管道 ## 本地验证 ``` python3 tools/verify_stage238_policy.py ./tools/build_stage238_artifact.sh GitHub Actions Verification Run: stage238-slsa-policy Verify: Artifact uploaded SBOM generated Provenance attestation created SBOM attestation created Rekor transparency entry exists Reviewer Guide A reviewer should confirm: Caller workflow only invokes reusable workflow Reusable workflow uses workflow_call Attestation steps are centralized No duplicate build logic exists Outputs are consistent across runs Why This Matters This stage shifts the system from: "Attestation exists" to: "Attestation is generated through a controlled, reusable, policy-defined path" This improves: Reproducibility Auditability Trust in supply-chain evidence Next Stage Stage239: → Verification Policy Enforcement Only artifacts that satisfy policy conditions are accepted. License MIT License © 2025 Motohiro Suzuki ```
标签:Cutter, GitHub Actions, Provenance, Rekor, SBOM, Sigstore, SLSA, SPDX, Syft, 可重用工作流, 审计, 提示词模板, 文档安全, 构建安全, 构建流水线, 硬件无关, 策略治理, 自动笔记, 证明生成, 软件供应链, 逆向工具, 透明日志