blob: 3ac0f9cc1cc8038356d3e65baaee259c43e9ce8d [file] [view] [edit]
# Supply Chain Security (SLSA)
OpenPRoT release firmware is built with signed
[SLSA](https://slsa.dev) build provenance. This page describes what is
attested, how to verify it, and what is not yet covered.
## Current level
**SLSA Build Level 2** for the release artifacts built by
`.github/workflows/release.yml`:
- The build runs on a GitHub-hosted runner, not on the self-hosted CI runner.
- Provenance is generated by `actions/attest-build-provenance` and signed with
a short-lived Sigstore certificate bound to the workflow identity. The build
steps cannot forge the signing identity, but they run in the same job as the
attestation step, so this is not Build L3.
- The build uses `bazel build --config=release`, which sets
`--lockfile_mode=error`: a stale `MODULE.bazel.lock` fails the build rather
than re-resolving dependencies. Build caches are disabled. A
lockfile freshness check also runs in `./pw presubmit`, and therefore on
every pull request: it regenerates the lockfile and fails if the result
differs from the committed file, so drift is caught before release time.
- The GitHub release is created only after `gh attestation verify` passes for
every artifact, so a failed verification never leaves a published release.
## What is attested
Each release publishes, together with its provenance:
- the firmware images produced by the release targets, and
- `SHA256SUMS.txt` listing the digest of each image.
The default release target is the AST10x0 eRoT image,
`//target/ast10x0/erot:erot`, built for the `//target/ast10x0` platform. The
workflow accepts other targets and platforms through `workflow_dispatch`
inputs. Earlgrey and VeeR have no production images yet, only test images.
## Verifying a release artifact
Install the [GitHub CLI](https://cli.github.com/) and run:
```bash
gh attestation verify <artifact> \
--repo OpenPRoT/openprot \
--signer-workflow OpenPRoT/openprot/.github/workflows/release.yml
```
A successful run proves the artifact's digest matches an attestation signed by
the release workflow of this repository. The attestation records the source
commit and the workflow run that produced the artifact. Check the digest of
the file you flash against `SHA256SUMS.txt` as well.
## Workflow hardening
All workflows follow these rules:
- Third-party actions are pinned to a full commit SHA, with the version in a
trailing comment. Dependabot's `github-actions` ecosystem keeps them current.
- Workflows declare least-privilege `permissions:`. Only the release job gets
`id-token: write` and `attestations: write`.
## Known gaps
- **Not Build L3.** Moving the build into a reusable workflow, so the signing
identity is isolated from the build steps, is the path to L3.
- **Hermeticity.** The release workflow checks that the release target does
not reach the non-hermetic repos (`@nonhermetic` in
`target/earlgrey/tooling/signing/nonhermetic.bzl`, which reads `$HOME`, the
pip repo, the locally built QEMU, or the HSM and Caliptra repos), and builds
with `--incompatible_strict_action_env`. Remaining gaps in the release
closure:
- Toolchains (Rust, clang) are fetched from CIPD by tag, not by content
hash.
- `pigweed` and the `ast1060_pac` crate are fetched from git by commit.
The `ast1060_pac` commit is not recorded in `MODULE.bazel.lock`.
- Some crates in `third_party/crates_io/Cargo.toml` use floating git refs
(pinned only by `Cargo.lock`).
- Bazel itself is downloaded by Bazelisk without a hash check.
- **Reproducibility.** In testing, the AST10x0 eRoT build reproduced
bit-for-bit (`erot.bin` and `erot.elf`) across two checkouts at different
paths and against the published release artifacts. That is one commit, one
platform and one runner image, so it is not a guarantee.
`.github/workflows/reproducibility.yml` re-checks it weekly and on release
tags: it builds the release target twice in checkouts at different paths
and compares the outputs. `.bin` images must be identical; differences in
other outputs (such as the `.elf`, which carries debug info) are reported as
warnings. On a difference it uploads a diffoscope report and runs a
same-path rebuild to tell path dependence from non-determinism.
- **Image signing.** Provenance covers the build, not the Earlgrey ECDSA or
SPHINCS+ image signing step, which needs HSM credentials.
- **Source track.** Branch protection, required reviews and `CODEOWNERS` are
not covered here. No SBOM is generated yet.