Skip to content

[DPE-8301] Update mysql to 8.0.43 #22

[DPE-8301] Update mysql to 8.0.43

[DPE-8301] Update mysql to 8.0.43 #22

Workflow file for this run

# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
name: Trivy Security Scanner
on:
push:
branches:
- 8.0-22.04
pull_request:
permissions:
contents: read # Set the GITHUB_TOKEN permissions to read-only
jobs:
build:
name: Build rock
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v32.2.0
scan:
name: Trivy scan and SBOM Generation
needs: build
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install required dependencies
run: |
# rockcraft
sudo snap install rockcraft --classic --edge
# yq
sudo snap install yq
- name: Download rock package(s)
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.build.outputs.artifact-prefix }}-*
merge-multiple: true
- name: Import locally
run: |
full_version="$(yq .version rockcraft.yaml)"
sudo rockcraft.skopeo --insecure-policy copy \
"oci-archive:charmed-mysql_${full_version}_amd64.rock" \
"docker-daemon:trivy/charmed-mysql:test"
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "trivy/charmed-mysql:test"
format: "sarif"
output: "trivy-results.sarif"
severity: "MEDIUM,HIGH,CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: "trivy-results.sarif"
sbom:
name: Trivy SBOM and Dependency Upload
needs: scan
if: github.event_name == 'push'
runs-on: ubuntu-22.04
steps:
- name: Run Trivy in GitHub SBOM mode and submit to Dependency Graph
uses: aquasecurity/trivy-action@master
with:
scan-type: "image"
format: "spdx-json"
output: "dependency-results.sbom.json"
image-ref: "trivy/charmed-mysql:test"
github-pat: ${{ secrets.GITHUB_TOKEN }}
severity: "MEDIUM,HIGH,CRITICAL"
scanners: "vuln"
- name: Upload trivy report as a Github artifact
uses: actions/upload-artifact@v4
with:
name: trivy-sbom-report
path: "${{ github.workspace }}/dependency-results.sbom.json"
retention-days: 90