Skip to content

feat: Update GitHub actions jobs (#131) #75

feat: Update GitHub actions jobs (#131)

feat: Update GitHub actions jobs (#131) #75

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: trivy_image_scan
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
trivy_image_scan-cv-region-of-interest:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: trivy_image_scan-cv-region-of-interest
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
# cv-region-of-interest
- name: Build an image from Dockerfile
run: |
echo "running make build benchmark"
make cv-roi
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'rtsf-at-checkout/cv-region-of-interest:dev'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-cv-region-of-interest.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results-cv-region-of-interest.sarif'
trivy_image_scan-device-scale:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: trivy_image_scan-device-scale
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
# device-scale
- name: Build an image from Dockerfile
run: |
echo "running make build benchmark"
make device-scale
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'rtsf-at-checkout/device-scale:dev'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-device-scale.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results-device-scale.sarif'
trivy_image_scan-reconciler:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: trivy_image_scan-reconciler
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
# reconciler
- name: Build an image from Dockerfile
run: |
echo "running make build benchmark"
make reconciler
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'rtsf-at-checkout/event-reconciler:dev'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-reconciler.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results-reconciler.sarif'
trivy_image_scan-loss-detector:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: trivy_image_scan-loss-detector
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
# loss-detector
- name: Build an image from Dockerfile
run: |
echo "running make build benchmark"
make loss-detector
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'rtsf-at-checkout/loss-detector:dev'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-loss-detector.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results-loss-detector.sarif'
trivy_image_scan-product-lookup:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: trivy_image_scan-product-lookup
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
# product-lookup
- name: Build an image from Dockerfile
run: |
echo "running make build benchmark"
make product-lookup
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'rtsf-at-checkout/product-lookup:dev'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results-product-lookup.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/[email protected]
with:
sarif_file: 'trivy-results-product-lookup.sarif'