Skip to content

Commit 015c984

Browse files
committed
Add GH workflow for Vuls
Signed-off-by: tdruez <[email protected]>
1 parent 944d960 commit 015c984

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Generate SBOM with Vuls and load into ScanCode.io
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
IMAGE_REFERENCE: "python:3.13.0-slim"
15+
16+
jobs:
17+
generate-and-load-sbom:
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
23+
- name: Start Python container
24+
run: |
25+
docker run -d --name sbom_target ${{ env.IMAGE_REFERENCE }} tail -f /dev/null
26+
27+
- name: Pull Vuls and dictionary images
28+
run: |
29+
docker pull vuls/vuls
30+
docker pull vuls/go-cve-dictionary
31+
docker pull vuls/goval-dictionary
32+
33+
- name: Prepare Vuls config.toml
34+
run: |
35+
cat > config.toml <<'EOF'
36+
[servers.sbom_target]
37+
host = "sbom_target"
38+
port = "local"
39+
containerType = "docker"
40+
containersIncluded = ["sbom_target"]
41+
EOF
42+
43+
- name: Fetch CVE Databases
44+
run: |
45+
mkdir -p ./vuls-data
46+
docker run --rm -v $PWD/vuls-data:/vuls vuls/go-cve-dictionary fetchnvd -dbpath=/vuls/cve.sqlite3
47+
docker run --rm -v $PWD/vuls-data:/vuls vuls/goval-dictionary fetch-debian -dbpath=/vuls/oval.sqlite3 12
48+
49+
- name: Run Vuls Scan
50+
run: |
51+
mkdir -p ./results
52+
docker run --rm \
53+
-v /var/run/docker.sock:/var/run/docker.sock \
54+
-v $PWD:/workdir \
55+
-w /workdir \
56+
vuls/vuls scan -config=./config.toml -results-dir=./results
57+
58+
- name: Upload Vuls report as GitHub Artifact
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: vuls-scan-report
62+
path: results
63+
retention-days: 20
64+

0 commit comments

Comments
 (0)