Skip to content

Supply-chain hardening: fetch robustness, provenance/signature enforcement, secret handling #924

Closed

Description

@TrapsterDK

Feature Proposal

Problem

Fetch, provenance, signing, and secret-handling paths are trust-on-first-use or print-only with no enforcement. Checked open 776-922 (incl. #911-915 hygiene, #916-922 arch, #768 idea, #812 audit inputs, #460/#311 GHCR): none owns the items below.

Evidence:

  • .github/workflows/ghcr.yml:122-124 cosign fetch curl -sL x2, no -f/--retry/--proto, checksums.txt over same unauthenticated channel, no signature on checksums. Canonical .github/actions/setup-bazelisk/action.yml:99 uses curl -fsSL --retry 3 --retry-delay 2. Same anti-pattern in .devcontainer/Dockerfile.prebuilt:43-45 bazelisk fetch.
  • deploy/release/sbom.bzl:24,54-55 builder_id defaults to publish-dry-run.yml with comment real releases replace it, no fail(). deploy/release/src/lib.rs:124-140 render_provenance hardcodes buildType release@v1, invocationId dry-run, arbitrary &str builder with no allowlist. :402-438 sbom_verify_files checks spdxVersion/digest/_type/predicateType only — forged builder.id passes.
  • deploy/release/src/lib.rs:743,764,809,813,897 https://example.com/builder SLSA IDs in 4 tests + goldens; write_provenance(src,dst,builder) :162-168 accepts any string — copy-paste to prod risk.
  • deploy/release/src/lib.rs:290-316 signing_run live path returns dry-run text even live, never Command cosign sign-blob --bundle. deploy/release/signing.bzl:112-116 is_file presence check, no SIGNING_COSIGN_VERSION=v2.4.1 enforcement, no bundle verify.
  • deploy/rules/maven_deploy.py:149-151 -Dgpg.passphrase= on cmdline (ps-visible), unsigned publish allowed (maven.bzl:270 + maven_deploy.py:6); settings.xml with password in mkdtemp never chmod 0600/unlink (:114-133).
  • Registry auth single-string gate: crates_deploy.py:192-213, pypi_deploy.py:122-138, oci_deploy.py:189-213, npm_deploy.py:124-131, promotion_deploy.py:313-337 token + approved==1, no OIDC/expiry. npm_deploy.py:159-170 NamedTemporaryFile(delete=False) with authToken, unlink only in finally; pypi_deploy.py:82-84 TWINE_PASSWORD copies full parent env; crates_deploy.py:144-145 same for cargo.
  • quality/artifacts/update.py:432-436 _download urlopen(timeout=300) no retry/hash/TLS-pin; :554-567 checksums file itself unauthenticated; :552 fallback checksum_source=maintainer-established byte identity for buildifier/biome/taplo silently trusts first bytes.
  • quality/artifacts/extension.bzl:92-133 ctx.download(sha256=outer) then extract + chmod, never checks executable_sha256/member_sha256 recorded in taplo/vale/ruff *.bzl:16. raw conflates outer/inner.
  • .gitleaks.toml:4-6 allowlist regexes=[SBOM/provenance] broad, no expiry/owner. cli/cli/src/exec/audit.rs:332-336 auto-trusts committed .gitleaks.toml if is_file, no hash pin. cli/audit/src/secrets.rs:173-179 + backend.rs:158-163 CONFIG_DISCOVERY_ORDER pushes arbitrary --config; hermetic_env clears env but not file — attacker config can disable rules.

Proposed Scope

  1. Harden all curl fetches (-fS --retry --proto=https --tlsv1.2), pin cosign SHA + verify bundle/signature, not just sha256sum presence.
  2. Bind builder.id allowlist + fail() if dry-run default ships; verify builder in sbom_verify_files; replace example.com IDs with invalid.test or constants.
  3. Implement live cosign sign-blob --bundle + version enforcement + bundle verify; mandate GPG or record unsigned with approval; fix passphrase via env-fd + 0600 + unlink.
  4. Harden registry auth (short-lived/OIDC or document single-string risk), 0600 temp files, minimal env for twine/cargo.
  5. Authenticate checksums_url (signature or pinned hash), retry + TLS; enforce inner executable/member sha256 in extension.bzl.
  6. Narrow gitleaks allowlist with owner/expiry; pin committed config or warn on auto-trust; document --config trust boundary.

Alternatives Considered

  • Leave TOFU (tools already pinned): rejected, first-seen trust + print-only signing give false assurance.
  • Per-tool one-offs: preferred incrementally, tracked here as checklist.

Compatibility Impact

May turn unsigned/unverified publishes red (honest fail-closed); fetches gain retries (fewer flakes). No API break.

Activity

  1. added 3 commits that reference this issue on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions