Skip to content

security: address 22 of 25 OSSF Scorecard findings#13

Merged
prodnull merged 2 commits into
mainfrom
security/scorecard-hardening
Apr 23, 2026
Merged

security: address 22 of 25 OSSF Scorecard findings#13
prodnull merged 2 commits into
mainfrom
security/scorecard-hardening

Conversation

@prodnull
Copy link
Copy Markdown
Owner

Summary

Remediates 22 of the 25 open OSSF Scorecard code-scanning findings on main (d2744fe baseline). Splits into two logical commits:

  1. Pinned-Dependencies (16 alerts + 3 npm/pip + 1 npm-ci-not-lockfile) — pin GitHub Actions by commit SHA, container images by sha256 digest, npm/pip install targets to exact versions, npm installnpm ci in the demo recorder.
  2. Token-Permissions (3 alerts) + CodeQL missing-workflow-permissions (2 alerts) — move write-scope GITHUB_TOKEN permissions off the workflow top level and onto only the jobs that actually need them. Adds an explicit permissions: contents: read block to mac-policy.yml, which previously had none.

Not remediated in this PR

Alert Rule Reason
#19 Code-Review Requires PR-with-approval flow; this PR contributes to closing it.
#20 Maintained Time-based (repo <90 days old); auto-resolves.
#21 CII-Best-Practices External badge; file separately at https://bestpractices.coreinfrastructure.org/.
#22 Vulnerabilities 7 flagged RUSTSEC advisories; some already ignored in deny.toml with rationale. Needs a focused audit pass — separate PR.
#2 Token-Permissions (jobLevel contents: write in release.yml release job) Intentional — the release job must create the GitHub Release and upload assets. Not a Scorecard false positive but a genuinely required write.

Refresh query

gh api repos/prodnull/prmana/code-scanning/alerts --paginate \
  | jq -r '.[] | select(.state=="open") | "\(.number)\t\(.rule.name)\t\(.most_recent_instance.location.path // "n/a"):\(.most_recent_instance.location.start_line // 0)"'

Scorecard alerts addressed

Test plan

  • All modified workflow YAML parses cleanly (python3 -c 'import yaml; yaml.safe_load(open(f))').
  • Image digests resolved against live Docker Hub registry (OCI index + Docker v2 manifest accept headers).
  • GitHub Action SHAs resolved from annotated-tag dereference via gh api.
  • npm/pip package versions are current upstream stable at time of commit.
  • CI runs on this PR: Pages deploy (pinned actions), Validate Documentation (pinned npm), CI (pinned pip), mac-policy (new permissions block) all pass.
  • Scorecard workflow re-run after merge closes at least 20 of the targeted alerts.

Signed commits (GPG 9D5E79FBDC9AB54D).

🤖 Generated with Claude Code

Pin GitHub Actions by commit SHA and container images by digest so
reproducible builds survive upstream tag mutation (OSSF Scorecard
Pinned-Dependencies, alerts 7-18, 23-26).

- .github/workflows/pages.yml: pin checkout/configure-pages/
  upload-pages-artifact/deploy-pages by SHA.
- .github/workflows/validate-docs.yml: pin markdownlint-cli2@0.22.0,
  markdown-link-check@3.14.2, cspell@10.0.0.
- .github/workflows/ci.yml: pin cryptography==46.0.7 for cross-language
  interop tests.
- demo/record-demo.sh: npm install -> npm ci to enforce lockfile.
- demo/package.json: @playwright/test ^1.48.0 -> 1.57.0 (exact).
- Dockerfiles (Dockerfile.build + 4 test-host variants): pin image
  digests for rust:1.88-slim-bookworm, rust:1.85-bookworm, ubuntu:22.04,
  ubuntu:24.04, jrei/systemd-ubuntu:22.04.

Refs: prodnull/prmana code-scanning alerts 7, 8, 9, 10, 11, 12, 13,
14, 16, 17, 18, 23, 24, 25, 26.
Move write-scope GITHUB_TOKEN permissions from workflow top level to
only the jobs that actually require them (OSSF Scorecard
Token-Permissions, alerts 4, 5, 6, and CodeQL
actions/missing-workflow-permissions alerts 30, 31).

- release.yml: top level contents:read; build job adds id-token:write
  + attestations:write (SLSA provenance); package/test jobs are
  contents:read. release job retains contents:write (required to create
  the GitHub Release and upload assets).
- publish-repo.yml: top level contents:read; publish job adds
  contents:write (gh-pages push) + actions:read.
- mac-policy.yml: add explicit top-level + per-job contents:read.
  Previously had no permissions block at all, which left the token at
  the installation default.

Refs: prodnull/prmana code-scanning alerts 4, 5, 6, 30, 31.
@prodnull prodnull force-pushed the security/scorecard-hardening branch from e10b36b to 04eaeff Compare April 23, 2026 19:26
@prodnull prodnull merged commit 581bbc4 into main Apr 23, 2026
1 check passed
@prodnull prodnull deleted the security/scorecard-hardening branch April 23, 2026 19:40
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