[Security] Pin GitHub Actions to a full-length commit SHA #141
Approved these changes.
<a target='_blank' href='https://app.datadoghq.com/ci/pipeline-executions?query=ci_level%3Ajob+%40ci.status%3Aerror+%40git.commit.sha%3A3b855b60c9ce6f5c1b5767aae5dbe4ec6d02c30a&referrer=pr-comment&start=1795006202000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-error.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-error-light.svg" alt="Pipelines" align="center" /></picture></a>
✨ <a href="https://app.datadoghq.com/api/ui/code-annotation/fix-with-bitsai?head_sha=3b855b60c9ce6f5c1b5767aae5dbe4ec6d02c30a&pr_number=141&repo_id=github.com%2Fdatadog%2Fdatadog-csi-driver"><b>Unblock PR with BitsAI</b></a>
❌ Errors
Your PR has failed checks. Please review the issues below and take necessary action before merging.
🚦 2 Pipeline jobs failed
<blockquote>
<div>
<details open>
<summary>DataDog/datadog-csi-driver | e2e_tests: [arm64, arm64] — 🔧 Needs a code fix, caused by this PR</summary>
<a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL2RhdGFkb2ctY3NpLWRyaXZlci8xNDE=?referrer=pr-comment&buildId=AwAAAaHu1mdYPN5bZQAAABhBYUh1MW1kWUFBREUtQl83THlrLUNFcFEAAAAkMDFhMWVlZDYtNmY5Yi00ZGNkLThlMTEtYTRjZGVlMmE4NDk0AAAALg&ciFailurePanel=job">View more details</a> · <a href="https://gitlab.ddbuild.io/DataDog/datadog-csi-driver/-/jobs/2270028336">View in GitLab</a>
</details>
<details open>
<summary>pull request linter | build</summary>
<a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL2RhdGFkb2ctY3NpLWRyaXZlci8xNDE=?referrer=pr-comment&buildId=AwAAAaHu0OFIfAobWgAAABhBYUh1ME9GSUFBQmc3TG9NU3VNLXdNRVgAAAAkMDFhMWVlZDQtODAzMi00ZmE0LWFmZWQtZWY1NThhY2JjZDZlAACKKg&ciFailurePanel=job">View more details</a> · <a href="https://github.com/DataDog/datadog-csi-driver/actions/runs/44312658187/job/134830525322">View in GitHub Actions</a>
</details>
</div>
</blockquote>
Useful? React with 👍 / 👎
<sub>
This comment will be updated automatically if new data arrives. <br />
🔗 Commit SHA: 3b855b6 | <a href="https://docs.datadoghq.com/integrations/guide/source-code-integration/#pr-comments">Docs</a> | <a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL2RhdGFkb2ctY3NpLWRyaXZlci8xNDE=?referrer=pr-comment">View more details</a> | Give us <a href="https://dd.enterprise.slack.com/archives/C07E3U2QRMM">feedback</a>!
</sub>
tbavelier
chouetz
Pin GitHub Actions to SHA hashes
This automated PR 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 theDataDogorganization) are not pinned.Read https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions 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 tj-actions incident). 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.
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. As a last resort, reach out to #sdlc-security on Slack.
Set up Dependabot or Renovate for automatic updates
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:Dependabot will automatically propose PRs that update both the SHA hash and the version comment like in this example.
---
This PR was automatically generated by the GitHub Actions Pinning tool, owned by #sdlc-security.