diff --git a/.github/workflows/offline-bundle.yml b/.github/workflows/offline-bundle.yml index 1d865447d..09ef96dc7 100644 --- a/.github/workflows/offline-bundle.yml +++ b/.github/workflows/offline-bundle.yml @@ -34,6 +34,7 @@ on: paths: - "deploy/images.manifest.txt" - "scripts/release/**" + - "install.sh" - "docker-compose*.yml" - "k8s/**" - "openshiftsetup/**" @@ -44,6 +45,7 @@ on: paths: - "deploy/images.manifest.txt" - "scripts/release/**" + - "install.sh" - "docker-compose*.yml" - "k8s/**" - "openshiftsetup/**" @@ -250,17 +252,19 @@ jobs: test "$(sha256sum verified-images/release-manifest.json | cut -d' ' -f1)" = \ "$(sha256sum dist/release-manifest.json | cut -d' ' -f1)" - # M-14: checksums of install.sh and every file it downloads, from the - # git blobs raw.githubusercontent.com serves for this ref. - - name: Installer checksums + # Publish the installer from the release tag itself, beside checksums of + # it and every file it downloads. The provenance step below signs this + # exact installer before it becomes a release asset. + - name: Installer artifact and checksums run: | set -euo pipefail + git show HEAD:install.sh > dist/install.sh for path in install.sh docker-compose.release.yml .env.example scripts/gen-dev-env.sh scripts/init-db.sql; do printf '%s %s\n' "$(git show "HEAD:$path" | sha256sum | cut -d' ' -f1)" "$path" done > dist/SHA256SUMS cat dist/SHA256SUMS - # Signed SLSA build provenance for the four release files, recorded in + # Signed SLSA build provenance for the five release files, recorded in # Sigstore's public log and this repository's attestations. The bundle is # also kept as testlookup-offline-.intoto.jsonl so it can be # attached to the GitHub release with the files it covers: OpenSSF @@ -287,6 +291,7 @@ jobs: subject-path: | dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz.sha256 + dist/install.sh dist/SHA256SUMS dist/release-manifest.json @@ -335,6 +340,7 @@ jobs: path: | dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz.sha256 + dist/install.sh dist/SHA256SUMS dist/release-manifest.json dist/*.intoto.jsonl diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index b992278a9..7d3419b5a 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -13,13 +13,78 @@ This walkthrough takes you from nothing to your own test results in TestLookup o Choose one option, not both. -**Option A: one-command install (recommended for evaluation).** It runs the published images, builds nothing, and adds the demo projects: +**Option A: authenticated release install (recommended for evaluation).** It requires a [GitHub CLI](https://cli.github.com/) version that provides `gh api`, `gh release download`, and `gh release verify-asset` plus artifact provenance verification; authenticate with `gh auth login` or set `GH_TOKEN` (a fine-grained token needs Contents and Attestations read access). It verifies the versioned installer before running it, uses the published images, builds nothing, and adds the demo projects: ```bash -curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | TL_PROFILE=demo bash +( + set -euo pipefail + TL_REPOSITORY="test-intelligence/testlookup" + TL_RELEASE_FILTER=' + .tag_name as $tag + | ([.assets[].name]) as $assets + | select( + .draft == false + and .prerelease == false + and .immutable == true + and ($tag | test("^v[0-9]+\\.[0-9]+\\.[0-9]+$")) + and (($assets | index("install.sh")) != null) + and (($assets | index("testlookup-offline-\($tag | ltrimstr("v")).intoto.jsonl")) != null) + ) + | .tag_name + ' + if [ -n "${TL_INSTALLER_VERSION:-}" ]; then + [[ "$TL_INSTALLER_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { + printf 'error: TL_INSTALLER_VERSION must be a vX.Y.Z release tag.\n' >&2 + exit 1 + } + TL_SELECTED="$(gh api "repos/${TL_REPOSITORY}/releases/tags/${TL_INSTALLER_VERSION}" \ + --jq "$TL_RELEASE_FILTER")" || { + printf 'error: could not inspect %s; run gh auth login or set GH_TOKEN.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + [ "$TL_SELECTED" = "$TL_INSTALLER_VERSION" ] || { + printf 'error: %s is not an eligible immutable installer release with install.sh and its version-matched provenance bundle.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + else + TL_CANDIDATES="$(gh api --paginate "repos/${TL_REPOSITORY}/releases?per_page=100" \ + --jq ".[] | ${TL_RELEASE_FILTER}")" || { + printf 'error: could not inspect TestLookup releases; run gh auth login or set GH_TOKEN.\n' >&2 + exit 1 + } + TL_INSTALLER_VERSION="${TL_CANDIDATES%%$'\n'*}" + [ -n "$TL_INSTALLER_VERSION" ] || { + printf 'error: no eligible immutable TestLookup release includes install.sh and its version-matched provenance bundle; use a source clone until one is published.\n' >&2 + exit 1 + } + fi + TL_BUNDLE="testlookup-offline-${TL_INSTALLER_VERSION#v}.intoto.jsonl" + TL_BOOTSTRAP="$(mktemp -d)" + trap 'rm -rf "$TL_BOOTSTRAP"' EXIT + gh release download "$TL_INSTALLER_VERSION" --repo test-intelligence/testlookup \ + --pattern install.sh --pattern "$TL_BUNDLE" --dir "$TL_BOOTSTRAP" || { + printf 'error: failed to download the authenticated installer assets for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh release verify-asset "$TL_INSTALLER_VERSION" "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup || { + printf 'error: install.sh failed immutable release-asset verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh attestation verify "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup \ + --signer-workflow test-intelligence/testlookup/.github/workflows/offline-bundle.yml \ + --source-ref refs/heads/main \ + --bundle "$TL_BOOTSTRAP/$TL_BUNDLE" || { + printf 'error: install.sh failed trusted offline-bundle.yml/main provenance verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + TL_REF="$TL_INSTALLER_VERSION" TESTLOOKUP_VERSION="$TL_INSTALLER_VERSION" \ + TL_PROFILE=demo bash "$TL_BOOTSTRAP/install.sh" +) ``` -The installer downloads `docker-compose.release.yml` into `./testlookup`, authenticates the release's exact application-image digests, writes a production-mode `.env` with random secrets, and starts the images with `docker-compose.images.yml` layered on top. The images are about 1 GB to download (0.95 GB for linux/amd64, measured on 11 November 2026); on a 100 Mbit/s connection, expect about 5 minutes until the dashboard answers. The demo projects (three projects with history) load in the background after the database is ready: `docker compose -f docker-compose.release.yml -f docker-compose.images.yml logs -f seed-init`, run from `./testlookup`, shows progress. Leave out `TL_PROFILE=demo` for an empty instance. Other options are in the [Compose guide](docs/operations/deploy-compose.md#release-images-without-a-clone). +The bootstrap skips mutable or asset-less releases, pins the installer and deployment files to the same eligible release, and fails rather than falling back when an explicit tag is ineligible. The installer downloads `docker-compose.release.yml` into `./testlookup`, authenticates the release's exact application-image digests, writes a production-mode `.env` with random secrets, and starts the images with `docker-compose.images.yml` layered on top. The images are about 1 GB to download (0.95 GB for linux/amd64, measured on 11 November 2026); on a 100 Mbit/s connection, expect about 5 minutes until the dashboard answers. The demo projects (three projects with history) load in the background after the database is ready: `docker compose -f docker-compose.release.yml -f docker-compose.images.yml logs -f seed-init`, run from `./testlookup`, shows progress. Leave out `TL_PROFILE=demo` on the final command for an empty instance. Set `TL_INSTALLER_VERSION=vX.Y.Z` before the block to choose an eligible release. The existing `v0.1.0` release predates this installer's required assets, so use Option B until a newer eligible release is published. Other options are in the [Compose guide](docs/operations/deploy-compose.md#release-images-without-a-clone). **Option B: build from a clone (development).** diff --git a/README.md b/README.md index 1ee8bbbdb..ff85a9160 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

