Skip to content

fix(security): pin dependencies - #17

Open
itv-github-actions-pinner[bot] wants to merge 1 commit into
masterfrom
security/sha-pin
Open

fix(security): pin dependencies#17
itv-github-actions-pinner[bot] wants to merge 1 commit into
masterfrom
security/sha-pin

Conversation

@itv-github-actions-pinner

Copy link
Copy Markdown

🔒 Security Enhancement: Pin GitHub Actions to Commit SHAs

This automated Pull Request pins third-party GitHub Actions references from mutable tag versions (e.g. @v4) to their corresponding SHA hashes (e.g. @abc123...). The original tag is preserved as a comment for readability. Your workflows will work exactly the same way. Internal actions (under the ITV organization) are not pinned.

Read GitHub docs on secure use of third-party actions and ITV's GitHub Actions Security Policy for more details and info on how to configure this for entire repos.

Why pin GitHub Actions?

Git tags are mutable: they can be moved to point to different commits at any time. A compromised or malicious action maintainer could update a tag to inject arbitrary code into your CI workflows (see the GitHub Actions Supply Chain Attack). Pinning to SHA hashes ensures you always run the exact code you reviewed, protecting your repository from supply chain attacks such as the tj-actions incident.

Example Changes

Before:

uses: actions/checkout@v4.1.1

After:

uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11  # v4.1.1

What if something breaks?

If a pinned action doesn't work for your use case, you can push a commit directly to this branch to fix it.
Alternatively, reach out to #cyber-security on Slack for any issues.

Keep pins up to date

Once actions are pinned to SHA hashes, you should configure Dependabot or Renovate to receive weekly update PRs when new versions are available.

In the case of Dependabot, create or update .github/dependabot.yml:

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    groups:
      github-actions:
        patterns:
          - "*"
    open-pull-requests-limit: 10

In the case of Renovate, add to your renovate.json:

{
  "extends": ["helpers:pinGitHubActionDigestsToSemver"],
  "enabledManagers": ["github-actions"]
}

This PR was automatically generated to enhance our security posture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants