Skip to content

Modify Gitlab Importer to support package-first mode #1910

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 8 commits into
base: main
Choose a base branch
from

Conversation

michaelehab
Copy link
Collaborator

Solves #1903

  • Extract Gitlab API handling code from vulntotal gitlab datasource into a utils file.
  • Update vulntotal gitlab datasource to use the utils file.
  • Update vulntotal gitlab datasource tests to reflect the changes.
  • Modify Gitlab Importer to support package-first mode when a PURL is provided in the constructor.
  • Update Gitlab Importer tests to test package-first mode.

* Separate Gitlab API handling logic from vulntotal Gitlab datasource to utils file

Signed-off-by: Michael Ehab Mikhail <[email protected]>
* Use the GitLab API utils from vulntotal to support package-first mode.

Signed-off-by: Michael Ehab Mikhail <[email protected]>
@TG1999
Copy link
Contributor

TG1999 commented Jul 1, 2025

@michaelehab
Copy link
Collaborator Author

@TG1999 I modified the V2 importer as well

* Update Gitlab v2 importer to filter and process advisories relevant to the purl passed in the constructor

Signed-off-by: Michael Ehab Mikhail <[email protected]>
@michaelehab michaelehab force-pushed the 1903-gitlab-importer-package-first branch from a33f85b to c56e940 Compare July 4, 2025 15:29
@@ -31,6 +32,9 @@
from vulnerabilities.utils import build_description
from vulnerabilities.utils import get_advisory_url
from vulnerabilities.utils import get_cwe_id
from vulntotal.datasources.gitlab import get_casesensitive_slug
Copy link
Contributor

Choose a reason for hiding this comment

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

@keshav-space what do you think is it a good idea to import vulntotal functions in vcio ? Or shall we create separate functions here ?

Copy link
Contributor

@TG1999 TG1999 Jul 15, 2025

Choose a reason for hiding this comment

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

@michaelehab , also spdx license is missing in Gitlab vulntotal datasource. We need to have that before using it in our VCIO importers. https://github.com/aboutcode-org/vulnerablecode/blob/main/vulntotal/datasources/gitlab.py#L30

Copy link
Member

Choose a reason for hiding this comment

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

what do you think is it a good idea to import vulntotal functions in vcio ?

We can import it from VulnTotal for now. Later on we can extract these out in common utility.

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

Successfully merging this pull request may close these issues.

Modify the GitLab importer to support package-first mode
3 participants