Skip to content

Commit 3e213e6

Browse files
committed
Drop pipelines that doesn't have CVE- id in issue/pr
Use the VulnerableCodeBaseImporterPipelineV2 for collection Signed-off-by: ziad hany <ziadhany2016@gmail.com>
1 parent af0bdc1 commit 3e213e6

File tree

3 files changed

+34
-50
lines changed

3 files changed

+34
-50
lines changed

vulnerabilities/importers/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,8 @@
211211
collect_issue_pr_v2.CollectRailsPRSIssuesPipeline,
212212
collect_issue_pr_v2.CollectReactPRSIssuesPipeline,
213213
collect_issue_pr_v2.CollectAngularPRSIssuesPipeline,
214-
collect_issue_pr_v2.CollectWordpressPRSIssuesPipeline,
215214
collect_issue_pr_v2.CollectDockerMobyPRSIssuesPipeline,
216215
collect_issue_pr_v2.CollectKubernetesPRSIssuesPipeline,
217-
collect_issue_pr_v2.CollectXenProjectPRSIssuesPipeline,
218-
collect_issue_pr_v2.CollectVirtualboxPRSIssuesPipeline,
219216
collect_issue_pr_v2.CollectContainerdPRSIssuesPipeline,
220217
collect_issue_pr_v2.CollectAnsiblePRSIssuesPipeline,
221218
collect_issue_pr_v2.CollectTerraformPRSIssuesPipeline,

vulnerabilities/pipelines/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def collect_and_store_advisories(self):
347347
self.log(f"Successfully collected {collected_advisory_count:,d} advisories")
348348

349349

350-
class VCSCollector(VulnerableCodeBaseImporterPipeline):
350+
class VCSCollector(VulnerableCodeBaseImporterPipelineV2):
351351
"""
352352
Pipeline to collect GitHub/GitLab issues and PRs related to vulnerabilities.
353353
"""
@@ -417,7 +417,8 @@ def collect_items(self):
417417
for item in items:
418418
matches = self.CVE_PATTERN.findall(item.title + " " + (item.body or ""))
419419
for match in matches:
420-
self.collected_items[match].append(("Issue", item.html_url))
420+
cve_id = match.upper()
421+
self.collected_items[cve_id].append(("Issue", item.html_url))
421422

422423

423424
class GitLabCollector(VCSCollector):
@@ -438,5 +439,6 @@ def collect_items(self):
438439
description = item.get("description") or ""
439440
matches = self.CVE_PATTERN.findall(title + " " + description)
440441
for match in matches:
442+
cve_id = match.upper()
441443
url = item.get("web_url")
442-
self.collected_items[match].append((i_type, url))
444+
self.collected_items[cve_id].append((i_type, url))

vulnerabilities/pipelines/v2_importers/collect_issue_pr.py

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,160 +12,145 @@
1212

1313

1414
class CollectBusyBoxPRSIssuesPipeline(GitHubCollector):
15-
pipeline_id = "collect_busybox_prs-issues"
15+
pipeline_id = "collect-busybox-prs-issues"
1616
repo_url = "https://github.com/mirror/busybox"
1717

1818

1919
class CollectNginxPRSIssuesPipeline(GitHubCollector):
20-
pipeline_id = "collect_nginx_prs-issues"
20+
pipeline_id = "collect-nginx-prs-issues"
2121
repo_url = "https://github.com/nginx/nginx"
2222

2323

2424
class CollectApacheTomcatPRSIssuesPipeline(GitHubCollector):
25-
pipeline_id = "collect_apache_tomcat_prs-issues"
25+
pipeline_id = "collect-apache-tomcat-prs-issues"
2626
repo_url = "https://github.com/apache/tomcat"
2727

2828

2929
class CollectMongodbPRSIssuesPipeline(GitHubCollector):
30-
pipeline_id = "collect_mongodb_prs-issues"
30+
pipeline_id = "collect-mongodb-prs-issues"
3131
repo_url = "https://github.com/mongodb/mongo"
3232