Website · Docs · - Quick start · + Quick start · Demo · Features · Roadmap @@ -33,17 +33,82 @@ TestLookup collects the test reports your CI already produces, keeps their history per project, classifies why each test fails, and turns that evidence into a release recommendation you can audit. It runs on your own servers, and its AI analysis defaults to a local model, with hosted model providers blocked until you allow them. -## Run it in one command +## Install an authenticated release -You need Docker with Compose v2, Bash (on Windows, Git Bash or WSL), and the [GitHub CLI](https://cli.github.com/) to authenticate the release manifest and image provenance. This installs the published images with demo projects, so your first dashboard already has data: +You need Docker with Compose v2, Bash (on Windows, Git Bash or WSL), and a [GitHub CLI](https://cli.github.com/) version that provides `gh api`, `gh release download`, and `gh release verify-asset` plus artifact provenance verification. Authenticate first with `gh auth login`, or set `GH_TOKEN`; a fine-grained token needs Contents and Attestations read access to this repository. This selects the newest eligible immutable release, verifies the installer before Bash interprets it, and installs the published images with demo projects: ```bash -curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | TL_PROFILE=demo bash +( + set -euo pipefail + TL_REPOSITORY="test-intelligence/testlookup" + TL_RELEASE_FILTER=' + .tag_name as $tag + | ([.assets[].name]) as $assets + | select( + .draft == false + and .prerelease == false + and .immutable == true + and ($tag | test("^v[0-9]+\\.[0-9]+\\.[0-9]+$")) + and (($assets | index("install.sh")) != null) + and (($assets | index("testlookup-offline-\($tag | ltrimstr("v")).intoto.jsonl")) != null) + ) + | .tag_name + ' + if [ -n "${TL_INSTALLER_VERSION:-}" ]; then + [[ "$TL_INSTALLER_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { + printf 'error: TL_INSTALLER_VERSION must be a vX.Y.Z release tag.\n' >&2 + exit 1 + } + TL_SELECTED="$(gh api "repos/${TL_REPOSITORY}/releases/tags/${TL_INSTALLER_VERSION}" \ + --jq "$TL_RELEASE_FILTER")" || { + printf 'error: could not inspect %s; run gh auth login or set GH_TOKEN.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + [ "$TL_SELECTED" = "$TL_INSTALLER_VERSION" ] || { + printf 'error: %s is not an eligible immutable installer release with install.sh and its version-matched provenance bundle.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + else + TL_CANDIDATES="$(gh api --paginate "repos/${TL_REPOSITORY}/releases?per_page=100" \ + --jq ".[] | ${TL_RELEASE_FILTER}")" || { + printf 'error: could not inspect TestLookup releases; run gh auth login or set GH_TOKEN.\n' >&2 + exit 1 + } + TL_INSTALLER_VERSION="${TL_CANDIDATES%%$'\n'*}" + [ -n "$TL_INSTALLER_VERSION" ] || { + printf 'error: no eligible immutable TestLookup release includes install.sh and its version-matched provenance bundle; use a source clone until one is published.\n' >&2 + exit 1 + } + fi + TL_BUNDLE="testlookup-offline-${TL_INSTALLER_VERSION#v}.intoto.jsonl" + TL_BOOTSTRAP="$(mktemp -d)" + trap 'rm -rf "$TL_BOOTSTRAP"' EXIT + gh release download "$TL_INSTALLER_VERSION" --repo test-intelligence/testlookup \ + --pattern install.sh --pattern "$TL_BUNDLE" --dir "$TL_BOOTSTRAP" || { + printf 'error: failed to download the authenticated installer assets for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh release verify-asset "$TL_INSTALLER_VERSION" "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup || { + printf 'error: install.sh failed immutable release-asset verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh attestation verify "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup \ + --signer-workflow test-intelligence/testlookup/.github/workflows/offline-bundle.yml \ + --source-ref refs/heads/main \ + --bundle "$TL_BOOTSTRAP/$TL_BUNDLE" || { + printf 'error: install.sh failed trusted offline-bundle.yml/main provenance verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + TL_REF="$TL_INSTALLER_VERSION" TESTLOOKUP_VERSION="$TL_INSTALLER_VERSION" \ + TL_PROFILE=demo bash "$TL_BOOTSTRAP/install.sh" +) ``` - **Time and size:** the images are about 1 GB to download (0.95 GB for linux/amd64, measured on 11 November 2026). On a 100 Mbit/s connection, expect about 5 minutes from the command to a working dashboard. Leave about 8 GB of memory free for the services. - **Then:** open [localhost:3000](http://localhost:3000) and sign in as `admin`. The installer never prints the password: it is in `testlookup/.env` as `INITIAL_ADMIN_PASSWORD` (readable by you only; `grep '^INITIAL_ADMIN_PASSWORD=' testlookup/.env` shows it), and you choose a new one at the first sign-in. The demo projects load in the background after the database is ready. -- **What it does:** downloads the release Compose file into `./testlookup`, authenticates the release's exact image digests, writes a `.env` with random secrets in production mode (no passwordless login), and starts the stack with those digests. Read [install.sh](install.sh) first if your policy asks you to. Leave out `TL_PROFILE=demo` to start with an empty instance for your team. +- **What it does:** skips releases that are mutable or lack either required installer asset, checks the downloaded `install.sh` against the selected immutable release and the fixed release workflow on `main`, downloads the matching release Compose file into `./testlookup`, authenticates the release's exact image digests, writes a `.env` with random secrets in production mode (no passwordless login), and starts the stack with those digests. Set `TL_INSTALLER_VERSION=vX.Y.Z` before the block to choose an eligible release; an ineligible explicit tag fails without falling back. Leave out `TL_PROFILE=demo` on the final command to start with an empty instance for your team. The existing `v0.1.0` release predates the required installer assets, so use the source-clone option below until a newer eligible release is published. Nothing to install? Replay real screens in the browser with the [guided tours](https://testlookup.app/demo/) (first run, failure triage, release review), or [open a Codespace](https://codespaces.new/test-intelligence/testlookup?quickstart=1) that starts the full app with demo data on your GitHub account's Codespaces allowance. @@ -111,13 +176,13 @@ TestLookup ingests Allure results and JUnit-style output from those tools; it co The website's [quick start](https://testlookup.app/docs/next/quickstart/) uses the same two options. Pick one: both use the same ports and container names, so only one copy runs on a machine. Both need Docker with Compose v2 and Bash, about 8 GB of free memory, and free ports 3000, 8000, 8002, 5433, 6379, 9000 and 27017; see the [sizing guide](user-guide/sizing.md) for disk. -### Option A: one-command install (published images) +### Option A: authenticated release install (published images) -The [command above](#run-it-in-one-command). It pulls `ghcr.io/test-intelligence/testlookup` images by the authenticated release digests and builds nothing. Sign-in is always `admin`, with the password from `.env` (`INITIAL_ADMIN_PASSWORD`). Other settings (`TESTLOOKUP_VERSION` to select a release, `TL_PROFILE=local-llm` for local models, `TL_DIR`, `TL_NO_UP`) are in the [Compose guide](docs/operations/deploy-compose.md#release-images-without-a-clone). Explicit `TL_REF=main` installs remain available for unreleased evaluation builds, warn that they are unverified, and use the moving `latest` tag. +The [commands above](#install-an-authenticated-release). They pull `ghcr.io/test-intelligence/testlookup` images by the authenticated release digests and build nothing. Sign-in is always `admin`, with the password from `.env` (`INITIAL_ADMIN_PASSWORD`). Other settings (`TL_PROFILE=local-llm` for local models, `TL_DIR`, `TL_NO_UP`) are in the [Compose guide](docs/operations/deploy-compose.md#release-images-without-a-clone). Explicit `TL_REF=main` installs remain available for unreleased evaluation builds after authenticating a release installer; they warn that the subsequently downloaded files are unverified and use the moving `latest` tag. #### Check a release before you run it -CI signs every published image, and the release process signs the digest manifest and offline bundle. The installer performs these checks automatically; you can also use the GitHub CLI to check that an image or bundle came from this repository's own workflow on `main`: +CI signs every published image, and the release process signs the installer, digest manifest and offline bundle. The bootstrap above authenticates the installer before it runs, and the installer checks the remaining release inputs automatically. You can also use the GitHub CLI to check that an image or bundle came from this repository's own workflow on `main`: ```bash # An image (the same for frontend and mcp) diff --git a/RELEASING.md b/RELEASING.md index d02a7b392..2c344dc23 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -81,12 +81,13 @@ How a maintainer cuts a release. Users upgrading an install want (refusing if `:vX.Y.Z` is missing or is not CI's image of the tagged commit), bundles them without rebuilding, and checks the import with the network blocked. The run's `offline-bundle` artifact (kept 30 days) holds - `testlookup-offline-X.Y.Z.tar.gz`, its `.sha256`, `SHA256SUMS` for - `install.sh` and the files it downloads, `release-manifest.json` with the - exact backend, frontend and MCP digests authenticated against CI, and - `testlookup-offline-X.Y.Z.intoto.jsonl`, the signed SLSA build provenance of - those four files. Attach all five to the **draft** GitHub release: releases - are immutable once published, so a file left off cannot be added later. + `testlookup-offline-X.Y.Z.tar.gz`, its `.sha256`, the versioned `install.sh`, + `SHA256SUMS` for the installer and the files it downloads, + `release-manifest.json` with the exact backend, frontend and MCP digests + authenticated against CI, and `testlookup-offline-X.Y.Z.intoto.jsonl`, the + signed SLSA build provenance of those five files. Attach all six to the + **draft** GitHub release: releases are immutable once published, so a file + left off cannot be added later. OpenSSF Scorecard's Signed-Releases check reads the `.intoto.jsonl` asset, and anyone can check a download with @@ -99,9 +100,11 @@ How a maintainer cuts a release. Users upgrading an install want (add `--bundle testlookup-offline-X.Y.Z.intoto.jsonl` to check against the attached file instead of asking GitHub). The same command checks the - `.sha256` file, `SHA256SUMS` and `release-manifest.json`. The online - installer verifies the last two with the attached provenance bundle, then - verifies every manifest digest against CI before it starts Compose. + `.sha256` file, `install.sh`, `SHA256SUMS` and `release-manifest.json`. The + documented bootstrap authenticates `install.sh` before execution. The online + installer verifies the last two data files with the attached provenance + bundle, then verifies every manifest digest against CI before it starts + Compose. `make offline-bundle` builds the images from source, so use it for testing, not for a release. Under Podman it also names the app images `localhost/testlookup/...`, which a Docker host cannot import. @@ -133,5 +136,5 @@ assembled release. Branch protection should require the lightweight check on - [ ] `CITATION.cff` has the same `version` and the release's `date-released` - [ ] `THIRD_PARTY_NOTICES.md` regenerated (`--check` passes) - [ ] "Promote verified release" succeeded; `:vX.Y.Z` exists for backend, frontend and mcp -- [ ] Offline bundle built and all five assets attached to the draft (including `release-manifest.json` and provenance) +- [ ] Offline bundle built and all six assets attached to the draft (including `install.sh`, `release-manifest.json` and provenance) - [ ] GitHub release published diff --git a/docker-compose.release.yml b/docker-compose.release.yml index b6b0336ae..9290d03c8 100644 --- a/docker-compose.release.yml +++ b/docker-compose.release.yml @@ -7,10 +7,11 @@ name: testlookup # This file pulls pinned, pre-built images from the GitHub # Container Registry instead of building from source. # -# Fastest path — the remote one-liner does everything for you: -# curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | bash +# Recommended path — authenticate the immutable release installer before use: +# https://github.com/test-intelligence/testlookup#install-an-authenticated-release # -# Or by hand (download this file + the env tooling, generate .env, then up): +# Deliberate unreleased path (mutable and unauthenticated; do not use this to +# install a published release): # mkdir testlookup && cd testlookup && mkdir scripts # base=https://raw.githubusercontent.com/test-intelligence/testlookup/main # curl -fsSLO $base/docker-compose.release.yml diff --git a/docs/maintainers/launch/org-profile-README.md b/docs/maintainers/launch/org-profile-README.md index 98237b4b8..00ab31ca1 100644 --- a/docs/maintainers/launch/org-profile-README.md +++ b/docs/maintainers/launch/org-profile-README.md @@ -20,11 +20,7 @@ - **Repository:** [test-intelligence/testlookup](https://github.com/test-intelligence/testlookup) (Apache-2.0) - **Website and docs:** [testlookup.app](https://testlookup.app) · [quick start](https://testlookup.app/docs/next/quickstart/) · [guided demo tours](https://testlookup.app/demo/) · [roadmap](https://testlookup.app/roadmap/) -- **Try it** (Docker with Compose v2; about 1 GB of images, demo data included): - - ```bash - curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | TL_PROFILE=demo bash - ``` +- **Try it** (Docker with Compose v2; about 1 GB of images, demo data included): follow the repository's [authenticated release install](https://github.com/test-intelligence/testlookup#install-an-authenticated-release).

