Skip to content

Pin actions to SHAs and add zizmor CI#443

Merged
bschwedler merged 5 commits into
mainfrom
security/sha-pinning-and-zizmor
Apr 10, 2026
Merged

Pin actions to SHAs and add zizmor CI#443
bschwedler merged 5 commits into
mainfrom
security/sha-pinning-and-zizmor

Conversation

@bschwedler
Copy link
Copy Markdown
Contributor

@bschwedler bschwedler commented Apr 10, 2026

Summary

  • Pin all third-party GitHub Actions to immutable commit SHAs with version comments across all shared workflows and composite actions
  • Add zizmor static analysis job to ci.yml matching Astral's pattern (zizmorcore/zizmor-action@v0.5.2)
  • Add .github/zizmor.yml policy allowing ref-pinned first-party composite actions (posit-dev/images-shared/*@main) while enforcing hash-pinning for everything else

Addresses action pinning and static analysis gaps identified in rstudio/platform-team#435.

Test plan

  • CI passes with SHA-pinned action refs
  • zizmor job runs and passes (no unexpected findings)
  • Verify all third-party uses: lines reference full 40-char SHAs

@bschwedler bschwedler requested a review from ianpittwood as a code owner April 10, 2026 17:17
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread .github/workflows/bakery-build-native.yml Fixed
Comment thread .github/workflows/bakery-build-native.yml Fixed
Comment thread setup-bakery/action.yml Fixed
Comment thread .github/workflows/bakery-build.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/bakery-build.yml Fixed
Comment thread .github/workflows/bakery-build-native.yml Fixed
Comment thread .github/workflows/bakery-build-native.yml Fixed
@github-actions
Copy link
Copy Markdown

Test Results

1 277 tests  ±0   1 277 ✅ ±0   8m 47s ⏱️ +23s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit c13aba5. ± Comparison against base commit 291e13d.

Comment thread setup-bakery/action.yml Fixed
Comment thread setup-bakery/action.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/bakery-build-native.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
@bschwedler bschwedler force-pushed the security/sha-pinning-and-zizmor branch from c08a903 to 8add83d Compare April 10, 2026 20:46
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/issues.yml Fixed
@bschwedler bschwedler force-pushed the security/sha-pinning-and-zizmor branch 2 times, most recently from df68c38 to 3f3e7a9 Compare April 10, 2026 20:59
@bschwedler bschwedler mentioned this pull request Apr 10, 2026
2 tasks
Replace mutable version tags with full commit SHAs for all
third-party GitHub Actions to prevent supply-chain attacks via
tag mutation. Each pinned reference includes a version comment
for readability.

Internal posit-dev/images-shared/* refs are left unpinned since
they are first-party actions under our control.
Add zizmor workflow security scanner as a CI job to detect
common GitHub Actions misconfigurations and vulnerabilities.
Uses SARIF output for GitHub security tab integration.

A .github/zizmor.yml config allows ref-pinned refs for our
own posit-dev/images-shared/* composite actions while
requiring hash-pinning for all third-party actions.
Annotated git tags have their own object SHA distinct
from the commit they point to. GitHub Actions requires
the commit SHA. Dereference with ^{} to get the correct
value for actions/upload-artifact, astral-sh/setup-uv,
aws-actions/configure-aws-credentials, and
EnricoMi/publish-unit-test-result-action.
Major version tags (v6, v7) are mutable — they float
forward with each release. Version comments must
reference the exact release (v6.0.2, v7.6.0) so
Dependabot can correctly identify and propose updates.
@bschwedler bschwedler force-pushed the security/sha-pinning-and-zizmor branch from 3f3e7a9 to 4332983 Compare April 10, 2026 21:05
A malicious PR could poison the uv cache and affect
subsequent runs. Disable caching on both the test and
release jobs — the ~10s install time is not worth the
attack surface.
@bschwedler bschwedler force-pushed the security/sha-pinning-and-zizmor branch from 4332983 to 1406831 Compare April 10, 2026 21:06
@bschwedler bschwedler merged commit d2f484b into main Apr 10, 2026
8 checks passed
@bschwedler bschwedler deleted the security/sha-pinning-and-zizmor branch April 10, 2026 21:08
bschwedler added a commit that referenced this pull request Apr 13, 2026
bakery-build-pr.yml was added in #442 but missed the SHA-pinning
pass in #443. Pin all third-party actions to full-length commit
SHAs matching bakery-build-native.yml, and add timeout-minutes
to all three jobs (detect: 5m, matrix: 10m, build-test: 120m).

- Upgrade oras-project/setup-oras from v1 to v2.0.0 for
  consistency with the native build workflow
- First-party composite actions (setup-bakery, setup-goss)
  intentionally kept at @main per zizmor ref-pin policy
ianpittwood pushed a commit that referenced this pull request Apr 28, 2026
Completes the SHA pinning started in PR #443. The core build
workflows (ci.yml, bakery-build-*.yml) were already pinned; this
covers the auxiliary workflows that were missed: docs.yml,
hadolint.yml, and the slack-build-notify composite action.

Mutable git tags are the exact vector exploited in the tj-actions
supply chain attack (Unit 42, March 2025) — attackers overwrote
tags to point to malicious commits.
bschwedler added a commit that referenced this pull request Apr 28, 2026
Completes the SHA pinning started in PR #443. The core build
workflows (ci.yml, bakery-build-*.yml) were already pinned; this
covers the auxiliary workflows that were missed: docs.yml,
hadolint.yml, and the slack-build-notify composite action.

Mutable git tags are the exact vector exploited in the tj-actions
supply chain attack (Unit 42, March 2025) — attackers overwrote
tags to point to malicious commits.
bschwedler added a commit that referenced this pull request Apr 30, 2026
Completes the SHA pinning started in PR #443. The core build
workflows (ci.yml, bakery-build-*.yml) were already pinned; this
covers the auxiliary workflows that were missed: docs.yml,
hadolint.yml, and the slack-build-notify composite action.

Mutable git tags are the exact vector exploited in the tj-actions
supply chain attack (Unit 42, March 2025) — attackers overwrote
tags to point to malicious commits.
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