Skip to content

Add CloudVulnDB importer for issue #1511#2217

Open
Tednoob17 wants to merge 22 commits into
aboutcode-org:mainfrom
Tednoob17:feat/cloudvulndb-importer
Open

Add CloudVulnDB importer for issue #1511#2217
Tednoob17 wants to merge 22 commits into
aboutcode-org:mainfrom
Tednoob17:feat/cloudvulndb-importer

Conversation

@Tednoob17
Copy link
Copy Markdown

Add a new v2 importer for CloudVulnDB from the public RSS feed.
Changes

  • add CloudVulnDB importe pipline
  • register the importer
  • add dedicated tests and fixture
  • ignore setup.py during pytest collection in Docker

Testing

  • dedicated CloudVulnDB tests passs in Docker
  • importer registration verified
  • Docker test collection no longer fails on setup.py

Copilot AI review requested due to automatic review settings March 15, 2026 00:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new v2 importer pipeline to ingest CloudVulnDB advisories from the project’s public RSS feed, along with fixtures/tests and a pytest configuration tweak to avoid collecting setup.py in Docker.

Changes:

  • Introduce CloudVulnDBImporterPipeline and RSS parsing helpers to produce AdvisoryDataV2.
  • Register the new importer in the central importer registry.
  • Add unit tests + RSS/XML and expected JSON fixtures; update pytest addopts to ignore setup.py during collection.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vulnerabilities/pipelines/v2_importers/cloudvulndb_importer.py New CloudVulnDB RSS-based v2 importer implementation.
vulnerabilities/importers/init.py Registers the new v2 importer in the importers registry.
vulnerabilities/tests/test_cloudvulndb_importer.py Adds unit tests for RSS parsing and advisory ID derivation.
vulnerabilities/tests/test_data/cloudvulndb/cloudvulndb_rss_mock.xml Adds mocked RSS fixture for deterministic tests.
vulnerabilities/tests/test_data/cloudvulndb/expected_cloudvulndb_advisory_output1.json Adds expected AdvisoryDataV2 JSON output fixture.
pyproject.toml Updates pytest collection options to ignore setup.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread vulnerabilities/pipelines/v2_importers/cloudvulndb_importer.py Outdated
Comment thread vulnerabilities/pipelines/v2_importers/cloudvulndb_importer.py
Comment thread vulnerabilities/pipelines/v2_importers/cloudvulndb_importer.py
Comment thread pyproject.toml
@Tednoob17 Tednoob17 force-pushed the feat/cloudvulndb-importer branch 2 times, most recently from 159276b to d964334 Compare March 18, 2026 09:07
Tednoob17 and others added 19 commits March 18, 2026 09:10
- add CloudVulnDB v2 importer pipeline
- register importer
- add tests and fixtures
- ignore setup.py in pytest collection

Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
…lines

Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Resolves: aboutcode-org#2186

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Resolves: aboutcode-org#2187

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tedsig42 <teddams047@gmail.com>
@Tednoob17 Tednoob17 force-pushed the feat/cloudvulndb-importer branch from 2be778e to ce44242 Compare March 18, 2026 09:10
Copy link
Copy Markdown
Collaborator

@ziadhany ziadhany left a comment

Choose a reason for hiding this comment

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

@Tednoob17 please fix the DOC, and see the comments below.

Comment on lines +112 to +113
cloudvulndb_importer_v2.CloudVulnDBImporterPipeline,
enisa_nisa_importer_v2.EnisaNisaImporterPipeline,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To keep things simple, let’s split each importer into its own PR, but we should first double-check the quality of the data source.

Comment thread pyproject.toml
Comment on lines +43 to +57
filterwarnings = [
"ignore:Unknown config option.*:pytest.PytestConfigWarning",
'ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated and scheduled for removal.*:DeprecationWarning',
"ignore:CheckConstraint.check is deprecated in favor of `.condition`.:django.utils.deprecation.RemovedInDjango60Warning",
]

addopts = [
"-rfExXw",
"--strict-markers",
"--doctest-modules",
# setup.py imports setuptools which is not available in the Docker runtime
# image. Without this, pytest (which uses python_files = "*.py") tries to
# collect setup.py as a test module and crashes with exit code 2.
"--ignore=setup.py",
"--ignore-glob=*/setup.py",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please avoid unrelated changes to the PR.

Comment on lines +24 to +37
class EnisaNisaImporterPipeline(VulnerableCodeBaseImporterPipelineV2):
"""
Import ENISA NISA advisories with tolerant parsing.

This parser is intentionally fault-tolerant: when version mapping is malformed,
it still extracts CVE aliases and URL references.
"""

pipeline_id = "enisa_nisa_importer_v2"
spdx_license_expression = "CC-BY-4.0"
license_url = "https://www.enisa.europa.eu/"
repo_url = "git+https://github.com/enisaeu/CNW"

precedence = 200
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We already have a PR for importing enisa:

Comment on lines +10 to +16
import io
import os
import shutil
import subprocess
import tarfile
import zipfile
from pathlib import Path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need to change this file? Is this vide-code? Please don't submit AI-generated code.

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.

5 participants