Closed johnandersen777 closed 5 months ago
It looks like this is because any pip install
without a requirements.txt
will trigger a pinning finding.
{
"ruleId": "PinnedDependenciesID",
"ruleIndex": 4,
"message": {
"text": "score is 4: pipCommand not pinned by hash\nClick Remediation section below to solve this issue"
},
"locations": [
{
"physicalLocation": {
"region": {
"startLine": 8,
"endLine": 22,
"snippet": {
"text": "python -m pip install -r requirements-lock.txt"
}
},
"artifactLocation": {
"uri": "operations/image/Dockerfile",
"uriBaseId": "%SRCROOT%"
}
},
"message": {
"text": "pipCommand not pinned by hash"
}
}
]
}
I don't understand, how can one pin dependencies with pip in a way scorecard recognizes? There is no example in testdata/
can someone please help?
Scorecard expects the following:
python -m pip install -r requirements-lock.txt --require-hashes
The --requre-hashes
means pip will fail if the requirements file isn't hashed. Scorecard doesn't actually open the requirements file itself.
Though it probably should detect the --hash
format you tried as well...
Okay great, thank you!