-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Apply security best practices for GitHub Actions / Dependency #38552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@microsoft-github-policy-service agree |
Thanks for raising the PR. |
@Nick2bad4u, i submitted a PR to your repo with some adjustments based on chatting with some people internally. |
I didn't even know if I was going to submit this, so I left it as a draft. The only reason I say this is because it can be a pain to constantly have to merge the version updates to any actions, etc. So it's more of a trade off of security vs convenience. Ill take a look at your adjustment when I get home in a bit here. Thanks |
This checks the dependency for version updates as they won't automatically update to the latest version after pinning to a hash. It creates a pr for the new updates if that's what you're asking. It also warns about any dependency you may be using that has open security risk. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
We need to do the hash for the 3rd party action from https://docs.opensource.microsoft.com/security/tsg/actions/#requirements-for-security-hardening-your-own-github-actions, thus, I see the latest change is great (i.e. those 1st/2nd party doesn't specify for hash. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Nick2bad4u for all the change.
I also added Microsoft Security guideline as part of the dependency-review.yml, and rebased on from latest report for test run.
added missed fixed to v4
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Oh, I see your fix @crutkas , just aware we should consider https://github.com/actions/ as 2nd party. |
Summary of the Pull Request
This pull request implements security best practices by pinning all GitHub Action tags and Docker tags to their full-length commits, following recommendations from GitHub's Security Hardening Guide. Pinning ensures that the actions used in workflows are immutable, reducing the risk posed by unintended or malicious changes.
Additionally, this PR integrates the Dependency Review Workflow, which scans for vulnerable dependency versions introduced by pull requests. This feature provides early warnings about security vulnerabilities, increasing visibility into changes and preventing vulnerabilities from being introduced into the repository.
References:
PR Checklist
Detailed Description of the Pull Request / Additional Comments
This PR focuses on hardening the repository by ensuring immutability for tags and introducing automated dependency checks. The steps undertaken include:
These changes are aimed at improving the overall security posture of the repository and aligning it with recognized security standards.
Validation Steps Performed