KEMBAR78
🐛 do not include asName when creating digest of FROM name as asName by AdamKorcz · Pull Request #4683 · ossf/scorecard · GitHub
Skip to content

Conversation

AdamKorcz
Copy link
Contributor

What kind of change does this PR introduce?

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

bug fix

What is the current behavior?

When calculating the digest in remediation, Scorecard would do that from python:3.7:build when the line was FROM python:3.7 as build. This would lead to issues such as #2906.

We are creating the digest on the following lines:

name, ok := dockerImageName(dep)
if !ok {
return nil
}
hash, err := digester.Digest(name)
if err != nil {
return nil
}

From the PR, it should be clear that d.PinnedAt is assigned the wrong value; it gets assigned asPointer(asName) which is the root cause of the bug. digester.Digest(name) throws an error like: parsing reference "python:3.7:build": could not parse reference: python:3.7:build because of this.

What is the new behavior (if this is a feature change)?**

With this change, we create the digest from python:3.7 in the same line as above.

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

Which issue(s) this PR fixes

Fixes #2906

Special notes for your reviewer

Does this PR introduce a user-facing change?

NONE

Ignore as-name with creating digest.

Signed-off-by: Adam Korczynski <adam@adalogics.com>
@AdamKorcz AdamKorcz requested a review from a team as a code owner June 27, 2025 20:10
@AdamKorcz AdamKorcz requested review from justaugustus and raghavkaul and removed request for a team June 27, 2025 20:10
@AdamKorcz AdamKorcz temporarily deployed to integration-test June 27, 2025 20:11 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.88%. Comparing base (353ed60) to head (861a2b9).
⚠️ Report is 233 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4683      +/-   ##
==========================================
+ Coverage   66.80%   67.88%   +1.07%     
==========================================
  Files         230      249      +19     
  Lines       16602    19081    +2479     
==========================================
+ Hits        11091    12953    +1862     
- Misses       4808     5268     +460     
- Partials      703      860     +157     
🚀 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.

@github-actions
Copy link

github-actions bot commented Jul 8, 2025

This pull request has been marked stale because it has been open for 10 days with no activity

@AdamKorcz
Copy link
Contributor Author

Please reopen

@github-actions
Copy link

This pull request has been marked stale because it has been open for 10 days with no activity

@github-actions github-actions bot added Stale and removed Stale labels Aug 14, 2025
@github-actions
Copy link

This pull request has been marked stale because it has been open for 10 days with no activity

@github-actions github-actions bot added the Stale label Aug 26, 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.

/scdiff generate Pinned-Dependencies

@spencerschrock
Copy link
Member

/scdiff generate Pinned-Dependencies

@github-actions
Copy link

@spencerschrock spencerschrock merged commit 954b5f7 into ossf:main Sep 10, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BUG: Dockerfile named build stages with incomplete remediation report

3 participants