Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c037b25
Add GH workflow to generate SBOM with Trivy #1729
tdruez Aug 15, 2025
b07efe7
Refine the args for the trivy-action #1729
tdruez Aug 18, 2025
1c06d3d
Fix the path for upload #1729
tdruez Aug 18, 2025
5dc7125
Adjust the trivy workflow #1729
tdruez Aug 18, 2025
fdf5bc7
Use a smaller image as input #1729
tdruez Aug 18, 2025
033e180
Load the Trivy SBOM into SCIO #1729
tdruez Aug 18, 2025
3b1a354
Update the inputs-path #1729
tdruez Aug 18, 2025
4efd1d2
Add support for vulnerabilities in load_sbom pipeline #1729
tdruez Aug 18, 2025
caaebf0
Test running scanpipe for checking the loaded content #1729
tdruez Aug 18, 2025
3359dbc
Test running scanpipe for checking the loaded content #1729
tdruez Aug 18, 2025
3ade026
Use the file-as-inputs-path branch #1729
tdruez Aug 19, 2025
0956cc2
Fix #1729
tdruez Aug 19, 2025
b479775
Add proper assertionf or validation of the workflow #1729
tdruez Aug 19, 2025
d258b1c
Fix syntax as single line #1729
tdruez Aug 19, 2025
efe91c1
Fix syntax #1729
tdruez Aug 19, 2025
1f033ed
Move back at the root #1729
tdruez Aug 19, 2025
057ce04
debug #1729
tdruez Aug 19, 2025
7a025ce
Use scancodeio-repo-branch for vuln loading
tdruez Aug 19, 2025
555408a
Add assertion on create dependencies
tdruez Aug 19, 2025
5b69e6a
Run once a week (every 7 days) at 00:00 UTC on Sunday
tdruez Aug 19, 2025
2c93e1d
Refine workflow and documentation
tdruez Aug 19, 2025
960a85c
Fix indentation
tdruez Aug 19, 2025
4edb23e
Merge main and fix conflicts #1729
tdruez Aug 19, 2025
ddb7b41
Generate a test SBOM for alpine:3.17.0 #1729
tdruez Aug 19, 2025
d16b63d
Restore the workflow using python:3.13.0-slim #1729
tdruez Aug 19, 2025
3c55d5a
Add unit test for the Trivy integration SBOM support #1729
tdruez Aug 19, 2025
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
53 changes: 53 additions & 0 deletions .github/workflows/sca-integration-trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Generate SBOM with Trivy and load into ScanCode.io

# This workflow:
# 1. Generates a CycloneDX SBOM for a container image using Trivy.
# 2. Uploads the SBOM as a GitHub artifact for future inspection.
# 3. Loads the SBOM into ScanCode.io for further analysis.
# 4. Runs assertions to verify that the SBOM was properly processed in ScanCode.io.
#
# It runs on demand, and once a week (scheduled).

on:
workflow_dispatch:
schedule:
# Run once a week (every 7 days) at 00:00 UTC on Sunday
- cron: "0 0 * * 0"

permissions:
contents: read

env:
IMAGE_REFERENCE: "python:3.13.0-slim"

jobs:
generate-and-load-sbom:
runs-on: ubuntu-24.04
steps:
- name: Generate CycloneDX SBOM with Trivy
uses: aquasecurity/[email protected]
with:
scan-type: "image"
image-ref: ${{ env.IMAGE_REFERENCE }}
format: "cyclonedx"
output: "trivy-report.sbom.json"
scanners: "vuln,license"
version: "latest"

- name: Upload SBOM as GitHub Artifact
uses: actions/upload-artifact@v4
with:
name: trivy-sbom-report
path: "trivy-report.sbom.json"
retention-days: 20

- name: Import SBOM into ScanCode.io
uses: aboutcode-org/scancode-action@main
with:
pipelines: "load_sbom"
inputs-path: "trivy-report.sbom.json"

- name: Verify SBOM Analysis Results in ScanCode.io
shell: bash
run: |
scanpipe shell --command "from scanpipe.models import DiscoveredPackage, DiscoveredDependency; package_manager = DiscoveredPackage.objects; assert package_manager.count() > 90; assert package_manager.vulnerable().count() > 40; assert DiscoveredDependency.objects.count() > 190"
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
]
}
]
}
}
Loading