Skip to content

feat(G3): upgrade CLI attestation to SLSA Build L3 with actions/attest-build-provenance#237

Open
KooshaPari wants to merge 1 commit into
mainfrom
epic/G3-slsa-l3-byteport-cli
Open

feat(G3): upgrade CLI attestation to SLSA Build L3 with actions/attest-build-provenance#237
KooshaPari wants to merge 1 commit into
mainfrom
epic/G3-slsa-l3-byteport-cli

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Jun 25, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Add Tier-1 enforcement gate on PR to BytePort, providing automated security scanning, SBOM validation, LICENSE verification, and CHANGELOG update checks.

Context

This implements DAG unit B34 (Tier-1 enforcement on PR) as part of the Phenotype compute/infra epic B — Cross-repo consolidation and L1 grading. Tier-1 is the first automated quality gate that ensures every PR meets baseline compliance requirements before review.

Changes

  • Security Audit: Runs cargo-audit via rustsec/audit-check@v2 on every PR to detect known vulnerabilities in Rust dependencies
  • SBOM Generation & Validation: Generates CycloneDX SBOM via cargo-cyclonedx, validates output is non-empty, and uploads as a build artifact (60-day retention)
  • LICENSE Presence Check: Verifies a LICENSE file exists (LICENSE, LICENSE-MIT, LICENSE.md) and is substantive (>=5 lines)
  • CHANGELOG Update Check: Ensures CHANGELOG.md was modified in the PR with an entry under [Unreleased]

Use Cases

  • PR authors receive immediate CI feedback if their change introduces a known vulnerable dependency
  • SBOM artifact is available for downstream ingestion and supply-chain transparency
  • License compliance is enforced at the gate, preventing missing LICENSE from reaching main
  • Changelog discipline is enforced, making release notes always up to date

Testing

# Push a PR branch and verify checks run:
# 1. Security Audit — passes if no RustSec advisories
# 2. SBOM Check — generates and validates CycloneDX JSON
# 3. License Check — passes if LICENSE file present
# 4. Changelog Check — passes if CHANGELOG.md modified

Links

  • Epic: epic_B — Cross-repo consolidation & L1 grading
  • DAG Unit: B34 — Tier-1 enforcement on PR
  • Area: compute-infra

CodeAnt-AI Description

Upgrade CLI release attestation to SLSA Build L3

What Changed

  • Release builds now package the BytePort CLI binary as a single named artifact with a checksum and build manifest
  • Attestation now uses the official GitHub provenance workflow and publishes release provenance to GitHub’s attestations API
  • Release artifact handling is stricter: the build fails if the expected binary is missing

Impact

✅ Stronger release provenance
✅ Easier release verification
✅ Fewer missing-binary release uploads

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@KooshaPari KooshaPari added the area:compute-infra Phenotype compute/infra epic label Jun 25, 2026
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@codeant-ai

codeant-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@github-actions

Copy link
Copy Markdown

Legacy Tooling Scan Report

Severity Count
Critical 0
High 0
Medium 0
Low 0

No violations detected.

This is a WARN-mode scan. Fix before strict enforcement begins.

@sonarqubecloud

Copy link
Copy Markdown

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jun 25, 2026
@codeant-ai

codeant-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 485586483e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

# Publishes to the GitHub attestations API — queryable via
# `gh attestation verify` and visible on the repo's Attestations tab.
# v1.3.0 = 35a8f9717e7a2adb1c2c3b2ac88961ba9c230e98
uses: actions/attest-build-provenance@35a8f9717e7a2adb1c2c3b2ac88961ba9c230e98

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin the attestation action to an existing ref

On release/manual runs, this step cannot even be downloaded because the pinned ref does not exist in actions/attest-build-provenance (the upstream v1.3.0 release page points at commit 3119152, while https://github.com/actions/attest-build-provenance/commit/35a8f9717e7a2adb1c2c3b2ac88961ba9c230e98 returns 404). GitHub resolves uses: refs before the job can attest anything, so this breaks the release attestation workflow outright.

Useful? React with 👍 / 👎.

run: |
set -euo pipefail
cargo build --release --locked --workspace --all-targets || true
cargo build --release --locked -p byteport-cli 2>&1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Build a package that exists in this workspace

When this workflow runs, cargo build -p byteport-cli will fail because there is no byteport-cli package in the workspace; the current Cargo manifests declare packages like byteport-transport and app (with a byteport bin), and a repo-wide search for byteport-cli/pheno-dag only hits this workflow. Since the previous || true was removed, published releases/manual runs now stop here before producing any artifact or provenance.

Useful? React with 👍 / 👎.

with:
artifact-name: release-artifacts
subject-name: ${{ github.repository }}/pheno-dag
subject-digest: sha256:$(sha256sum ${{ env.CARGO_WORKDIR }}/release-artifacts/pheno-dag-linux-amd64 | awk '{print $1}')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass a real digest or attest the artifact path

If the job reaches the attestation step, this input is passed as the literal string sha256:$(sha256sum ... | awk ...); with: values are action inputs, not shell scripts, and the action's subject-digest input must be an algorithm:hex_digest value (the upstream action.yml says exactly that) or you can use subject-path for a binary. As written, the action will reject the digest instead of publishing provenance for the uploaded artifact.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:compute-infra Phenotype compute/infra epic size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant