KEMBAR78
:seedling: security: pin GitHub Actions to commit hashes by harekrishnarai · Pull Request #4678 · ossf/scorecard · GitHub
Skip to content

Conversation

harekrishnarai
Copy link
Contributor

What

This pull request pins all GitHub Actions in workflow files to specific commit hashes to improve security and ensure reproducible builds. kind of change does this PR introduce?

(Is it a bug fix, feature, docs update, something else?)

What

This pull request pins all GitHub Actions in workflow files to specific commit hashes to improve security and ensure reproducible builds. is the current behavior?

What

This pull request pins all GitHub Actions in workflow files to specific commit hashes to improve security and ensure reproducible builds. is the new behavior (if this is a feature change)?**

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)


@harekrishnarai harekrishnarai requested a review from a team as a code owner June 27, 2025 03:30
@harekrishnarai harekrishnarai requested review from justaugustus and raghavkaul and removed request for a team June 27, 2025 03:30
@harekrishnarai harekrishnarai changed the title chore(security): pin actions to specific commits security: pin GitHub Actions to commit hashes Jun 27, 2025
@harekrishnarai harekrishnarai changed the title security: pin GitHub Actions to commit hashes 🌱 security: pin GitHub Actions to commit hashes Jun 27, 2025
Copy link
Member

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to double check the source, but we intentionally pin to a tag here due to a requirement from the slsa-verifier. All of our other action usages are pinned.

@ramonpetgrave64
Copy link

Hi @spencerschrock It's safe to pin by hash now.

See an example here https://github.com/ramonpetgrave/my-example-gradle-project/actions/runs/15931641240/job/44941968699?pr=13

What's still not okay to pin by hash are the reusable workflows in slsa-github-generator.

@spencerschrock
Copy link
Member

Also can you fix DCO and ensure any follow-up commits follow the practice?
https://github.com/ossf/scorecard/runs/44897673400

@spencerschrock spencerschrock dismissed their stale review June 27, 2025 17:01

Pinning by commit is ok for this action

Pin GitHub Actions to commit hashes for improved security and reproducible builds

Signed-off-by: harekrishnarai <786hkr@gmail.com>
- Update slsa-framework/slsa-verifier/actions/installer to v2.7.1
- Use commit hash ea584f4502babc6f60d9bc799dbbb13c1caa9ee6
- Remove date comment as suggested by reviewer

Signed-off-by: harekrishnarai <786hkr@gmail.com>
@harekrishnarai harekrishnarai force-pushed the pin-actions-20250627-085952 branch from c2a6b67 to bd3df6d Compare June 27, 2025 20:07
@harekrishnarai
Copy link
Contributor Author

harekrishnarai commented Jun 27, 2025

Issues resolved:

  1. DCO Fixed: All commits now include proper DCO sign-off with 'Signed-off-by' lines
  2. Updated to v2.7.1: Updated slsa-framework/slsa-verifier/actions/installer from v2.7.0 to v2.7.1 using commit hash ea584f4502babc6f60d9bc799dbbb13c1caa9ee6
  3. Removed date comment: Removed the '# on 2025-06-27' comment as suggested

The PR now addresses all review feedback and is ready for re-review. Thank you @spencerschrock for the guidance!

Copy link
Member

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.29%. Comparing base (353ed60) to head (9aa3d5c).
Report is 188 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4678      +/-   ##
==========================================
+ Coverage   66.80%   68.29%   +1.48%     
==========================================
  Files         230      249      +19     
  Lines       16602    18884    +2282     
==========================================
+ Hits        11091    12896    +1805     
- Misses       4808     5129     +321     
- Partials      703      859     +156     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harekrishnarai
Copy link
Contributor Author

@spencerschrock I just updated this branch with main branch, if possible, could you please approve to run the workflows, so that we can proceed to merge?

@spencerschrock spencerschrock enabled auto-merge (squash) June 27, 2025 20:38
@spencerschrock spencerschrock merged commit 6a4529c into ossf:main Jun 27, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants