-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
name: Data ingestion | ||
on: ["push", "workflow_dispatch"] | ||
jobs: | ||
test: | ||
data_ingestion: | ||
environment: glvd-data-ingestion | ||
name: data ingestion | ||
runs-on: ubuntu-latest | ||
env: | ||
PGHOST: "${{ vars.PGHOST }}" | ||
PGPORT: ${{ vars.PGPORT }} | ||
PGUSER: ${{ vars.PGUSER }} | ||
PGPASSWORD: ${{ secrets.PGPASSWORD }} | ||
PGDATABASE: ${{ vars.PGDATABASE }} | ||
steps: | ||
- run: | | ||
echo "${{ vars.PGDATABASE }}" | ||
echo "${{ vars.PGHOST }}" | ||
echo "${{ vars.PGPORT }}" | ||
echo "${{ vars.PGUSER }}" | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Prepare ingestion data | ||
run: ./src/prepare_ingestion.sh | ||
|
||
- name: Run glvd for data ingestion | ||
run: > | ||
docker run | ||
--network host | ||
--rm | ||
--mount="type=bind,src=$PWD/$GITHUB_ACTION_PATH/src,dst=/mnt/src,ro" | ||
--mount="type=bind,src=$PWD/$GITHUB_ACTION_PATH/ingest-debsec/,dst=/mnt/ingest-debsec,ro" | ||
--mount="type=bind,src=$PWD/$GITHUB_ACTION_PATH/ingest-debsrc/,dst=/mnt/ingest-debsrc,ro" | ||
--workdir=/mnt/src | ||
--entrypoint=/bin/bash | ||
--env PGHOST="$PGHOST" | ||
--env PGPORT="$PGPORT" | ||
--env PGUSER="$PGUSER" | ||
--env PGPASSWORD="$PGPASSWORD" | ||
--env PGDATABASE="$PGDATABASE" | ||
ghcr.io/gardenlinux/glvd:edge | ||
data_ingestion.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# --------- | ||
# Ingest NVD data | ||
#glvd-data ingest-nvd | ||
|
||
# --------- | ||
# Ingest CVE lists | ||
glvd-data ingest-debsec debian /mnt/ingest-debsec | ||
glvd-data ingest-debsec gardenlinux /mnt/ingest-debsec | ||
|
||
# --------- | ||
# Ingest Debian sources | ||
#glvd-data ingest-debsrc debian trixie /mnt/ingest-debsrc/debian_sources | ||
#glvd-data ingest-debsrc debian trixie /mnt/ingest-debsrc/gardenlinux_sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# Preparation | ||
apt update | ||
apt install -y wget | ||
|
||
|
||
mkdir ingest-debsrc/ | ||
|
||
# Data Ingestion: Deb Sec | ||
mkdir -p ingest-debsec/debian/CVE | ||
mkdir -p ingest-debsec/gardenlinux/CVE | ||
wget https://salsa.debian.org/security-tracker-team/security-tracker/-/raw/master/data/CVE/list?ref_type=heads -O ingest-debsec/debian/CVE/list | ||
cp -a data/CVE/list ingest-debsec/gardenlinux/CVE/list | ||
|
||
# Data Ingestion: Deb Src | ||
#wget http://ftp.debian.org/debian/dists/testing/main/source/ |