Skip to content

Commit

Permalink
create view sourcepackagecve
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Sep 10, 2024
1 parent b9c6ad3 commit 4ae4514
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ingest-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ jobs:
- name: Ingest Data
run: /usr/local/src/ingest-postgres.sh

- name: Dump Database Snapshot
run: |
- run: |
echo "$PGHOST:$PGPORT:$PGDATABASE:$PGUSER:$PGPASSWORD" > ~/.pgpass
chmod 0600 ~/.pgpass
- run: psql glvd -f extra-schema.sql

- name: Dump Database Snapshot
run: |
pg_dump -h postgres -p 5432 -U glvd glvd > glvd.sql
- uses: actions/upload-artifact@v4
Expand Down
22 changes: 22 additions & 0 deletions extra-schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- View: public.sourcepackagecve

-- DROP VIEW public.sourcepackagecve;

CREATE OR REPLACE VIEW public.sourcepackagecve
AS
SELECT ((all_cve.cve_id || deb_cve.deb_source) || deb_cve.deb_version::text) || dist_cpe.cpe_version AS my_id,
all_cve.cve_id,
deb_cve.deb_source AS source_package_name,
deb_cve.deb_version AS source_package_version,
dist_cpe.cpe_version AS gardenlinux_version,
deb_cve.debsec_vulnerable AS is_vulnerable,
all_cve.data ->> 'published'::text AS cve_published_date
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;

ALTER TABLE public.sourcepackagecve
OWNER TO glvd;

0 comments on commit 4ae4514

Please sign in to comment.