Skip to content

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

Open
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

404-geek
Copy link
Collaborator

@404-geek 404-geek commented Jun 26, 2024

ScoreCode Integration

This pull request integrates the ScoreCode Repo into SCIO, enabling the fetching of the latest OSSF Scorecard Data for discovered packages using their vcs_url. The current implementation supports github.com and gitlab.com VCS URLs.

Key Features:

  • Integration with ScoreCode Repo
  • Fetching of OSSF Scorecard Data using vcs_url
  • Support for github.com and gitlab.com VCS URLs

Related 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.

404-geek added 30 commits June 26, 2024 13:20
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]>
…gration

# Conflicts:
#	scanpipe/models.py
#	scanpipe/tests/test_models.py
Copy link
Contributor

@tdruez tdruez left a 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.

)

@classmethod
@transaction.atomic()
Copy link
Contributor

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 ;)

@404-geek 404-geek requested a review from tdruez March 2, 2025 06:46
Copy link
Contributor

@tdruez tdruez left a 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):
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Test on real values.

Comment on lines +2625 to +2626
if check.check_score == "-1":
self.assertEqual(check.check_score, "-1")
Copy link
Contributor

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?

@404-geek 404-geek requested a review from tdruez July 14, 2025 13:44
Comment on lines +15 to +19
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'),
),
Copy link
Contributor

@tdruez tdruez Jul 14, 2025

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?

@tdruez
Copy link
Contributor

tdruez commented Jul 14, 2025

@404-geek We are almost ready but there's still a few comments you have not addressed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store OSSF scorecard data in scancode.io models Enrich an SBOM using OSSF Security Score Card
4 participants