3333

3434
class CollectRedisPRSIssuesPipeline(GitHubCollector):
35-
pipeline_id = "collect_redis_prs-issues"
35+
pipeline_id = "collect-redis-prs-issues"
3636
repo_url = "https://github.com/redis/redis"
3737

3838

3939
class CollectPhpPRSIssuesPipeline(GitHubCollector):
40-
pipeline_id = "collect_php_prs-issues"
40+
pipeline_id = "collect-php-prs-issues"
4141
repo_url = "https://github.com/php/php-src"
4242

4343

4444
class CollectPythonCpythonPRSIssuesPipeline(GitHubCollector):
45-
pipeline_id = "collect_python_cpython_prs-issues"
45+
pipeline_id = "collect-python-cpython-prs-issues"
4646
repo_url = "https://github.com/python/cpython"
4747

4848

4949
class CollectRubyPRSIssuesPipeline(GitHubCollector):
50-
pipeline_id = "collect_ruby_prs-issues"
50+
pipeline_id = "collect-ruby-prs-issues"
5151
repo_url = "https://github.com/ruby/ruby"
5252

5353

5454
class CollectGoPRSIssuesPipeline(GitHubCollector):
55-
pipeline_id = "collect_go_prs-issues"
55+
pipeline_id = "collect-go-prs-issues"
5656
repo_url = "https://github.com/golang/go"
5757

5858

5959
class CollectNodeJsPRSIssuesPipeline(GitHubCollector):
60-
pipeline_id = "collect_node_js_prs-issues"
60+
pipeline_id = "collect-node-js-prs-issues"
6161
repo_url = "https://github.com/nodejs/node"
6262

6363

6464
class CollectRustPRSIssuesPipeline(GitHubCollector):
65-
pipeline_id = "collect_rust_prs-issues"
65+
pipeline_id = "collect-rust-prs-issues"
6666
repo_url = "https://github.com/rust-lang/rust"
6767

6868

6969
class CollectOpenjdkPRSIssuesPipeline(GitHubCollector):
70-
pipeline_id = "collect_openjdk_prs-issues"
70+
pipeline_id = "collect-openjdk-prs-issues"
7171
repo_url = "https://github.com/openjdk/jdk"
7272

7373

7474
class CollectSwiftPRSIssuesPipeline(GitHubCollector):
75-
pipeline_id = "collect_swift_prs-issues"
75+
pipeline_id = "collect-swift-prs-issues"
7676
repo_url = "https://github.com/swiftlang/swift"
7777

7878

7979
class CollectDjangoPRSIssuesPipeline(GitHubCollector):
80-
pipeline_id = "collect_django_prs-issues"
80+
pipeline_id = "collect-django-prs-issues"
8181
repo_url = "https://github.com/django/django"
8282

8383

8484
class CollectRailsPRSIssuesPipeline(GitHubCollector):
85-
pipeline_id = "collect_rails_prs-issues"
85+
pipeline_id = "collect-rails-prs-issues"
8686
repo_url = "https://github.com/rails/rails"
8787

8888

8989
class CollectLaravelPRSIssuesPipeline(GitHubCollector):
90-
pipeline_id = "collect_laravel_prs-issues"
90+
pipeline_id = "collect-laravel-prs-issues"
9191
repo_url = "https://github.com/laravel/framework"
9292

9393

9494
class CollectSpringFrameworkPRSIssuesPipeline(GitHubCollector):
95-
pipeline_id = "collect_spring_framework_prs-issues"
95+
pipeline_id = "collect-spring-framework-prs-issues"
9696
repo_url = "https://github.com/spring-projects/spring-framework"
9797

9898

9999
class CollectReactPRSIssuesPipeline(GitHubCollector):
100-
pipeline_id = "collect_react_prs-issues"
100+
pipeline_id = "collect-react-prs-issues"
101101
repo_url = "https://github.com/facebook/react"
102102

103103

