-
Notifications
You must be signed in to change notification settings - Fork 109
Scorecard Integration #1294
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
base: main
Are you sure you want to change the base?
Scorecard Integration #1294
Conversation
developed functions to check for availability nexB#598 Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
…aving logic nexB#1283 Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
…exB#1283 Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
… nexB#598 Signed-off-by: 404-geek <[email protected]>
…ecard_integration
…up.cfg nexB#1283 Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
…gration # Conflicts: # scanpipe/models.py # scanpipe/tests/test_models.py
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
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.
@404-geek See my various comments ;)
Also, the new pipeline needs to be added to the built-in-pipelines.rst
documentation.
scanpipe/migrations/0070_alter_project_purl_discoveredpackagescore_and_more.py
Outdated
Show resolved
Hide resolved
scanpipe/models.py
Outdated
) | ||
|
||
@classmethod | ||
@transaction.atomic() |
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.
@404-geek You haven't address the question above yet ;)
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
…ecard_integration
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
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.
I would also suggest to simplify the pipeline and module names:
fetch_scorecode_info
->fetch_scores
FetchScoreCodeInfo
->FetchScores
@@ -1238,6 +1238,38 @@ def test_scanpipe_find_vulnerabilities_pipeline_integration( | |||
expected = vulnerability_data[0]["affected_by_vulnerabilities"] | |||
self.assertEqual(expected, package1.affected_by_vulnerabilities) | |||
|
|||
@mock.patch("scorecode.ossf_scorecard.is_available") | |||
def test_scanpipe_get_scorecard_info_packages_integration(self, mock_is_available): |
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.
This test depends on internet access at the moment. This is problematic.
The ossf_scorecard.fetch_scorecard_info
return value should be mocked instead.
package=package, scorecard_data=scorecard_obj | ||
) | ||
|
||
self.assertIsNotNone(package_score) |
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.
Test on real values.
if check.check_score == "-1": | ||
self.assertEqual(check.check_score, "-1") |
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.
What's the goal here?
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
Signed-off-by: 404-geek <[email protected]>
migrations.AlterField( | ||
model_name='codebaseresource', | ||
name='sha1_git', | ||
field=models.CharField(blank=True, help_text='SHA1 checksum generated by Git, hex-encoded.', max_length=40, verbose_name='SHA1_git'), | ||
), |
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.
This seems odd, why is it in this migration file?
@404-geek We are almost ready but there's still a few comments you have not addressed yet. |
ScoreCode Integration
This pull request integrates the ScoreCode Repo into SCIO, enabling the fetching of the latest OSSF Scorecard Data for
discovered packages
using theirvcs_url
. The current implementation supportsgithub.com
andgitlab.com
VCS URLs.Key Features:
vcs_url
github.com
andgitlab.com
VCS URLsRelated Issues:
This feature enhances SCIO's functionality by ensuring that users can retrieve the most up-to-date security scores for packages discovered in their projects, improving overall security assessment and management.