|
33 | 33 | from vulnerabilities.importers import ubuntu_usn |
34 | 34 | from vulnerabilities.importers import vulnrichment |
35 | 35 | from vulnerabilities.importers import xen |
36 | | -from vulnerabilities.pipelines import VulnerableCodeBaseImporterPipeline |
37 | | -from vulnerabilities.pipelines import VulnerableCodeBaseImporterPipelineV2 |
38 | 36 | from vulnerabilities.pipelines import alpine_linux_importer |
39 | 37 | from vulnerabilities.pipelines import github_importer |
40 | 38 | from vulnerabilities.pipelines import gitlab_importer |
|
51 | 49 | from vulnerabilities.pipelines.v2_importers import pypa_importer as pypa_importer_v2 |
52 | 50 | from vulnerabilities.pipelines.v2_importers import pysec_importer as pysec_importer_v2 |
53 | 51 | from vulnerabilities.pipelines.v2_importers import vulnrichment_importer as vulnrichment_importer_v2 |
| 52 | +from vulnerabilities.utils import create_registry |
54 | 53 |
|
55 | | -IMPORTERS_REGISTRY = [ |
56 | | - nvd_importer_v2.NVDImporterPipeline, |
57 | | - github_importer_v2.GitHubAPIImporterPipeline, |
58 | | - npm_importer_v2.NpmImporterPipeline, |
59 | | - vulnrichment_importer_v2.VulnrichImporterPipeline, |
60 | | - apache_httpd_v2.ApacheHTTPDImporterPipeline, |
61 | | - pypa_importer_v2.PyPaImporterPipeline, |
62 | | - gitlab_importer_v2.GitLabImporterPipeline, |
63 | | - pysec_importer_v2.PyPIImporterPipeline, |
64 | | - nvd_importer.NVDImporterPipeline, |
65 | | - github_importer.GitHubAPIImporterPipeline, |
66 | | - gitlab_importer.GitLabImporterPipeline, |
67 | | - github_osv.GithubOSVImporter, |
68 | | - pypa_importer.PyPaImporterPipeline, |
69 | | - npm_importer.NpmImporterPipeline, |
70 | | - nginx_importer.NginxImporterPipeline, |
71 | | - pysec_importer.PyPIImporterPipeline, |
72 | | - apache_tomcat.ApacheTomcatImporter, |
73 | | - postgresql.PostgreSQLImporter, |
74 | | - debian.DebianImporter, |
75 | | - curl.CurlImporter, |
76 | | - epss.EPSSImporter, |
77 | | - vulnrichment.VulnrichImporter, |
78 | | - alpine_linux_importer.AlpineLinuxImporterPipeline, |
79 | | - ruby.RubyImporter, |
80 | | - apache_kafka.ApacheKafkaImporter, |
81 | | - openssl.OpensslImporter, |
82 | | - redhat.RedhatImporter, |
83 | | - archlinux.ArchlinuxImporter, |
84 | | - ubuntu.UbuntuImporter, |
85 | | - debian_oval.DebianOvalImporter, |
86 | | - retiredotnet.RetireDotnetImporter, |
87 | | - apache_httpd.ApacheHTTPDImporter, |
88 | | - mozilla.MozillaImporter, |
89 | | - gentoo.GentooImporter, |
90 | | - istio.IstioImporter, |
91 | | - project_kb_msr2019.ProjectKBMSRImporter, |
92 | | - suse_scores.SUSESeverityScoreImporter, |
93 | | - elixir_security.ElixirSecurityImporter, |
94 | | - xen.XenImporter, |
95 | | - ubuntu_usn.UbuntuUSNImporter, |
96 | | - fireeye.FireyeImporter, |
97 | | - oss_fuzz.OSSFuzzImporter, |
98 | | -] |
99 | | - |
100 | | -IMPORTERS_REGISTRY = { |
101 | | - x.pipeline_id |
102 | | - if issubclass(x, VulnerableCodeBaseImporterPipeline) |
103 | | - or issubclass(x, VulnerableCodeBaseImporterPipelineV2) |
104 | | - else x.qualified_name: x |
105 | | - for x in IMPORTERS_REGISTRY |
106 | | -} |
| 54 | +IMPORTERS_REGISTRY = create_registry( |
| 55 | + [ |
| 56 | + nvd_importer_v2.NVDImporterPipeline, |
| 57 | + github_importer_v2.GitHubAPIImporterPipeline, |
| 58 | + npm_importer_v2.NpmImporterPipeline, |
| 59 | + vulnrichment_importer_v2.VulnrichImporterPipeline, |
| 60 | + apache_httpd_v2.ApacheHTTPDImporterPipeline, |
| 61 | + pypa_importer_v2.PyPaImporterPipeline, |
| 62 | + gitlab_importer_v2.GitLabImporterPipeline, |
| 63 | + pysec_importer_v2.PyPIImporterPipeline, |
| 64 | + nvd_importer.NVDImporterPipeline, |
| 65 | + github_importer.GitHubAPIImporterPipeline, |
| 66 | + gitlab_importer.GitLabImporterPipeline, |
| 67 | + github_osv.GithubOSVImporter, |
| 68 | + pypa_importer.PyPaImporterPipeline, |
| 69 | + npm_importer.NpmImporterPipeline, |
| 70 | + nginx_importer.NginxImporterPipeline, |
| 71 | + pysec_importer.PyPIImporterPipeline, |
| 72 | + apache_tomcat.ApacheTomcatImporter, |
| 73 | + postgresql.PostgreSQLImporter, |
| 74 | + debian.DebianImporter, |
| 75 | + curl.CurlImporter, |
| 76 | + epss.EPSSImporter, |
| 77 | + vulnrichment.VulnrichImporter, |
| 78 | + alpine_linux_importer.AlpineLinuxImporterPipeline, |
| 79 | + ruby.RubyImporter, |
| 80 | + apache_kafka.ApacheKafkaImporter, |
| 81 | + openssl.OpensslImporter, |
| 82 | + redhat.RedhatImporter, |
| 83 | + archlinux.ArchlinuxImporter, |
| 84 | + ubuntu.UbuntuImporter, |
| 85 | + debian_oval.DebianOvalImporter, |
| 86 | + retiredotnet.RetireDotnetImporter, |
| 87 | + apache_httpd.ApacheHTTPDImporter, |
| 88 | + mozilla.MozillaImporter, |
| 89 | + gentoo.GentooImporter, |
| 90 | + istio.IstioImporter, |
| 91 | + project_kb_msr2019.ProjectKBMSRImporter, |
| 92 | + suse_scores.SUSESeverityScoreImporter, |
| 93 | + elixir_security.ElixirSecurityImporter, |
| 94 | + xen.XenImporter, |
| 95 | + ubuntu_usn.UbuntuUSNImporter, |
| 96 | + fireeye.FireyeImporter, |
| 97 | + oss_fuzz.OSSFuzzImporter, |
| 98 | + ] |
| 99 | +) |
0 commit comments