From 3b926f0deed58f197b466203fe591224fbce885d Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Feb 2022 12:06:00 -0500 Subject: add dbstore/sql/feed --- dbstore/sql/feed/insert-cve-desc.sql | 2 ++ dbstore/sql/feed/insert-cve-problem-desc.sql | 2 ++ dbstore/sql/feed/insert-cve-problem.sql | 2 ++ dbstore/sql/feed/insert-cve-ref-tag.sql | 2 ++ dbstore/sql/feed/insert-cve-ref.sql | 2 ++ dbstore/sql/feed/insert-cve.sql | 2 ++ dbstore/sql/feed/insert-desc.sql | 2 ++ dbstore/sql/feed/insert-item-cvss-v2.sql | 20 ++++++++++++++++++++ dbstore/sql/feed/insert-item-cvss-v3.sql | 14 ++++++++++++++ dbstore/sql/feed/insert-item.sql | 2 ++ dbstore/sql/feed/insert.sql | 2 ++ 11 files changed, 52 insertions(+) create mode 100644 dbstore/sql/feed/insert-cve-desc.sql create mode 100644 dbstore/sql/feed/insert-cve-problem-desc.sql create mode 100644 dbstore/sql/feed/insert-cve-problem.sql create mode 100644 dbstore/sql/feed/insert-cve-ref-tag.sql create mode 100644 dbstore/sql/feed/insert-cve-ref.sql create mode 100644 dbstore/sql/feed/insert-cve.sql create mode 100644 dbstore/sql/feed/insert-desc.sql create mode 100644 dbstore/sql/feed/insert-item-cvss-v2.sql create mode 100644 dbstore/sql/feed/insert-item-cvss-v3.sql create mode 100644 dbstore/sql/feed/insert-item.sql create mode 100644 dbstore/sql/feed/insert.sql (limited to 'dbstore/sql/feed') diff --git a/dbstore/sql/feed/insert-cve-desc.sql b/dbstore/sql/feed/insert-cve-desc.sql new file mode 100644 index 0000000..cf1f589 --- /dev/null +++ b/dbstore/sql/feed/insert-cve-desc.sql @@ -0,0 +1,2 @@ +-- insert CVE description +INSERT INTO cve_descriptions(cve_id, desc_id) VALUES (?, ?); diff --git a/dbstore/sql/feed/insert-cve-problem-desc.sql b/dbstore/sql/feed/insert-cve-problem-desc.sql new file mode 100644 index 0000000..5c7afad --- /dev/null +++ b/dbstore/sql/feed/insert-cve-problem-desc.sql @@ -0,0 +1,2 @@ +-- add description for cve problem type +INSERT INTO cve_problem_descriptions(cve_id, desc_id) VALUES (?, ?); diff --git a/dbstore/sql/feed/insert-cve-problem.sql b/dbstore/sql/feed/insert-cve-problem.sql new file mode 100644 index 0000000..be324aa --- /dev/null +++ b/dbstore/sql/feed/insert-cve-problem.sql @@ -0,0 +1,2 @@ +-- add cve problem type +INSERT INTO cve_problems(cve_id) VALUES (?); diff --git a/dbstore/sql/feed/insert-cve-ref-tag.sql b/dbstore/sql/feed/insert-cve-ref-tag.sql new file mode 100644 index 0000000..6bcdd7a --- /dev/null +++ b/dbstore/sql/feed/insert-cve-ref-tag.sql @@ -0,0 +1,2 @@ +-- add tag for cve reference +INSERT INTO cve_ref_tags(cve_ref_id, tag) VALUES (?, ?); diff --git a/dbstore/sql/feed/insert-cve-ref.sql b/dbstore/sql/feed/insert-cve-ref.sql new file mode 100644 index 0000000..35afe21 --- /dev/null +++ b/dbstore/sql/feed/insert-cve-ref.sql @@ -0,0 +1,2 @@ +-- insert cve reference +INSERT INTO cve_refs(cve_id, url, name, source) VALUES (?, ?, ?, ?); diff --git a/dbstore/sql/feed/insert-cve.sql b/dbstore/sql/feed/insert-cve.sql new file mode 100644 index 0000000..02c0a8a --- /dev/null +++ b/dbstore/sql/feed/insert-cve.sql @@ -0,0 +1,2 @@ +-- add cve +INSERT INTO cves(item_id, nvd_cve_id, assigner) VALUES (?, ?, ?); diff --git a/dbstore/sql/feed/insert-desc.sql b/dbstore/sql/feed/insert-desc.sql new file mode 100644 index 0000000..139056e --- /dev/null +++ b/dbstore/sql/feed/insert-desc.sql @@ -0,0 +1,2 @@ +-- add description +INSERT INTO descriptions(lang, value) VALUES (?, ?); diff --git a/dbstore/sql/feed/insert-item-cvss-v2.sql b/dbstore/sql/feed/insert-item-cvss-v2.sql new file mode 100644 index 0000000..01d91f8 --- /dev/null +++ b/dbstore/sql/feed/insert-item-cvss-v2.sql @@ -0,0 +1,20 @@ +-- add item CVSSv2 impact. +INSERT INTO item_cvss_v2_impacts ( + item_id, + v2_vector, + v2_base_score, + v2_severity_id, + v2_impact_score, + v2_expl_score, + v2_insufficient_info, + v2_obtain_all_priv, + v2_obtain_user_priv, + v2_obtain_other_priv, + v2_ui_req +) VALUES ( + ?, ?, ?, + (SELECT severity_id FROM severities WHERE name = ?), + ?, ?, ?, + ?, ?, ?, + ? +); diff --git a/dbstore/sql/feed/insert-item-cvss-v3.sql b/dbstore/sql/feed/insert-item-cvss-v3.sql new file mode 100644 index 0000000..c5af1fe --- /dev/null +++ b/dbstore/sql/feed/insert-item-cvss-v3.sql @@ -0,0 +1,14 @@ +-- add item CVSSv2 impact. +INSERT INTO item_cvss_v3_impacts ( + item_id, + v3_vector, + v3_base_score, + v2_severity_id, + v3_impact_score, + v3_expl_score +) VALUES ( + ?, ?, ?, + (SELECT severity_id FROM severities WHERE name = ?), + ?, + ? +); diff --git a/dbstore/sql/feed/insert-item.sql b/dbstore/sql/feed/insert-item.sql new file mode 100644 index 0000000..3508553 --- /dev/null +++ b/dbstore/sql/feed/insert-item.sql @@ -0,0 +1,2 @@ +-- add feed item +INSERT INTO feed_items(feed_id, published_at, modified_at) VALUES (?, ?, ?); diff --git a/dbstore/sql/feed/insert.sql b/dbstore/sql/feed/insert.sql new file mode 100644 index 0000000..73fb784 --- /dev/null +++ b/dbstore/sql/feed/insert.sql @@ -0,0 +1,2 @@ +-- add feed +INSERT INTO feeds(data_time) VALUES (?); -- cgit v1.2.3