104104
class CollectAngularPRSIssuesPipeline(GitHubCollector):
105-
pipeline_id = "collect_angular_prs-issues"
105+
pipeline_id = "collect-angular-prs-issues"
106106
repo_url = "https://github.com/angular/angular"
107107

108108

109-
class CollectWordpressPRSIssuesPipeline(GitHubCollector):
110-
pipeline_id = "collect_wordpress_prs-issues"
111-
repo_url = "https://github.com/WordPress/WordPress"
112-
113-
114109
class CollectDockerMobyPRSIssuesPipeline(GitHubCollector):
115-
pipeline_id = "collect_docker_moby_prs-issues"
110+
pipeline_id = "collect-docker-moby-prs-issues"
116111
repo_url = "https://github.com/moby/moby"
117112

118113

119114
class CollectKubernetesPRSIssuesPipeline(GitHubCollector):
120-
pipeline_id = "collect_kubernetes_prs-issues"
115+
pipeline_id = "collect-kubernetes-prs-issues"
121116
repo_url = "https://github.com/kubernetes/kubernetes"
122117

123118

124-
class CollectXenProjectPRSIssuesPipeline(GitHubCollector):
125-
pipeline_id = "collect_xen_project_prs-issues"
126-
repo_url = "https://github.com/xen-project/xen"
127-
128-
129-
class CollectVirtualboxPRSIssuesPipeline(GitHubCollector):
130-
pipeline_id = "collect_virtualbox_prs-issues"
131-
repo_url = "https://github.com/mirror/vbox"
132-
133-
134119
class CollectContainerdPRSIssuesPipeline(GitHubCollector):
135-
pipeline_id = "collect_containerd_prs-issues"
120+
pipeline_id = "collect-containerd-prs-issues"
136121
repo_url = "https://github.com/containerd/containerd"
137122

138123

139124
class CollectAnsiblePRSIssuesPipeline(GitHubCollector):
140-
pipeline_id = "collect_ansible_prs-issues"
125+
pipeline_id = "collect-ansible-prs-issues"
141126
repo_url = "https://github.com/ansible/ansible"
142127

143128

144129
class CollectTerraformPRSIssuesPipeline(GitHubCollector):
145-
pipeline_id = "collect_terraform_prs-issues"
130+
pipeline_id = "collect-terraform-prs-issues"
146131
repo_url = "https://github.com/hashicorp/terraform"
147132

148133

149134
class CollectTcpdumpPRSIssuesPipeline(GitHubCollector):
150-
pipeline_id = "collect_tcpdump_prs-issues"
135+
pipeline_id = "collect-tcpdump-prs-issues"
151136
repo_url = "https://github.com/the-tcpdump-group/tcpdump"
152137

153138

154139
class CollectJenkinsPRSIssuesPipeline(GitHubCollector):
155-
pipeline_id = "collect_jenkins_prs-issues"
140+
pipeline_id = "collect-jenkins_prs-issues"
156141
repo_url = "https://github.com/jenkinsci/jenkins"
157142

158143

159144
class CollectGitlabPRSIssuesPipeline(GitLabCollector):
160-
pipeline_id = "collect_gitlab_prs-issues"
145+
pipeline_id = "collect-gitlab-prs-issues"
161146
repo_url = "https://gitlab.com/gitlab-org/gitlab-foss"
162147

163148

164149
class CollectWiresharkPRSIssuesPipeline(GitLabCollector):
165-
pipeline_id = "collect_wireshark_prs-issues"
150+
pipeline_id = "collect-wireshark-prs-issues"
166151
repo_url = "https://gitlab.com/wireshark/wireshark"
167152

168153

169154
class CollectQemuPRSIssuesPipeline(GitLabCollector):
170-
pipeline_id = "collect_qemu_prs-issues"
155+
pipeline_id = "collect-qemu-prs-issues"
171156
repo_url = "https://gitlab.com/qemu-project/qemu"

0 commit comments

Comments
 (0)