Skip to content

ci: add OpenSSF Scorecard workflow - #44

Merged
eseidel merged 1 commit into
mainfrom
scorecard
Dec 2, 2026
Merged

eseidel merged 1 commit into
mainfrom
scorecard

Conversation

@eseidel

@eseidel eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Why

Eric (12-01) asked for the OpenSSF Scorecard on our public repos, if it's a single small workflow. Scorecard scores a repo's supply-chain practices (pinned actions, token permissions, branch protection, dangerous workflow patterns) and publishes the score to api.securityscorecards.dev, where customers' security reviews and tools like deps.dev look for it. This repo has none today.

The standard way is ossf/scorecard-action's own example workflow, which this is, with each action pinned to a commit SHA (version in a comment) to match the repo's other workflows.

What changes

  • One new workflow: runs weekly (Monday 01:30 UTC), on pushes to the default branch, on branch-protection changes, and by hand.
  • Findings appear in the Security → Code scanning tab; the score is public at scorecard.dev.
  • The workflow's token is read-only, except security-events: write (upload SARIF) and id-token: write (sign the published result).

What could go wrong

Nothing ships from it; it only reads the repo. If publishing fails (the action restricts what a publishing workflow may contain), the run goes red on the default branch, and that's all. It doesn't run on PRs, so it won't block one.

Landing

Lands once approved and green.

Screenshots

No visible change: CI-only.

🤖 Generated with Claude Code

@eseidel

eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Adversarial review (separate agent)

No blocking findings.

Checked:

  • Pinned SHAs match their tag comments (resolved with gh api repos/<owner>/<repo>/commits/<tag>):
    • actions/checkout v7.0.1 = 3d3c42e5… ✓
    • ossf/scorecard-action v2.6.0 = 23f22cd4… ✓ (latest release)
    • actions/upload-artifact v7.0.2 = cf430e03… ✓ (latest)
    • github/codeql-action v4.39.5 = 915412ff… ✓ (same commit as the current v4)
  • publish_results restrictions (scorecard-action README at that SHA): there is no top-level env/defaults. Top-level permissions are read-all with no workflow-level writes. id-token: write and security-events: write are set only on the scorecard job. The job has no env, defaults, container or services, runs on ubuntu-latest, and its steps use only allowlisted actions (checkout, upload-artifact, codeql-action/upload-sarif, scorecard-action). ✓
  • Repo Actions policy: sha_pinning_required: true, and every uses: is pinned to a full SHA. scorecard-action is a Docker action (docker://ghcr.io/ossf/scorecard-action:v2.6.0), so it adds no nested uses: that the pinning rule would reject. ✓
  • The repo is public, so code scanning can receive SARIF uploads, and publishing to api.securityscorecards.dev is allowed.
  • Triggers: push is on the default branch, plus the weekly schedule and branch_protection_rule, all supported. workflow_dispatch is marked "experimental" upstream and does no harm. The workflow won't run on this PR. Its first real run is the push when this merges.

Unrelated to this diff: all three e2e / install (*) jobs fail at "🔁 Rerun installer" with A previous Shorebird install at ... is incomplete, where the test expects "already installed". This PR only adds scorecard.yaml, so the failure comes from install.sh or the live release, not from this change. The last e2e run on main passed on 2026-11-17. Worth confirming that it reproduces on main before treating it as a blocker. None of these checks are marked required.

@eseidel

eseidel commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

The e2e failure here isn't this PR's: since shorebird#4529, a rerun of the installer calls a prebuilt-CLI install incomplete, on main too. Fixed in #45; this PR lands after it (CI will rerun once rebased).

Runs ossf/scorecard-action (SHA-pinned) weekly and on pushes to the
default branch, uploading SARIF to code scanning and publishing the
score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eseidel
eseidel merged commit bab595b into main Dec 2, 2026
3 checks passed
@eseidel
eseidel deleted the scorecard branch December 2, 2026 00:07
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