Skip to content

Commit 45b267d

Browse files
committed
Add sbom-test workflow
1 parent f57feb6 commit 45b267d

File tree

2 files changed

+64
-11
lines changed

2 files changed

+64
-11
lines changed

.github/workflows/sbom-test.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
name: SBOM Vulnerability Scanning
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
sbom:
9+
runs-on: ubuntu-22.04
10+
container:
11+
image: python:3.13-slim
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install Poetry and Tools
18+
run: |
19+
apt-get update && apt-get install -y curl
20+
curl -sSL https://install.python-poetry.org | python3 -
21+
export PATH="$HOME/.local/bin:$PATH"
22+
pip install cyclonedx-bom grype tabulate
23+
24+
- name: Install dependencies
25+
run: |
26+
export PATH="$HOME/.local/bin:$PATH"
27+
poetry install
28+
29+
# Generate SBOM in JSON
30+
- name: Generate SBOM (CycloneDX)
31+
run: |
32+
cyclonedx-py --format json --output sbom.json
33+
34+
# Convert SBOM JSON to CSV
35+
- name: Convert SBOM JSON to CSV
36+
run: |
37+
python .github/scripts/sbom_json_to_csv.py sbom.json sbom.csv
38+
39+
- name: Upload SBOM artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: sbom-files
43+
path: |
44+
sbom.json
45+
sbom.csv
46+
47+
# Scan SBOM for vulnerabilities
48+
- name: Scan SBOM for Vulnerabilities
49+
run: |
50+
grype sbom:sbom.json -o json > grype-report.json
51+
52+
# Convert Grype JSON to CSV
53+
- name: Convert Grype JSON to CSV
54+
run: |
55+
python .github/scripts/grype_json_to_csv.py grype-report.json grype-report.csv
56+
57+
- name: Upload Vulnerability Report
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: grype-report
61+
path: |
62+
grype-report.json

.github/workflows/sbom.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ env:
1818
jobs:
1919
deploy:
2020
name: Software Bill of Materials
21-
runs-on: ubuntu-22.04
22-
23-
container:
24-
image: python:3.13-slim
25-
21+
runs-on: ubuntu-latest
2622
permissions:
2723
actions: read
2824
contents: write
@@ -111,9 +107,4 @@ jobs:
111107
uses: actions/upload-artifact@v4
112108
with:
113109
name: sbom-packages
114-
path: sbom-packages-${{ github.event.repository.name }}.csv
115-
116-
- name: Debug Go version
117-
run: |
118-
go version
119-
go list std
110+
path: sbom-packages-${{ github.event.repository.name }}.csv

0 commit comments

Comments
 (0)