Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cvss #12

Merged
merged 3 commits into from
Sep 18, 2024
Merged

Cvss #12

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions extra-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,40 @@ CREATE OR REPLACE VIEW public.sourcepackagecve
dist_cpe.cpe_version AS gardenlinux_version,
deb_cve.debsec_vulnerable AS is_vulnerable,
all_cve.data ->> 'published'::text AS cve_published_date,
CASE
WHEN (data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'baseScore')::numeric IS NOT NULL THEN
(data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'baseScore')::numeric
WHEN (data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'baseScore')::numeric IS NOT NULL THEN
(data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'baseScore')::numeric
WHEN (data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'baseScore')::numeric IS NOT NULL THEN
(data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'baseScore')::numeric
WHEN (data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'baseScore')::numeric IS NOT NULL THEN
(data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'baseScore')::numeric
END AS base_score,
CASE
WHEN (data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'vectorString')::text IS NOT NULL THEN
(data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'vectorString')::text
WHEN (data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'vectorString')::text IS NOT NULL THEN
(data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'vectorString')::text
WHEN (data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'vectorString')::text IS NOT NULL THEN
(data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'vectorString')::text
WHEN (data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'vectorString')::text IS NOT NULL THEN
(data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'vectorString')::text
END AS vector_string,
(data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'baseScore')::numeric AS base_score_v40,
(data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'baseScore')::numeric AS base_score_v31,
(data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'baseScore')::numeric AS base_score_v30,
(data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'baseScore')::numeric AS base_score_v2,
(data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'vectorString')::text AS vector_string_v40,
(data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'vectorString')::text AS vector_string_v31,
(data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'vectorString')::text AS vector_string_v30
(data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'vectorString')::text AS vector_string_v30,
(data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'vectorString')::text AS vector_string_v2
FROM all_cve
JOIN deb_cve USING (cve_id)
JOIN dist_cpe ON deb_cve.dist_id = dist_cpe.id
WHERE dist_cpe.cpe_product = 'gardenlinux'::text
ORDER BY all_cve.cve_id;
WHERE
dist_cpe.cpe_product = 'gardenlinux'::text AND
deb_cve.debsec_vulnerable = TRUE;

ALTER TABLE public.sourcepackagecve
OWNER TO glvd;
Expand Down