Skip to content

chore: harden GitHub Actions — pin CodeQL, explicit perms on release jobs (#99)#171

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
chore/99-gha-hardening
Jun 26, 2026
Merged

chore: harden GitHub Actions — pin CodeQL, explicit perms on release jobs (#99)#171
Chris-Wolfgang merged 1 commit into
vNextfrom
chore/99-gha-hardening

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

Hardens GitHub Actions per the acceptance criteria in #99 (SHA-pin third-party actions; least-privilege permissions on every workflow).

Changes

  • codeql.yaml — SHA-pin github/codeql-action/init and github/codeql-action/analyze to 8aad20d (v4.36.2). Previously @v4, which silently floats to the latest v4.x patch.
  • release.yaml — declare permissions: {} explicitly on validate-release, pack-and-validate, verify-docs-build, and publish-nuget. None of these jobs need GITHUB_TOKEN scopes (publish-nuget authenticates to NuGet via NUGET_API_KEY), so the no-privilege baseline is now explicit instead of inherited.

Audited and unchanged

  • benchmarks.yaml, build-all-versions.yaml, docfx.yaml, pr.yaml, stryker.yaml — already have appropriate top-level permissions: contents: read plus job-level overrides, and all third-party action references are either SHA-pinned (benchmark-action/github-action-benchmark@52576c9, peaceiris/actions-gh-pages@84c30a8, softprops/action-gh-release@718ea10) or first-party actions/*.
  • pull_request_target usage in pr.yaml is paired with the protected-config guard pattern; secrets scan runs before checkout. No changes needed.

Heads-up

Workflow files are in the protected-files guard set, so this PR may need the maintainer-bypass merge path or a protected-file-pr-split at merge time.

Closes #99

- codeql.yaml: SHA-pin github/codeql-action/init and /analyze to v4.36.2 (8aad20d). Was @v4, which silently auto-tracks the latest v4.x.
- release.yaml: declare explicit `permissions: {}` on validate-release, pack-and-validate, verify-docs-build, and publish-nuget. None of these jobs need GITHUB_TOKEN scopes (publish-nuget auths to NuGet via NUGET_API_KEY); making the no-privilege baseline explicit is defense-in-depth.

Other workflows audited (benchmarks, build-all-versions, docfx, pr, stryker) already had appropriate top-level + job-level permissions and either SHA-pinned or first-party (actions/*) action references.

Closes #99
@Chris-Wolfgang Chris-Wolfgang merged commit f8444f5 into vNext Jun 26, 2026
@Chris-Wolfgang Chris-Wolfgang deleted the chore/99-gha-hardening branch June 26, 2026 20:06
Chris-Wolfgang added a commit that referenced this pull request Jun 26, 2026
Resolve conflicts from main's Dependabot bump (#163) by keeping vNext's
forward-moving versions:
- Wolfgang.Etl.Abstractions 0.14.1 (vNext) > 0.14.0 (main)
- Wolfgang.Etl.TestKit / .Xunit 0.9.0 (vNext) > 0.8.1 (main)
- release.yaml verify-docs-build keeps the permissions: {} added in #171

Verified: src builds Release clean (0 warnings).
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