diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc7ce4a..59c8239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,24 @@ jobs: - uses: actions/checkout@v4 - name: Install ShellCheck + Hadolint + env: + # Content-pin the release asset — bump BOTH together. The sha256 is the + # one published as hadolint-Linux-x86_64.sha256 in the same release. + HADOLINT_VERSION: v2.12.0 + HADOLINT_SHA256: 56de6d5e5ec427e17b74fa48d51271c7fc0d61244bf5c90e828aab8362d55010 run: | sudo apt-get update -qq sudo apt-get install -y -qq shellcheck - curl -sL -o /tmp/hadolint \ - "https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64" - sudo install -m 0755 /tmp/hadolint /usr/local/bin/hadolint + # Not hadolint/hadolint-action: the one release that digest-pins its own + # hadolint image (v3.5.0, 06be81b) ships 2.15.1, whose DL3066 fails this + # Dockerfile on `USER app` (so does v3.4.0/2.15.0); the releases that lint + # clean (v3.1.0, v3.3.0) pull their image by mutable tag. Hash the binary. + mkdir -p "$HOME/.local/bin" + curl -fsSL -o /tmp/hadolint \ + "https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64" + echo "${HADOLINT_SHA256} /tmp/hadolint" | sha256sum -c - + install -m 0755 /tmp/hadolint "$HOME/.local/bin/hadolint" + echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Seed dummy .env + compose config run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 549c63f..bf68493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ Versioning follows [SemVer](https://semver.org/) for tagged releases. - `hyperframes` CLI symlink resolved from the package's `bin` entry, so the CLI actually lands on `PATH` (was: "hyperframes CLI not on PATH" at runtime) +### Security + +- CI checks the Hadolint release binary against a pinned sha256 before running + it, and installs it as the runner user instead of `sudo`-ing it into + `/usr/local/bin` (was: an unverified `curl` on every PR) + ## [0.1.0] — 2026-07-27 ### Added