TestLookup: the pass rate for each of the last 14 days against the GO line, and the failing tests classified by kind diff --git a/docs/maintainers/launch/release-notes-0.1.0.md b/docs/maintainers/launch/release-notes-0.1.0.md index da61fd3f1..0d1103e7e 100644 --- a/docs/maintainers/launch/release-notes-0.1.0.md +++ b/docs/maintainers/launch/release-notes-0.1.0.md @@ -10,13 +10,15 @@ TestLookup is open-source software test intelligence. It collects the test repor ## Install -Try it with demo data (Docker with Compose v2 and Bash; about 1 GB of images): +The `v0.1.0` release predates the authenticated no-clone installer's required `install.sh` and provenance assets. To try that historical release with demo data, use its source checkout (Docker with Compose v2, Bash and Git; about 1 GB of images): ```bash -curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/v0.1.0/install.sh | TL_REF=v0.1.0 TESTLOOKUP_VERSION=v0.1.0 TL_PROFILE=demo bash +git clone --branch v0.1.0 --depth 1 https://github.com/test-intelligence/testlookup.git +cd testlookup +make quickstart ``` -Open `http://localhost:3000` and sign in as `admin` with the password the installer prints. Leave out `TL_PROFILE=demo` for an empty instance. From a clone: `git checkout v0.1.0 && make quickstart`. On Kubernetes: `scripts/deploy-k8s.sh --cloud=self-hosted --image-tag=v0.1.0` (the overlays already pin `v0.1.0`). Every mode: the [deployment guide](https://github.com/test-intelligence/testlookup/blob/v0.1.0/docs/operations/deployment.md). +Open `http://localhost:3000`; this local demo uses passwordless Quick Login. On Kubernetes: `scripts/deploy-k8s.sh --cloud=self-hosted --image-tag=v0.1.0` (the overlays already pin `v0.1.0`). Every mode: the [deployment guide](https://github.com/test-intelligence/testlookup/blob/v0.1.0/docs/operations/deployment.md). | Image | Tag | Digest | |---|---|---| diff --git a/docs/operations/deploy-compose.md b/docs/operations/deploy-compose.md index 6963f3077..d6ca75d2f 100644 --- a/docs/operations/deploy-compose.md +++ b/docs/operations/deploy-compose.md @@ -80,13 +80,78 @@ The lite stack omits Ollama, ChromaDB, Flower, the MCP server and the beat sched ## Release images without a clone -`install.sh` installs TestLookup from published images, with nothing built from source. Published releases require Docker with Compose v2, Bash, and the [GitHub CLI](https://cli.github.com/) for provenance verification: +`install.sh` installs TestLookup from published images, with nothing built from source. Published releases require Docker with Compose v2, Bash, and a [GitHub CLI](https://cli.github.com/) version that provides `gh api`, `gh release download`, and `gh release verify-asset` plus artifact provenance verification. Authenticate with `gh auth login`, or set `GH_TOKEN`; a fine-grained token needs Contents and Attestations read access to this repository. Download the installer from an eligible immutable release and authenticate both its release-asset digest and workflow provenance before execution: ```bash -curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | bash +( + set -euo pipefail + TL_REPOSITORY="test-intelligence/testlookup" + TL_RELEASE_FILTER=' + .tag_name as $tag + | ([.assets[].name]) as $assets + | select( + .draft == false + and .prerelease == false + and .immutable == true + and ($tag | test("^v[0-9]+\\.[0-9]+\\.[0-9]+$")) + and (($assets | index("install.sh")) != null) + and (($assets | index("testlookup-offline-\($tag | ltrimstr("v")).intoto.jsonl")) != null) + ) + | .tag_name + ' + if [ -n "${TL_INSTALLER_VERSION:-}" ]; then + [[ "$TL_INSTALLER_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] || { + printf 'error: TL_INSTALLER_VERSION must be a vX.Y.Z release tag.\n' >&2 + exit 1 + } + TL_SELECTED="$(gh api "repos/${TL_REPOSITORY}/releases/tags/${TL_INSTALLER_VERSION}" \ + --jq "$TL_RELEASE_FILTER")" || { + printf 'error: could not inspect %s; run gh auth login or set GH_TOKEN.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + [ "$TL_SELECTED" = "$TL_INSTALLER_VERSION" ] || { + printf 'error: %s is not an eligible immutable installer release with install.sh and its version-matched provenance bundle.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + else + TL_CANDIDATES="$(gh api --paginate "repos/${TL_REPOSITORY}/releases?per_page=100" \ + --jq ".[] | ${TL_RELEASE_FILTER}")" || { + printf 'error: could not inspect TestLookup releases; run gh auth login or set GH_TOKEN.\n' >&2 + exit 1 + } + TL_INSTALLER_VERSION="${TL_CANDIDATES%%$'\n'*}" + [ -n "$TL_INSTALLER_VERSION" ] || { + printf 'error: no eligible immutable TestLookup release includes install.sh and its version-matched provenance bundle; use a source clone until one is published.\n' >&2 + exit 1 + } + fi + TL_BUNDLE="testlookup-offline-${TL_INSTALLER_VERSION#v}.intoto.jsonl" + TL_BOOTSTRAP="$(mktemp -d)" + trap 'rm -rf "$TL_BOOTSTRAP"' EXIT + gh release download "$TL_INSTALLER_VERSION" --repo test-intelligence/testlookup \ + --pattern install.sh --pattern "$TL_BUNDLE" --dir "$TL_BOOTSTRAP" || { + printf 'error: failed to download the authenticated installer assets for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh release verify-asset "$TL_INSTALLER_VERSION" "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup || { + printf 'error: install.sh failed immutable release-asset verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + gh attestation verify "$TL_BOOTSTRAP/install.sh" \ + --repo test-intelligence/testlookup \ + --signer-workflow test-intelligence/testlookup/.github/workflows/offline-bundle.yml \ + --source-ref refs/heads/main \ + --bundle "$TL_BOOTSTRAP/$TL_BUNDLE" || { + printf 'error: install.sh failed trusted offline-bundle.yml/main provenance verification for %s.\n' "$TL_INSTALLER_VERSION" >&2 + exit 1 + } + TL_REF="$TL_INSTALLER_VERSION" TESTLOOKUP_VERSION="$TL_INSTALLER_VERSION" \ + bash "$TL_BOOTSTRAP/install.sh" +) ``` -It checks for Docker and Compose v2, downloads `docker-compose.release.yml`, `.env.example`, `scripts/gen-dev-env.sh` and `scripts/init-db.sql` into `./testlookup`, authenticates the release checksums and the complete application-and-infrastructure digest set, generates `.env` with `scripts/gen-dev-env.sh --release` (an existing `.env` is reused), and starts Compose with a generated `docker-compose.images.yml` digest override. Read the script before piping it to a shell if your policy requires it. +The bootstrap ignores drafts, prereleases, mutable releases, and releases missing either exact installer asset. It checks `install.sh` against the selected immutable release's recorded digest and verifies that the same bytes were signed by `offline-bundle.yml` on `main`, then pins the install to that tag before Bash interprets the file. The installer then checks for Docker and Compose v2, downloads `docker-compose.release.yml`, `.env.example`, `scripts/gen-dev-env.sh` and `scripts/init-db.sql` into `./testlookup`, authenticates the release checksums and the complete application-and-infrastructure digest set, generates `.env` with `scripts/gen-dev-env.sh --release` (an existing `.env` is reused), and starts Compose with a generated `docker-compose.images.yml` digest override. `--release` fills every secret with a random value and keeps the secure defaults: `APP_ENV=production` and `DEV_AUTO_LOGIN_ENABLED=false`, so there is no passwordless login. It also writes a random `INITIAL_ADMIN_PASSWORD` into `.env`. On first start the `db-migrate` service runs `alembic upgrade head` and then `scripts/create_admin.py`, which creates the user `admin` with that password on a new database only (an existing admin is never modified) and requires a password change at the first sign-in. @@ -104,9 +169,9 @@ The installer also explains that port 3000 is plain HTTP bound to `127.0.0.1` by | `TL_PROFILE` | none | Adds a Compose profile: `demo` (seed data) or `local-llm` (Ollama and ChromaDB) | | `TL_NO_UP` | `0` | `1` downloads and generates `.env` but does not start anything | -Pass them before `bash`, for example `curl -fsSL .../install.sh | TL_PROFILE=demo bash`. For an evaluation, `TL_PROFILE=demo` is the documented default (README, [GETTING_STARTED.md](../../GETTING_STARTED.md)): without it the first dashboard is empty until you send a report. For a team instance, leave it out. The images are about 1 GB to download (0.95 GB for linux/amd64, measured on 11 November 2026). +Pass installer options on the final `bash` command in the authenticated block above. For an evaluation, add `TL_PROFILE=demo`; without it the first dashboard is empty until you send a report. For a team instance, leave it out. The images are about 1 GB to download (0.95 GB for linux/amd64, measured on 11 November 2026). -With nothing set, the installer installs the latest published release. To install a particular release, name its tag: `curl -fsSL .../install.sh | TL_REF=vX.Y.Z bash`. Either way it verifies the signed provenance of `SHA256SUMS` and `release-manifest.json`, compares the four downloaded files, checks every manifest digest against CI's signed provenance for the release commit, and writes `docker-compose.images.yml` before startup. It stops, with nothing installed or run, when any asset, signature, version binding, component, digest, or checksum is missing or mismatched. For `main`, or another branch or commit explicitly selected by the operator, it says the files and tag-addressed images are not verified. The release checks do not cover the copy of `install.sh` being executed: download it and the signed release assets first if your policy requires that additional bootstrap check. +The block selects the newest eligible published release and pins both the verified installer and its downloads to that tag. To install a particular release, set `TL_INSTALLER_VERSION=vX.Y.Z` before the block; an invalid, mutable, draft, prerelease, or asset-less tag fails without silently selecting another release. The existing `v0.1.0` release predates `install.sh` and its matching provenance asset, so the default fails closed until a newer eligible release is published; use a source clone for that historical release. After both installer checks, the installer verifies `SHA256SUMS` and `release-manifest.json`, compares the four downloaded files, checks every manifest digest against CI's signed provenance for the release commit, and writes `docker-compose.images.yml` before startup. It stops, with nothing installed or run, when any asset, signature, version binding, component, digest, or checksum is missing or mismatched. For `main`, or another branch or commit explicitly selected by the operator after authenticating an eligible installer, it says the subsequently downloaded files and tag-addressed images are not verified. ### Image tags @@ -152,11 +217,7 @@ Run `docker compose -f docker-compose.release.yml -f docker-compose.images.yml u ### Upgrading a release install -Take a backup, then rerun the installer for the new release so it authenticates and replaces the digest override while preserving the existing `.env`: - -```bash -curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | TL_REF=vX.Y.Z bash -``` +Take a backup, set `TL_INSTALLER_VERSION=vX.Y.Z`, then rerun the authenticated installer block above for the new release. It replaces the digest override while preserving the existing `.env`. The `db-migrate` service runs `alembic upgrade head` with the new backend digest, and the backend, workers and beat wait for it to complete. From a clone you can run the same sequence with checks and a smoke test: `make preflight TAG=vX.Y.Z` then `make upgrade TAG=vX.Y.Z`, with `TL_COMPOSE` set to the install's full Compose command (for example `TL_COMPOSE="docker compose -f docker-compose.release.yml -f docker-compose.images.yml -p testlookup"`, see `scripts/ops/lib.sh`). diff --git a/docs/operations/deployment.md b/docs/operations/deployment.md index c8e681850..9eba71902 100644 --- a/docs/operations/deployment.md +++ b/docs/operations/deployment.md @@ -29,7 +29,7 @@ The manifests in this repository describe supported topologies. They are not evi Rules of thumb: -- Trying TestLookup: `make quickstart` from a clone, or the `install.sh` one-liner if you do not want a clone. +- Trying TestLookup: `make quickstart` from a clone, or the authenticated release installer if you do not want a clone. - One team, one host: release images on Compose, with backups (`make backup`) on a schedule. - Several teams, or you need replicas and rolling upgrades: Kubernetes with managed PostgreSQL, MongoDB, Valkey/Redis and S3-compatible storage. - No internet at the install site: the [offline bundle](../../user-guide/air-gapped-install.md). Models are prepared separately with the [offline model pack](../../user-guide/offline-model-pack.md). diff --git a/frontend/src/components/onboarding/FirstRunGuide.test.tsx b/frontend/src/components/onboarding/FirstRunGuide.test.tsx index 5a20b73e6..755dbb323 100644 --- a/frontend/src/components/onboarding/FirstRunGuide.test.tsx +++ b/frontend/src/components/onboarding/FirstRunGuide.test.tsx @@ -98,12 +98,13 @@ describe('FirstRunGuide', () => { expect(screen.getByText(/explore the intelligence/i)).toBeInTheDocument() }) - // D-09: the one-command install has no Makefile, so step 1 cannot offer only `make quickstart`. - it('step 1 gives the one-command install its demo command first, a source clone make quickstart second', () => { + // D-09: the release install has no Makefile, so step 1 cannot offer only `make quickstart`. + it('step 1 enables the installed demo profile first, a source clone make quickstart second', () => { renderGuide() const demo = screen.getByText(DEMO_INSTALL_COMMAND) const make = screen.getByText('make quickstart') - expect(DEMO_INSTALL_COMMAND).toContain('TL_PROFILE=demo') + expect(DEMO_INSTALL_COMMAND).toContain('--profile demo') + expect(DEMO_INSTALL_COMMAND).not.toContain('raw.githubusercontent.com') expect(demo.compareDocumentPosition(make) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(screen.getByText('From a source clone instead:')).toBeInTheDocument() expect(buildSteps()[0].command).toBe(DEMO_INSTALL_COMMAND) diff --git a/frontend/src/components/onboarding/firstRunSteps.ts b/frontend/src/components/onboarding/firstRunSteps.ts index 9a6bf1880..71bc34015 100644 --- a/frontend/src/components/onboarding/firstRunSteps.ts +++ b/frontend/src/components/onboarding/firstRunSteps.ts @@ -119,9 +119,9 @@ export function uploadCommand(projectId?: string): string { */ export const DEFAULT_INGEST_URL = 'http://localhost:8000/api/v1/ingest/file' -/** D-09: the one-command install's demo path (README "Option A", install.sh TL_PROFILE=demo). */ +/** D-09: enable the demo profile in an existing authenticated release install. */ export const DEMO_INSTALL_COMMAND = - 'curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | TL_PROFILE=demo bash' + 'cd testlookup && docker compose -f docker-compose.release.yml -f docker-compose.images.yml --profile demo up -d' /** * The raw ingest-API equivalent of {@link uploadCommand}, for CI runners that @@ -217,10 +217,11 @@ export function buildSteps( return [ { // D-09: the one-command (Docker Compose) install has no Makefile; its demo - // path is the installer's demo profile. A source clone keeps `make quickstart`. + // path enables the already-installed release's demo profile without fetching code. + // A source clone keeps `make quickstart`. n: 1, title: 'Load the demo dataset', - body: 'Add demo projects with sample runs, failures, flaky tests, trends and a release gate. On the one-command install, run the installer again with the demo profile:', + body: 'Add demo projects with sample runs, failures, flaky tests, trends and a release gate. In an authenticated release install, enable the local demo profile:', command: DEMO_INSTALL_COMMAND, altCommand: { label: 'From a source clone instead:', command: 'make quickstart' }, }, diff --git a/install.sh b/install.sh index fd2fa863f..f125d4aba 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash -# install.sh — one-command remote install for TestLookup (no git clone needed). +# install.sh — authenticated release install for TestLookup (no git clone needed). # -# curl -fsSL https://raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh | bash +# Download this file from a versioned GitHub release and verify its immutable +# release-asset digest and signed provenance before running it. README.md +# documents that bootstrap sequence. # # It downloads the pinned-image release stack, verifies the release's signed # image manifest, generates a local .env with random secrets, and brings the @@ -33,9 +35,9 @@ # TL_RELEASE_BASE= where release verification assets come from (default # https://github.com/test-intelligence/testlookup/releases/download) # -# The checksum step protects the files this script downloads. It cannot check -# this script itself: for that, download install.sh and SHA256SUMS from the -# release page and compare them before running it. +# The checksum step protects the files this script downloads. The documented +# bootstrap separately authenticates this script's versioned release asset +# before Bash interprets it. # # Everything runs from main(), called on the last line: a download cut short # by the network defines functions but runs nothing. @@ -442,7 +444,7 @@ EOF echo "Demo projects load in the background once the database is ready:" echo " $DC $COMPOSE_ARGS logs -f seed-init" else - echo "Want demo data? Re-run with: curl -fsSL | TL_PROFILE=demo bash" + echo "Want demo data? Re-run the authenticated release installer with TL_PROFILE=demo." fi } diff --git a/scripts/test_ci_security.py b/scripts/test_ci_security.py index 0cad8a951..2f3583a6d 100644 --- a/scripts/test_ci_security.py +++ b/scripts/test_ci_security.py @@ -9,11 +9,13 @@ import datetime as dt import json +import os import re import shlex import subprocess from pathlib import Path +import pytest import yaml ROOT = Path(__file__).resolve().parent.parent @@ -1005,6 +1007,15 @@ def test_a_typescript_property_test_keeps_the_fuzzing_signal() -> None: ".github/workflows/ci.yml", ".github/workflows/offline-bundle.yml", ) +_INSTALL_BOOTSTRAP_DOCS = ( + "README.md", + "GETTING_STARTED.md", + "docs/operations/deploy-compose.md", +) +_BASH_BOOTSTRAP_ONLY = pytest.mark.skipif( + os.name == "nt", + reason="installer bootstrap behavioral fixture requires /bin/bash and POSIX executable stubs", +) def _attestation_verify_commands(text: str) -> list[str]: @@ -1065,6 +1076,202 @@ def test_the_documented_attestation_checks_name_the_signing_workflow_and_main() ] +def test_the_documented_installer_is_authenticated_before_bash() -> None: + """The primary paths select one eligible immutable release and perform both + independent installer checks before Bash interprets downloaded bytes.""" + for rel in _INSTALL_BOOTSTRAP_DOCS: + text = (ROOT / rel).read_text(encoding="utf-8") + assert "raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh |" not in text + assert "gh auth login" in text and "GH_TOKEN" in text + assert ".immutable == true" in text + assert 'index("install.sh")' in text + assert 'index("testlookup-offline-\\($tag | ltrimstr("v")).intoto.jsonl")' in text + assert 'releases/tags/${TL_INSTALLER_VERSION}' in text + assert 'gh api --paginate "repos/${TL_REPOSITORY}/releases?per_page=100"' in text + download = text.index('gh release download "$TL_INSTALLER_VERSION"') + release_verify = text.index('gh release verify-asset "$TL_INSTALLER_VERSION"', download) + provenance_verify = text.index('gh attestation verify "$TL_BOOTSTRAP/install.sh"', release_verify) + execute = text.index('bash "$TL_BOOTSTRAP/install.sh"', provenance_verify) + assert download < release_verify < provenance_verify < execute, rel + command = text[release_verify:execute + len('bash "$TL_BOOTSTRAP/install.sh"')] + assert 'verify-asset "$TL_INSTALLER_VERSION" "$TL_BOOTSTRAP/install.sh"' in command + assert "--repo test-intelligence/testlookup" in command + assert "--signer-workflow test-intelligence/testlookup/.github/workflows/offline-bundle.yml" in command + assert "--source-ref refs/heads/main" in command + assert 'TL_REF="$TL_INSTALLER_VERSION"' in command + assert 'TESTLOOKUP_VERSION="$TL_INSTALLER_VERSION"' in command + + for rel in ( + "docker-compose.release.yml", + "frontend/src/components/onboarding/firstRunSteps.ts", + ): + text = (ROOT / rel).read_text(encoding="utf-8") + assert "raw.githubusercontent.com/test-intelligence/testlookup/main/install.sh |" not in text + + +def _documented_installer_bootstrap() -> str: + text = (ROOT / "README.md").read_text(encoding="utf-8") + marker = text.index("TL_RELEASE_FILTER=") + start = text.rfind("```bash\n", 0, marker) + len("```bash\n") + end = text.index("\n```", marker) + return text[start:end] + + +def _write_installer_bootstrap_stubs(directory: Path) -> Path: + """Provide deterministic gh and Bash boundaries for the documented block. + + The gh API stub returns post-`--jq` output: v0.1.0 represents the current + immutable release without installer assets, while v0.2.0 is eligible. + """ + bin_dir = directory / "bin" + bin_dir.mkdir(parents=True) + gh = bin_dir / "gh" + gh.write_text( + r'''#!/bin/sh +set -eu +printf 'gh\t%s\n' "$*" >> "$GH_LOG" +case "$1:$2" in + api:--paginate) + case "$*" in + *'.immutable == true'*'index("install.sh")'*'testlookup-offline-'*) ;; + *) exit 90 ;; + esac + [ "$GH_SCENARIO" = no_candidates ] || printf '%s\n' v0.2.0 + ;; + api:repos/*/releases/tags/*) + tag=${2##*/} + case "$tag" in + v0.2.0) printf '%s\n' "$tag" ;; + v0.1.0) : ;; # Existing, but removed by --jq because both assets are absent. + *) exit 1 ;; + esac + ;; + release:download) + tag=$3 + shift 3 + destination= + while [ "$#" -gt 0 ]; do + if [ "$1" = --dir ]; then destination=$2; shift; fi + shift + done + mkdir -p "$destination" + printf '# installer fixture\n' > "$destination/install.sh" + : > "$destination/testlookup-offline-${tag#v}.intoto.jsonl" + ;; + release:verify-asset) + [ "$GH_SCENARIO" != asset_failure ] + ;; + attestation:verify) + [ "$GH_SCENARIO" != provenance_failure ] + ;; + *) exit 91 ;; +esac +''', + encoding="utf-8", + ) + gh.chmod(0o755) + bash = bin_dir / "bash" + bash.write_text( + "#!/bin/sh\n" + "printf 'bash\\tTL_REF=%s\\tTESTLOOKUP_VERSION=%s\\tTL_PROFILE=%s\\t%s\\n' " + '"${TL_REF:-}" "${TESTLOOKUP_VERSION:-}" "${TL_PROFILE:-}" "$*" >> "$GH_LOG"\n', + encoding="utf-8", + ) + bash.chmod(0o755) + return bin_dir + + +def _run_documented_installer_bootstrap( + directory: Path, + scenario: str, + version: str | None = None, +) -> tuple[subprocess.CompletedProcess[str], str]: + directory.mkdir(parents=True, exist_ok=True) + script = directory / "bootstrap.sh" + script.write_text(_documented_installer_bootstrap(), encoding="utf-8") + log = directory / "commands.log" + bin_dir = _write_installer_bootstrap_stubs(directory) + env = os.environ.copy() + env.update({ + "PATH": f"{bin_dir}:{env['PATH']}", + "GH_LOG": str(log), + "GH_SCENARIO": scenario, + }) + if version is None: + env.pop("TL_INSTALLER_VERSION", None) + else: + env["TL_INSTALLER_VERSION"] = version + completed = subprocess.run( + ["/bin/bash", str(script)], + cwd=directory, + env=env, + capture_output=True, + text=True, + check=False, + ) + return completed, log.read_text(encoding="utf-8") if log.exists() else "" + + +@_BASH_BOOTSTRAP_ONLY +def test_installer_bootstrap_skips_v010_without_assets(tmp_path: Path) -> None: + completed, commands = _run_documented_installer_bootstrap(tmp_path, "eligible_after_v010") + + assert completed.returncode == 0, completed.stderr + assert "gh\tapi --paginate" in commands + assert "gh\trelease download v0.2.0" in commands + assert "release download v0.1.0" not in commands + assert "gh\trelease verify-asset v0.2.0" in commands + assert "gh\tattestation verify" in commands + assert "bash\tTL_REF=v0.2.0\tTESTLOOKUP_VERSION=v0.2.0\tTL_PROFILE=demo" in commands + + +@_BASH_BOOTSTRAP_ONLY +def test_installer_bootstrap_rejects_explicit_assetless_release(tmp_path: Path) -> None: + completed, commands = _run_documented_installer_bootstrap(tmp_path, "explicit", "v0.1.0") + + assert completed.returncode != 0 + assert "not an eligible immutable installer release" in completed.stderr + assert "gh\tapi repos/test-intelligence/testlookup/releases/tags/v0.1.0" in commands + assert "api --paginate" not in commands + assert "release download" not in commands + assert "bash\t" not in commands + + +@_BASH_BOOTSTRAP_ONLY +def test_installer_bootstrap_fails_when_no_candidate_exists(tmp_path: Path) -> None: + completed, commands = _run_documented_installer_bootstrap(tmp_path, "no_candidates") + + assert completed.returncode != 0 + assert "no eligible immutable TestLookup release" in completed.stderr + assert "release download" not in commands + assert "bash\t" not in commands + + +@_BASH_BOOTSTRAP_ONLY +def test_installer_bootstrap_stops_before_bash_on_verification_failure(tmp_path: Path) -> None: + asset_result, asset_commands = _run_documented_installer_bootstrap( + tmp_path / "asset", + "asset_failure", + ) + provenance_result, provenance_commands = _run_documented_installer_bootstrap( + tmp_path / "provenance", + "provenance_failure", + ) + + assert asset_result.returncode != 0 + assert "failed immutable release-asset verification" in asset_result.stderr + assert "gh\trelease verify-asset v0.2.0" in asset_commands + assert "gh\tattestation verify" not in asset_commands + assert "bash\t" not in asset_commands + + assert provenance_result.returncode != 0 + assert "failed trusted offline-bundle.yml/main provenance verification" in provenance_result.stderr + assert provenance_commands.index("gh\trelease verify-asset") < provenance_commands.index( + "gh\tattestation verify" + ) + assert "bash\t" not in provenance_commands + + def test_the_air_gap_guide_authenticates_the_bundle_before_extraction() -> None: """The transferred checksum is attacker-replaceable, so signed provenance must authenticate the tarball before any archive member can be trusted.""" @@ -1109,6 +1316,7 @@ def test_a_release_bundle_run_attaches_signed_provenance() -> None: assert [p.strip() for p in attest["with"]["subject-path"].splitlines() if p.strip()] == [ "dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz", "dist/testlookup-offline-${{ env.BUNDLE_VERSION }}.tar.gz.sha256", + "dist/install.sh", "dist/SHA256SUMS", "dist/release-manifest.json", ] @@ -1117,9 +1325,11 @@ def test_a_release_bundle_run_attaches_signed_provenance() -> None: assert keep["env"]["BUNDLE_PATH"] == "${{ steps.attest.outputs.bundle-path }}" [upload] = [s for s in steps if "upload-artifact" in s.get("uses", "")] assert "dist/*.intoto.jsonl" in upload["with"]["path"] + assert "dist/install.sh" in upload["with"]["path"] assert "dist/release-manifest.json" in upload["with"]["path"] + installer = next(i for i, s in enumerate(steps) if "git show HEAD:install.sh > dist/install.sh" in s.get("run", "")) sums = next(i for i, s in enumerate(steps) if "> dist/SHA256SUMS" in s.get("run", "")) - assert sums < steps.index(attest) < steps.index(keep) < steps.index(upload) + assert installer == sums < steps.index(attest) < steps.index(keep) < steps.index(upload) def test_the_online_manifest_contains_only_ci_attested_release_digests() -> None: diff --git a/user-guide/air-gapped-install.md b/user-guide/air-gapped-install.md index f6a672213..3b716495a 100644 --- a/user-guide/air-gapped-install.md +++ b/user-guide/air-gapped-install.md @@ -329,8 +329,8 @@ image: it waits for the object store and creates every bucket the backend writes to. It is idempotent; re-run it with `docker compose -f docker-compose.release.yml -f docker-compose.airgap.yml run --rm minio-setup`. -`make dev` and the public `install.sh` one-liner are unaffected — they never -load the override. +`make dev` and the authenticated online `install.sh` release path are +unaffected — they never load the override. Then confirm: