ci(workflows): pin third-party actions to commit SHAs and add dependabot config - #2730
Open
polylane[bot] wants to merge 1 commit into
Open
polylane[bot] wants to merge 1 commit into
polylane[bot] wants to merge 1 commit into
Conversation
…bot config Co-authored-by: polylane[bot] <277585245+polylane[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: Repo security/supply-chain guards disabled on a public, trivially-pushable main: vulnerability alerts & dependabot off, push protection off, unpinned flyctl@master on prod deploy
The production deploy workflows in this repository resolved the Fly CLI installer and the SBOM scanner from moving upstream refs, so a change to those actions would silently reach the public API, workflows, checker and private-location fleets on the next main push, with no review gate on main. Merging pins every third-party action reference to an immutable commit and adds a Dependabot config, so future action and dependency updates arrive as reviewed pull requests instead of drifting refs.
What caused this
Affected:
int_01b0344f3001ufkixqp40d4t· severity mediumWhat changed
.github/workflows/deploy.yml,deploy-checker.yml,deploy-workflows.yml,deploy-private-location.yml,restart-workflows.yml: pinnedsuperfly/flyctl-actions/setup-flyctlfrom@masterto@ed8efb33836e8b2096c7fd3ba1c8afe303ebbff1(the commit master resolves to today)..github/workflows/api-preview.yml,workflow-preview.yml: pinned both setup-flyctl references per file to the same commit..github/workflows/docker-publish.yml: pinnedanchore/sbom-actionfrom@v0to@e22c389904149dbc22b58101806040fa8d37a610(the commit v0 resolves to today)..github/dependabot.yml: new weekly version-updates config for the pnpm monorepo (root npm ecosystem) and GitHub Actions, each grouped with an open-PR limit of 10, so dependency and action updates arrive as reviewed pull requests.Why it's safe
uses:ref strings changed; no step order, permissions, environment, or deploy command was touched in any of the eight workflows.uses:line of the SBOM step; PR ci(publish): stop the SBOM step from failing the job after a successful push #2728's edits (id/continue-on-error on the step and an if-condition on the upload step) are on adjacent, distinct lines, so the two changes merge cleanly.github-actionsDependabot entry is the safety valve: pins update through reviewed pull requests instead of silently aging, which is what a bare SHA pin without an update channel would risk.Validation
ruby -e 'require "yaml"; ...'over all 21.github/workflows/*.ymlplus.github/dependabot.yml: all parse OK.actionlint 1.7.12on the 8 touched workflows: clean, except pre-existingdepot-ubuntu-24.04-4runner-label warnings in deploy.yml and api-preview.yml (Depot's custom runner label, unrelated to this diff and present before it).grep -rn "uses: ...@master" .github/workflows/: no unpinned action refs remain; the only@latestleft isgo install ...@latestin proto-check.yml, an install-time tool pin outside this change's scope.pnpm verify(repo CI gate for code changes; this change touches only workflow and Dependabot YAML, no source, dependency or lockfile).Root cause and scoping notes
Root cause
Signal: the confirmed issue "Repo security/supply-chain guards disabled on a public, trivially-pushable main" names unpinned
superfly/flyctl-actions/setup-flyctl@masteron the production deploy path as one of its verified findings.Chain:
.github/workflows/deploy.yml(and its siblings) run on every main push touchingapps/server/**orpackages/**, resolvingsetup-flyctl@masterto whatever upstream's master branch points at on that run, then executeflyctl deploywithFLY_API_TOKEN. The main branch requires zero reviews,enforce_admins=false, has no status-check requirement and no rulesets, so a merged PR or direct push reaches this path unreviewed./actions/permissionsreportsallowed_actions: all. An upstream commit to the action's master branch therefore ships arbitrary code to the public API, the workflows app, the checker fleet and private-location on the next relevant main push.Scope found in this run: a full sweep of
.github/workflowsfound the float is wider than the issue brief named: ninesetup-flyctl@masterreferences across seven files (the three other production deploy pathsdeploy-workflows.yml,deploy-private-location.yml,restart-workflows.ymlincluded) plusanchore/sbom-action@v0indocker-publish.yml, for ten unpinned refs in total.Why this fixes the cause: each reference is repointed at the immutable commit it resolves to today (verified via the GitHub API this turn), so a future upstream move changes nothing at run time. The new Dependabot
github-actionsentry is the update channel: action upgrades now arrive as pull requests with visible diffs instead of silently drifting, which is what makes a SHA pin safe to keep. The disabled repo settings (vulnerability alerts, push protection) and the unresolved Slack-webhook alert are admin-side actions no pull request can perform and are recorded on the issue timeline for a maintainer.Out of scope / follow-ups
go install ...@latestin proto-check.yml: install-time pinning of a dev tool, not an action ref on the deploy path; left for the Dependabot/renovate conversation rather than changed blind.Causal chain
Detection outcome
The condition the issue names, unpinned third-party action refs on the production deploy path, stops existing once this merges: a re-scan of
.github/workflowsfinds everysuperfly/flyctl-actions/setup-flyctlreference pinned to the commit SHAed8efb33836e8b2096c7fd3ba1c8afe303ebbff1andanchore/sbom-actionpinned toe22c389904149dbc22b58101806040fa8d37a610, with no@masteror major-tag float left. Workflow runs no longer resolve a mutable upstream ref at execution time, and the newgithub-actionsDependabot entry replaces silent drift with reviewed update pull requests, so the refs stay current without ever floating again.Fix chosen
Chosen: cause (removes the mechanism that produces the failure): Pin all ten floating third-party action references (setup-flyctl@master x9, sbom-action@v0 x1) to the immutable commit SHAs they currently resolve to, and add a Dependabot config so future action and dependency updates arrive as reviewed pull requests.
Considered and not chosen:
Outcome after fix
Replay with the change applied. A main push touching
apps/server/**triggers the Fly Deploy workflow: checkout runs, thensetup-flyctl@ed8efb33836e8b2096c7fd3ba1c8afe303ebbff1downloads the same action commit thatmasterpoints at today, andflyctl deployproceeds exactly as before. Upstream later pushes a new commit tosuperfly/flyctl-actions's master branch: the next run still executes ed8efb3, so the new commit reaches neither CI nor production until a maintainer merges the Dependabot pull request that proposes it, with a visible diff. The same holds for the SBOM step's action. The floating-ref auto-ship mechanism the issue names is gone; the repo-settings facets (vulnerability alerts, push protection, the unresolved webhook alert) remain open and are recorded on the issue timeline for a maintainer, since no pull request can change them.9 files changed (+31/-10)
.github/dependabot.yml: added, +21/-0.github/workflows/api-preview.yml: modified, +2/-2.github/workflows/deploy-checker.yml: modified, +1/-1.github/workflows/deploy-private-location.yml: modified, +1/-1.github/workflows/deploy-workflows.yml: modified, +1/-1.github/workflows/deploy.yml: modified, +1/-1.github/workflows/docker-publish.yml: modified, +1/-1.github/workflows/restart-workflows.yml: modified, +1/-1.github/workflows/workflow-preview.yml: modified, +2/-2Repository conventions present in the repository: AGENTS.md, CLAUDE.md, apps/checker/AGENTS.md, apps/dashboard/AGENTS.md, apps/server/AGENTS.md, apps/status-page/AGENTS.md, apps/web/AGENTS.md, apps/workflows/AGENTS.md, packages/services/AGENTS.md, packages/ui/AGENTS.md.
Repository lint:
pnpm run lint(declared in package.json) could not run in the sandbox because its tool is not installed there; run it before merging.Generated by Polylane.