Skip to content

feat: prod-readiness PR 3 of 5 — supply chain & bundle integrity#108

Merged
aksOps merged 1 commit into
mainfrom
feat/prod-ready-3-supply-chain
Apr 28, 2026
Merged

feat: prod-readiness PR 3 of 5 — supply chain & bundle integrity#108
aksOps merged 1 commit into
mainfrom
feat/prod-ready-3-supply-chain

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented Apr 28, 2026

Summary

Third of 5 production-readiness PRs. Closes the air-gap drift, missing bundle integrity, and unpinned scanner-version audit findings.

Why

The bundle deployment model assumes an air-gapped target — but pre-PR-3 the launcher scripts fell back to curl -fL https://repo1.maven.org/... when the CLI JAR wasn't bundled, and bundles shipped without any integrity manifest. The .gitignore had narrow secret patterns, the .dockerignore had no secret patterns at all (and does NOT inherit .gitignore), and Semgrep ran unpinned (Scorecard Pinned-Dependencies flag).

Changes

  • codeiq bundle SHA-256 manifest — streaming MessageDigest per entry, no double-read; checksums.sha256 in standard GNU coreutils format. Receivers verify with sha256sum -c checksums.sha256. The manifest excludes itself (circular); out-of-band Sigstore / GPG signs the bundle.zip.
  • No public-internet calls in serve.sh / serve.bat — Maven Central download removed. Fail-fast with a "use --include-jar or stage from internal mirror" message. serve.sh runs sha256sum -c --quiet automatically (skip with CODEIQ_SKIP_VERIFY=1).
  • Pinned Semgrep to semgrep==1.161.0 in .github/workflows/security.yml. Bumps via Dependabot pip ecosystem.
  • Tightened secret patterns in .gitignore + .dockerignore: .env.*, *.jks, *.p12, *.pfx, *.keystore, id_{rsa,ecdsa,ed25519,dsa}, credentials.{json,yaml}, secrets.{json,yaml}, *.serviceaccount.json. (.dockerignore does NOT inherit .gitignore — explicit defense-in-depth.)
  • Bundle verification runbook in shared/runbooks/release.md §4a. Consumer-side sha256sum -c workflow + signing patterns.

Test plan

  • BundleCommandTest#bundleCreatesZipWithCorrectStructure extended — asserts no curl / maven.org in serve.sh, checksums.sha256 exists + matches GNU sha256sum format + excludes itself
  • Full suite: 3672 tests / 0 failures / 0 errors / 32 skipped
  • CI green (build + 6 OSS-CLI security jobs + CodeQL + Socket)
  • Verify auto-merge unblocks once CodeQL completes

🤖 Generated with Claude Code

…cret hygiene + scanner pin

Third of 5 production-readiness PRs. Closes the air-gap drift, missing
bundle integrity, and unpinned scanner-version audit findings.

Why
---
The bundle deployment model assumes an air-gapped target — but pre-PR-3
the launcher scripts fell back to `curl -fL https://repo1.maven.org/...`
when the CLI JAR wasn't bundled, and bundles shipped without any
integrity manifest. The `.gitignore` had narrow secret patterns, the
`.dockerignore` had no secret patterns at all (and does NOT inherit
`.gitignore`), and Semgrep ran unpinned (Scorecard Pinned-Dependencies
flag).

Changes
-------
* **`codeiq bundle` SHA-256 manifest** (`BundleCommand`). Every entry
  is hashed via streaming `MessageDigest` as it writes through
  `ZipOutputStream` — no double-read for hundred-MB graph DBs. A
  final `checksums.sha256` entry in standard GNU coreutils format
  (`<64-hex>  <path>` per line) lets receivers verify with
  `sha256sum -c checksums.sha256`. The manifest itself is excluded
  from itself (would be circular); receivers verify
  `checksums.sha256` integrity out-of-band (Sigstore / GPG / GitHub
  Release SHA-256).

* **No public-internet calls in `serve.sh` / `serve.bat`**. The Maven
  Central download fallback is removed; both scripts fail fast with
  a "place the JAR in this directory or re-bundle with --include-jar"
  message. `serve.sh` automatically runs `sha256sum -c --quiet
  checksums.sha256` before launch (skip with CODEIQ_SKIP_VERIFY=1
  for trusted internal flows). `serve.bat` does not yet have a
  Windows-native equivalent — tracked.

* **Pinned Semgrep version** in `.github/workflows/security.yml`:
  `pip install semgrep` → `pip install 'semgrep==1.161.0'` (latest
  stable as of 2026-04-28). Bumps via Dependabot pip ecosystem.

* **Tightened secret-pattern exclusions**.
  - `.gitignore`: `.env` / `.env.local` → `.env.*` (catches
    `.env.prod`, `.env.test`, ...) plus explicit globs for `*.jks`,
    `*.p12`, `*.pfx`, `*.keystore`, `id_{rsa,ecdsa,ed25519,dsa}`,
    `credentials.{json,yaml}`, `secrets.{json,yaml}`,
    `*.serviceaccount.json`.
  - `.dockerignore`: mirrors the same rules. Docker resolves COPY
    against the build context which includes untracked working-tree
    files; .dockerignore does not inherit .gitignore.

* **Bundle verification runbook** in
  `shared/runbooks/release.md` §4a. Documents consumer-side
  `sha256sum -c` workflow with CODEIQ_SKIP_VERIFY semantics and the
  out-of-band signing pattern.

Test coverage
-------------
* `BundleCommandTest#bundleCreatesZipWithCorrectStructure`: 4 new
  asserts — `serve.sh` contains no `curl` / `maven.org` (defense
  against re-introduction), `checksums.sha256` exists,
  format-conforms to `<64-hex>  <path>`, excludes itself.
* Full suite: 3672 tests / 0 failures / 0 errors / 32 skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aksOps aksOps enabled auto-merge (squash) April 28, 2026 09:16
@aksOps aksOps merged commit e40350f into main Apr 28, 2026
13 checks passed
@aksOps aksOps deleted the feat/prod-ready-3-supply-chain branch April 28, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant