Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
15b2fc9
Add initial trivy config
srbouffard Jul 28, 2025
3b9eb2a
Add workflow trigger on dispatch
srbouffard Jul 28, 2025
74438eb
Add on push event
srbouffard Jul 28, 2025
19e82bd
Remove image-enabled config
srbouffard Jul 28, 2025
e45eebd
Updated with test integration tests branch
srbouffard Jul 28, 2025
e00130e
Remove image-enabled config
srbouffard Jul 28, 2025
438ceff
Try trivy fs scan
srbouffard Jul 28, 2025
b9588bf
Moved to simplified trivy fs scan
srbouffard Jul 28, 2025
81d2887
Remove ignore file
srbouffard Jul 28, 2025
4cb582c
Relax trivy constraints
srbouffard Jul 28, 2025
4305050
Add sbom gen
srbouffard Jul 28, 2025
a6151b3
fix condition
srbouffard Jul 28, 2025
0f80414
Enable push of results
srbouffard Jul 28, 2025
92e66b5
Fix artefact name
srbouffard Jul 28, 2025
22c0046
Add artefact upload of trivy scan
srbouffard Jul 28, 2025
51f46c9
Add known vul to trigger report
srbouffard Jul 28, 2025
ab56e9e
Update logic when job is triggered
srbouffard Jul 28, 2025
f475e7b
Add back branch for testing
srbouffard Jul 28, 2025
cae077b
Remove test config
srbouffard Jul 28, 2025
02051bd
Update trivy.yaml
srbouffard Jul 28, 2025
e15601c
Merge remote-tracking branch 'origin' into add-vulnurability-scan
yanksyoon Jul 29, 2025
4fb7aa7
Fix missing EOF
srbouffard Jul 29, 2025
45f4e4c
Update action tags to specific versions
srbouffard Aug 7, 2025
063a713
Merge branch 'main' into add-vulnurability-scan
srbouffard Aug 7, 2025
e7f4ecd
Add missing license header
srbouffard Aug 7, 2025
6a4ee75
Merge remote-tracking branch 'origin/main' into add-vulnurability-scan
srbouffard Aug 15, 2025
6e0e373
Add trivyignore
srbouffard Aug 15, 2025
b26ca7d
Create empty trivy when not present
srbouffard Aug 15, 2025
450b184
Remove local branch ref
srbouffard Aug 15, 2025
37c715c
Removed UPLOAD_RESULTS variable
srbouffard Aug 19, 2025
158d34a
Merge branch 'main' into add-vulnurability-scan
srbouffard Aug 19, 2025
e625899
Merge branch 'main' into add-vulnurability-scan
srbouffard 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
83 changes: 83 additions & 0 deletions .github/workflows/security_scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Security Scan

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
upload_results:
description: "Upload SARIF and SBOM results"
required: false
type: boolean
default: false

env:
# This value is used for push and pull_request triggers
UPLOAD_RESULTS: true

jobs:
trivy-scan:
name: Run Trivy Security Scan
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Trivy scan for logs
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
scan-ref: "."
trivy-config: "trivy.yaml"

- name: Run Trivy scan for SARIF report
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
scan-ref: "."
trivy-config: "trivy.yaml"
format: "sarif"
output: "trivy-results.sarif"

- name: Upload SARIF to GitHub Security tab
if: (github.event_name == 'workflow_dispatch' && inputs.upload_results == true) || (github.event_name != 'workflow_dispatch' && env.UPLOAD_RESULTS == 'true')
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"

- name: Upload diagnostic SARIF artifact
if: (github.event_name == 'workflow_dispatch' && inputs.upload_results == true) || (github.event_name != 'workflow_dispatch' && env.UPLOAD_RESULTS == 'true')
uses: actions/upload-artifact@v4
with:
name: sarif-report
path: "trivy-results.sarif"
retention-days: 7

generate-sbom:
name: Generate SBOM from Filesystem
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Trivy to generate SBOM
uses: aquasecurity/[email protected]
with:
scan-type: "fs"
scan-ref: "."
trivy-config: "trivy.yaml"
format: "spdx-json"
output: "dependency-results.sbom.json"
github-pat: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SBOM as an artifact
if: (github.event_name == 'workflow_dispatch' && inputs.upload_results == true) || (github.event_name != 'workflow_dispatch' && env.UPLOAD_RESULTS == 'true')
uses: actions/upload-artifact@v4
with:
name: sbom
path: "dependency-results.sbom.json"
retention-days: 7
13 changes: 13 additions & 0 deletions trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

timeout: 20m
severity:
- UNKNOWN
- LOW
- MEDIUM
- HIGH
- CRITICAL
vulnerability:
ignore-unfixed: false
exit-code: 0
Loading