Skip to content

ci(promote): pin and harden promote-to-dev - #99

Merged
louise-poole merged 4 commits into
mainfrom
ci/promote-pin-actions
Nov 6, 2026
Merged

louise-poole merged 4 commits into
mainfrom
ci/promote-pin-actions

Conversation

@louise-poole

Copy link
Copy Markdown
Contributor

Hardens promote-to-dev.yaml, which pushes deployed versions to helm-configuration for 11 repos, against upstream changes and malformed inputs.

Why

  • Unpinned code with a write token: the job ran actions-js/push@master, two actions on moving tags, and whatever yq release was latest, all while holding a token that can change deployments.
  • Token wider than needed: the getsentry action minted a token for every repo the App is installed on; the job only writes helm-configuration.
  • Template injection: zizmor flagged five places where inputs are pasted into shell and yq scripts.

Design decisions

  • actions/create-github-app-token instead of pinning getsentry: it's the action and commit release-v3.yaml already uses, scoped to helm-configuration with contents write.
  • yq v4.54.1, not v4.54.2: v4.54.2 was published today; the binary is checked against the SHA-256 from its release.
  • yq expression now uses .[strenv(IMAGE_NAME)].tag: this is yq's documented dynamic-key form and writes the same key as .fynd-hosted.tag.

Not yet tested

No caller has run this branch; the new token scope and the strenv yq expression first run on the next promotion after merge.

🤖 Generated with Claude Code

louise-poole and others added 4 commits November 6, 2026 11:03
…-token

WHY:
The promotion token came from getsentry/action-github-app-token, a
third-party action pulled by a moving tag, and it could write to every
repository the App is installed on. The job only needs to push to
helm-configuration.

HOW:
- mint the token with actions/create-github-app-token, pinned to the
  same commit release-v3 uses
- limit the token to helm-configuration with contents write

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WHY:
The job checked out with a moving tag and pushed with actions-js/push at
master, so a change upstream would run with a token that writes the
deployed versions. The other templates pin every action to a commit.

HOW:
- pin actions/checkout to v7.0.0, the commit release-v3 uses
- pin actions-js/push to v1.6, the commit master points to today
- stop checkout from saving the token, since the push action passes its
  own

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WHY:
The job downloaded whatever yq release was latest and ran it unchecked,
so a new or replaced release would run unreviewed in a job that holds a
token for helm-configuration.

HOW:
- download yq v4.54.1 by version
- check the binary against the SHA-256 published with that release
  before installing it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WHY:
The image name, tag and environment were pasted into shell and yq
scripts as text, so an input with quotes or shell syntax could run
code in a job that holds a token for helm-configuration.

HOW:
- read the environment from an env variable in the validation step
- give yq the image name and tag through strenv instead of building
  the expression from them, and quote the versions file path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@louise-poole
louise-poole merged commit 6d4751c into main Nov 6, 2026
3 checks passed
@louise-poole
louise-poole deleted the ci/promote-pin-actions branch November 6, 2026 12:18
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.

2 participants