From 6b069c3116df73b11e80d4df10d4983cc4e5280b Mon Sep 17 00:00:00 2001 From: Thomas Druez Date: Fri, 4 Nov 2022 18:34:37 +0400 Subject: [PATCH] Rename pipeline CheckVulnerabilities to FindVulnerabilities #101 Signed-off-by: Thomas Druez --- CHANGELOG.rst | 7 +------ docs/built-in-pipelines.rst | 16 ++++++++-------- ...ulnerabilities.py => find_vulnerabilities.py} | 4 ++-- scanpipe/tests/test_pipelines.py | 4 ++-- setup.cfg | 2 +- 5 files changed, 14 insertions(+), 19 deletions(-) rename scanpipe/pipelines/{check_vulnerabilities.py => find_vulnerabilities.py} (95%) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e9739afad..1fdcaa859 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,12 +4,7 @@ Changelog v31.1.0 (unreleased) -------------------- -- Add a new "inspect manifest" pipeline to resolve packages from manifest, lockfile, - and SBOM. The resolved packages are created as discovered packages. - Support PyPI "requirements.txt" files and AboutCode ".ABOUT" files - https://github.com/nexB/scancode.io/issues/284 - -- Add a new "check vulnerabilities" pipeline to lookup vulnerabilities in the +- Add a new "find vulnerabilities" pipeline to lookup vulnerabilities in the VulnerableCode database for all project discovered packages. Vulnerability data is stored in the extra_data field of each package. More details about VulnerableCode at https://github.com/nexB/vulnerablecode/ diff --git a/docs/built-in-pipelines.rst b/docs/built-in-pipelines.rst index 151f9f150..f36a2a3a5 100644 --- a/docs/built-in-pipelines.rst +++ b/docs/built-in-pipelines.rst @@ -15,14 +15,6 @@ Pipeline Base Class :members: :member-order: bysource -.. _pipeline_check_vulnerabilities: - -Check Vulnerabilities ---------------------- -.. autoclass:: scanpipe.pipelines.check_vulnerabilities.CheckVulnerabilities() - :members: - :member-order: bysource - .. _pipeline_docker: Docker Image Analysis @@ -39,6 +31,14 @@ Docker Windows Image Analysis :members: :member-order: bysource +.. _pipeline_find_vulnerabilities: + +Find Vulnerabilities +-------------------- +.. autoclass:: scanpipe.pipelines.find_vulnerabilities.FindVulnerabilities() + :members: + :member-order: bysource + .. _pipeline_inspect_manifest: Inspect Manifest diff --git a/scanpipe/pipelines/check_vulnerabilities.py b/scanpipe/pipelines/find_vulnerabilities.py similarity index 95% rename from scanpipe/pipelines/check_vulnerabilities.py rename to scanpipe/pipelines/find_vulnerabilities.py index c33e4fee8..df87351d2 100644 --- a/scanpipe/pipelines/check_vulnerabilities.py +++ b/scanpipe/pipelines/find_vulnerabilities.py @@ -24,9 +24,9 @@ from scanpipe.pipes import vulnerablecode -class CheckVulnerabilities(Pipeline): +class FindVulnerabilities(Pipeline): """ - A pipeline to check for discovered packages vulnerabilities in the VulnerableCode + A pipeline to find vulnerabilities for discovered packages in the VulnerableCode database. Vulnerability data is stored in the extra_data field of each package. diff --git a/scanpipe/tests/test_pipelines.py b/scanpipe/tests/test_pipelines.py index ce0a4ce31..14fde390d 100644 --- a/scanpipe/tests/test_pipelines.py +++ b/scanpipe/tests/test_pipelines.py @@ -586,10 +586,10 @@ def test_scanpipe_load_inventory_pipeline_integration_test(self): @mock.patch("scanpipe.pipes.vulnerablecode.is_available") @mock.patch("scanpipe.pipes.vulnerablecode.is_configured") @mock.patch("scanpipe.pipes.vulnerablecode.get_vulnerabilities_by_purl") - def test_scanpipe_check_vulnerabilities_pipeline_integration_test( + def test_scanpipe_find_vulnerabilities_pipeline_integration_test( self, mock_get_vulnerabilities, mock_is_configured, mock_is_available ): - pipeline_name = "check_vulnerabilities" + pipeline_name = "find_vulnerabilities" project1 = Project.objects.create(name="Analysis") package1 = DiscoveredPackage.create_from_data(project1, package_data1) diff --git a/setup.cfg b/setup.cfg index ccd60a616..b45c160e3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -107,7 +107,7 @@ console_scripts = scanpipe = scancodeio:command_line scancodeio_pipelines = - check_vulnerabilities = scanpipe.pipelines.check_vulnerabilities:CheckVulnerabilities + find_vulnerabilities = scanpipe.pipelines.find_vulnerabilities:FindVulnerabilities docker = scanpipe.pipelines.docker:Docker docker_windows = scanpipe.pipelines.docker_windows:DockerWindows inspect_manifest = scanpipe.pipelines.inspect_manifest:InspectManifest