Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

trivy

trivy #81

Workflow file for this run

# Copyright 2025 The Secureblue Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
name: trivy-scan
permissions: {}
on:
schedule:
- cron: "00 8 * * *" # build at 8:00 UTC every day
# 120 minutes after secureblue images start building
push:
branches:
- live
paths-ignore:
- "**.md"
workflow_dispatch: # allow manually triggering builds
jobs:
build:
name: Trivy
if: github.triggering_actor == 'royaloughtness' || ${{ github.event_name == 'schedule' }} || ${{ github.event_name == 'push' }}
runs-on: ubuntu-24.04
permissions:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0
with:
image-ref: 'ghcr.io/secureblue/silverblue-main-hardened:latest'
format: template
scanners: vuln,secret,misconfig
template: '@/contrib/sarif.tpl'
output: trivy-results.sarif
timeout: 30m0s
skip-dirs: "/sysroot/ostree"
env:
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: trivy-results.sarif
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Trivy scan SARIF
path: trivy-results.sarif