Skip to content

Pin action versions and add Dependabot cooldown - #134

Open
cmillett wants to merge 1 commit into
masterfrom
pin-github-action-versions
Open

Pin action versions and add Dependabot cooldown#134
cmillett wants to merge 1 commit into
masterfrom
pin-github-action-versions

Conversation

@cmillett

Copy link
Copy Markdown
Member

Addresses all 16 high-severity Bastion SAST findings on this repo.

Mutable action tags — 15 findings

CWE-1357 / CWE-353, OWASP A08. All 16 third-party uses: refs now name an exact patch version instead of a floating major:

Action Before After
actions/checkout @v4 @v4.4.0
actions/cache @v3 @v3.5.0
actions/setup-node @v4 @v4.4.0
actions/upload-artifact @v4 @v4.6.2
aws-actions/configure-aws-credentials @v4 @v4.3.1
peter-evans/repository-dispatch @v2 @v2.1.2
cycjimmy/semantic-release-action @v6 @v6.0.0

Each version was resolved from what its floating major points at right now, so every job runs the same code as before — the refs just say so explicitly.

The one that was genuinely bad

cycjimmy/semantic-release-action@v6 — that repository has no v6 tag. The ref was resolving to a branch named v6, i.e. a moving head equivalent to @master, on the action that cuts releases. Tag v6.0.0 points at the same commit (b12c8f60) and is the latest release, so this is behaviour-identical while no longer tracking a branch.

Also worth flagging: aws-actions/configure-aws-credentials is the action that configures the credentials used to publish to S3, making it the highest-consequence pin in the repo.

Why this doesn't clear the rule

Semgrep wants a 40-character commit SHA. Woosmap policy is exact version tags, not SHAs, so these are recorded as accepted risk in Bastion rather than fixed. The cooldown below covers the same threat from the other direction.

Missing Dependabot cooldown — 1 finding

CWE-829. Added cooldown: default-days: 7 to the npm entry, so freshly published releases wait a week before Dependabot proposes them — that publication window is when a compromised version is most likely to still be live.

Also added a github-actions ecosystem entry (weekly, same cooldown). Without it the exact pins above would never move; with it they get bumped on a reviewed PR. This part is additive — happy to drop it if you'd rather not have action-bump PRs.

Risk and rollback

Only uses: refs and dependabot.yml changed; no workflow inputs, triggers, or job logic touched. All six workflow files and dependabot.yml verified as parseable YAML, and all seven version tags confirmed to resolve upstream. CI on this PR exercises checkout, cache, setup-node and upload-artifact directly; the S3 and release paths run post-merge. Rollback is git revert of this commit.

Follow-up, not in this PR

actions/cache@v3 is a superseded major and should move to v4. That's a behavioural change, so it belongs in its own PR rather than bundled with a pinning change.

🤖 Generated with Claude Code

Addresses 16 Bastion SAST findings in this repo's CI config.

Mutable action tags (15 findings, CWE-1357/353, OWASP A08). All 16
third-party `uses:` refs now name an exact patch version instead of a
floating major, each resolved from what that major points at today so
behaviour is unchanged:

  actions/checkout@v4                     -> v4.4.0
  actions/cache@v3                        -> v3.5.0
  actions/setup-node@v4                   -> v4.4.0
  actions/upload-artifact@v4              -> v4.6.2
  aws-actions/configure-aws-credentials@v4 -> v4.3.1
  peter-evans/repository-dispatch@v2      -> v2.1.2
  cycjimmy/semantic-release-action@v6     -> v6.0.0

`cycjimmy/semantic-release-action@v6` was the notable one: there is no v6
tag on that repo, so the ref resolved to a *branch* named v6 — a moving
head, not a version. Tag v6.0.0 points at the same commit.

Missing Dependabot cooldown (1 finding, CWE-829). Adds
`cooldown: default-days: 7` to hold back freshly published releases, plus a
github-actions ecosystem entry so the pins above get bumped rather than
silently going stale.

Version tags stay mutable, so the tag findings do not satisfy the Semgrep
github-actions-mutable-action-tag rule, which wants a 40-char SHA. That is a
deliberate tradeoff; the cooldown covers the same threat.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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