1- ====================================================================================
2- Integrating OpenSSF Scorecard into Scancode.io for Enhanced Vulnerability Analysis
3- ====================================================================================
1+ ==================================================
2+ Enrich SBOM data based on OSSF Security Score Card
3+ ==================================================
44
55
66**Organization: ** `AboutCode <https://aboutcode.org >`_
77
8- **Projects: ** `Scancode.io <https://github.com/aboutcode-org/scancode.io >`_,
9- `Scorecode <https://github.com/aboutcode-org/scorecode >`_
8+ **Projects: **
9+ - `Scancode.io <https://github.com/aboutcode-org/scancode.io >`_
10+ - `Scorecode <https://github.com/aboutcode-org/scorecode >`_
1011
1112**Mentee: ** `Pranay Das (404-geek) <https://github.com/404-geek >`_
1213
@@ -22,25 +23,30 @@ Integrating OpenSSF Scorecard into Scancode.io for Enhanced Vulnerability Analys
2223Overview
2324--------
2425
25- The primary objective of this project was to integrate the OpenSSF Scorecard into the
26- Scancode.io platform, thereby enhancing its capabilities for vulnerability analysis.
27- The project involved work on two key repositories: `Scorecode `,which was developed as a
28- PyPI package, and `Scancode.io `, where the integration with Scorecard data was
29- implemented within scanning pipelines.
26+ The primary objective of this project was to fetch and integrate the OpenSSF Scorecard
27+ data into the Scancode.io platform for all detected packages, thereby enhancing its
28+ capabilities for security and community health metrics analysis. The project
29+ involved work on two key repositories: `Scorecode `,which was developed as a PyPI
30+ package, and `Scancode.io `, where the integration with Scorecard data was implemented
31+ within scanning pipelines.
3032
3133**Scorecode **
3234
33- `Scorecode ` serves as a PyPI package that encapsulates the business logic for fetching
34- OpenSSF Scorecard data using the OpenSSF API. It also includes Django mixin models that
35- can be extended and integrated into other platforms with databases, such as Scancode.io
36- and PurlDB, ensuring seamless utilization of Scorecard data across various projects.
35+ `scorecode package <https://pypi.org/project/scorecode/ >`_ serves as a PyPI package
36+ that has the functions to fetch and store OpenSSF Scorecard data using the OpenSSF
37+ public API. It also includes Django mixin models that can be extended and integrated
38+ into other platforms with databases, such as Scancode.io and PurlDB, ensuring seamless
39+ utilization of Scorecard data across various projects.
40+
41+
3742
3843**Scancode.io **
3944
40- In the `Scancode.io ` project, I developed a pipeline that interacts with the `Scorecode `
45+ In the `Scancode.io ` project, I added a pipeline that interacts with the `scorecode `
4146package to fetch and store Scorecard data in the Scancode.io database. The data can then
42- be exported into Bill of Materials (BOM) files in formats like CycloneDX and SPDX,
43- providing comprehensive security insights in standardized formats.
47+ be exported into various outputs like the Software Bill of Materials (SBOM)
48+ CycloneDX format (and SPDX too in the future), providing comprehensive security
49+ insights in standardized formats.
4450
4551--------------------------------------------------------------------------------
4652
@@ -50,50 +56,86 @@ Implementation
5056**1. Scorecode Repository: **
5157
5258 - Developed a PyPI package to interact with the OpenSSF API and fetch Scorecard data
53- for various software packages.
59+ to be used in other software packages and store it in appropriate objects .
5460 - Created Django mixin models to enable easy extension and integration of Scorecard
5561 data into platforms with databases like Scancode.io.
5662
63+ For more information, you can visit the
64+ `scorecode package on PyPI <https://pypi.org/project/scorecode/ >`_.
65+
66+
5767**2. Scancode.io Integration: **
5868
5969 - Developed a pipeline within Scancode.io to call `Scorecode ` functions, retrieve
6070 Scorecard data, and save it in the Scancode.io database.
61- - Enhanced the existing BOM export functionality to include Scorecard data, allowing
62- for detailed security posture analysis in CycloneDX and SPDX formats.
71+ - Enhanced the existing SBOM export functionality to include Scorecard data, allowing
72+ for detailed security posture and community health metrics analysis in CycloneDX
73+ format.
6374
6475**4. Testing: **
6576
66- - Conducted comprehensive testing in both repositories to ensure accurate fetching,
67- storage, and export of Scorecard data.
68- - Verified seamless integration across different package ecosystems supported by
69- Scancode.io.
77+ - Conducted comprehensive testing across two primary repositories hosted on GitHub
78+ and GitLab to ensure accurate fetching, storage, and export of Scorecard data:
79+
80+ - **GitHub **:
81+
82+ - `nexB/scancode-toolkit <https://github.com/nexB/scancode-toolkit >`_
83+ - `tensorflow/tensorflow <https://github.com/tensorflow/tensorflow >`_
84+ - `apache/spark <https://github.com/apache/spark >`_
85+
86+ - **GitLab **: `gitlab-org/gitlab <https://gitlab.com/gitlab-org/gitlab >`_
87+
88+ - Verified seamless integration and accurate data retrieval across different package
89+ ecosystems supported by Scancode.io, ensuring that the Scorecard data aligns with
90+ the expected structure and content.
91+
92+ - Implemented and executed automated test cases using `pytest `, which include:
93+
94+ - Validation of key fields such as ``scoring_tool ``, ``scoring_tool_version ``,
95+ ``score_date ``, ``score ``, ``scoring_tool_documentation_url ``, and ``checks ``.
96+
97+ - Type checks for each field to ensure data integrity.
98+
99+ - URL validation to confirm that the documentation links are correctly formatted
100+ and point to the expected resources.
101+
102+ - Added additional test cases for edge scenarios such as non-existent repositories,
103+ private repositories, and invalid input formats to ensure robustness and
104+ reliability.
105+
70106
71107--------------------------------------------------------------------------------
72108
73109Linked Pull Requests
74110--------------------
75111
76112.. list-table ::
77- :widths: 10 60 30
113+ :widths: 10 40 20 30
78114 :header-rows: 1
79115
80116 * - Sr. no
117+ - Name
81118 - Link
82119 - Status
83120 * - 1
121+ - Scorecard Integration
84122 - https://github.com/aboutcode-org/scancode.io/pull/1294
85123 - Open
86124 * - 2
125+ - Models integration
87126 - https://github.com/aboutcode-org/scorecode/pull/5
88127 - Merged
89- * - 2
128+ * - 3
129+ - Scorcard api call integration
90130 - https://github.com/aboutcode-org/scorecode/pull/1
91131 - Merged
92- * - 2
132+ * - 4
133+ - Mixin models for storing scorecard data
93134 - https://github.com/aboutcode-org/scorecode/pull/4
94135 - Merged
95136
96137
138+
97139Related Issues
98140--------------
99141
@@ -106,20 +148,20 @@ Related Issues
106148 - Link
107149 * - 1
108150 - Store OSSF scorecard data in scancode.io models
109- - `#1283 <https://github.com/aboutcode-org/scancode.io/issues/1283 >`_
151+ - `aboutcode-org/scancode.io #1283 <https://github.com/aboutcode-org/scancode.io/issues/1283 >`_
110152 * - 2
111153 - Show OSSF scorecard data in the UI as quality data
112- - `#1284 <https://github.com/aboutcode-org/scancode.io/issues/1284 >`_
154+ - `aboutcode-org/scancode.io #1284 <https://github.com/aboutcode-org/scancode.io/issues/1284 >`_
113155 * - 3
114156 - Export OSSF scorecard data in SBOMs
115- - `#1285 <https://github.com/aboutcode-org/scancode.io/issues/1285 >`_
157+ - `aboutcode-org/scancode.io #1285 <https://github.com/aboutcode-org/scancode.io/issues/1285 >`_
116158 * - 4
117159 - Compute summary and clarity for EACH package in a codebase
118- - `#3 <https://github.com/aboutcode-org/scorecode/issues/3 >`_
160+ - `aboutcode-org/scorecode #3 <https://github.com/aboutcode-org/scorecode/issues/3 >`_
119161 * - 5
120162 - Provide data values in scan results to correspond with license_clarity_score
121163 elements
122- - `#2 <https://github.com/aboutcode-org/scorecode/issues/2 >`_
164+ - `aboutcode-org/scorecode #2 <https://github.com/aboutcode-org/scorecode/issues/2 >`_
123165
124166
125167Project Reference Links
0 commit comments