Skip to content

Harden GitHub Actions security#359

Merged
maennchen merged 7 commits into
mainfrom
jm/ci
Apr 14, 2026
Merged

Harden GitHub Actions security#359
maennchen merged 7 commits into
mainfrom
jm/ci

Conversation

@maennchen
Copy link
Copy Markdown
Member

Summary

This PR contains multiple commits improving GitHub Actions security:

  • Disable credential persistence - Add persist-credentials: false to actions/checkout
  • Restrict workflow permissions - Add explicit contents: read permissions
  • Pin GitHub Actions to commit SHAs - Prevent supply chain attacks via tag hijacking
  • Update GitHub Actions - Upgrade to latest versions:
    • actions/checkout: v4.3.1 → v6.0.2
    • codecov/codecov-action: v4.6.0 → v6.0.0
  • Add security scanning - CodeQL workflow for static analysis and zizmor for CI/CD security auditing
  • Add Dependabot - Keep GitHub Actions up to date with grouped weekly PRs

Similar changes have already been applied to:

Required Repository Settings

After merging, enable the following repository settings in "Rules" / "Rulesets":

Add "Require code scanning results" with the following tools:

  • CodeQL
  • zizmor

Set "Security Alerts" and "Alert" to "All":

Screenshot 2026-02-25 at 12 29 11

That way PR merges are blocked until all issues have been identified.

References

Set persist-credentials: false in actions/checkout to prevent
git credentials from being stored on disk where they could
accidentally be included in publicly accessible artifacts.

See: https://docs.zizmor.sh/audits/#artipacked
Add explicit permissions block with only contents: read instead
of relying on potentially broad default GITHUB_TOKEN permissions.

See: https://docs.zizmor.sh/audits/#excessive-permissions
Pin third-party actions to specific commit hashes instead of
mutable version tags to prevent supply chain attacks from
compromised or hijacked action repositories.

- erlef/setup-beam@v1 → fc68ffb90438ef2936bbb3251622353b3dcb2f93 (v1.24.0)
- codecov/codecov-action@v4 → b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 (v4.6.0)

See: https://docs.zizmor.sh/audits/#unpinned-uses
- actions/checkout v4.3.1 → v6.0.2
- codecov/codecov-action v4.6.0 → v6.0.0
Configure weekly grouped PRs for all action dependencies.
Analyze GitHub Actions workflows for security vulnerabilities.
Runs on push/PR to main and weekly on Mondays.
Scan GitHub Actions workflows for security issues using zizmor,
reporting findings via GitHub Security tab (SARIF).
@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.

@maennchen maennchen merged commit 3b3c13d into main Apr 14, 2026
9 of 10 checks passed
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