scorecard icon indicating copy to clipboard operation
scorecard copied to clipboard

Feature: specify the cause of failure if it is unpinned pip install

Open joycebrum opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. When the user sees a report on code scanning about a "pip install" line in his script, it is not clear what he would have to do to solve it. To make it easier to the user to identify what to do, the description of the "pipCommand not pinned by hash" could also mention something like: "--require-hashes expected". Or if it fails due to additional arguments, would be interesting to also specify.

Describe the solution you'd like A possible solution would be to adapt the error message to make the logic bellow clear to the user. https://github.com/ossf/scorecard/blob/a6983edf6e320a0878dc062cb60aba4f2f215668/checks/raw/shell_download_validate.go#L469-L527

Describe alternatives you've considered None

Additional context An example of a report on code scanning about pipCommand

image

joycebrum avatar Nov 09 '22 18:11 joycebrum

A good solution would be to insert the solution to "pipCommand not pinned by hash" as a Remediation tip, as it's currently done when we have a GitHub Action not hash-pinned. See the example below:

image

diogoteles08 avatar Apr 26 '23 18:04 diogoteles08

The same issue applies to other ecosystems. I'll list some examples with images to show the current message being displayed, and what scorecard expects as a remediation (to make it easier to someone to make the message changes).

  1. npm (I believe we're verifying if it's using npm ci instead of npm install): image

  2. chocolatey (scorecard requires the argument --require-checkums): image

  3. GO language(here it's only required to have the specific version declared, because of GO's checksum database): image

diogoteles08 avatar Apr 26 '23 18:04 diogoteles08

Hi! I’d like to work on this issue. I can start with the pip install remediation message (e.g., mention --require-hashes / hash-pinning) and submit a PR. Would you prefer the remediation tip to be implemented in the check output, or in the docs for the Pinned-Dependencies check?

D9mond avatar Feb 24 '26 21:02 D9mond

Opened #5043 for this.

alliasgher avatar May 02 '26 10:05 alliasgher

I'd like to work on this: add a clear remediation hint for unpinned pip install in the Pinned-Dependencies check output (e.g. --require-hashes / hash pinning). I'll open a PR with a DCO-signed commit and a test.

Sanilas-ai avatar Nov 02 '26 09:11 Sanilas-ai