Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows #1401

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 0 additions & 65 deletions .github/workflows/codeql-analysis.yaml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/trivy-containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Trivy Scanner - Container Images
on:
push:
branches:
- master
paths:
- 'deploy/kubernetes/overlays/stable/gcr/kustomization.yaml'
schedule:
- cron: '0 */24 * * *'

jobs:
build-matrix:
runs-on: ubuntu-latest
outputs:
images: ${{ steps.set-matrix.outputs.result }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- id: set-matrix
uses: mikefarah/yq@master
with:
# Dynamically build the matrix of images to scan using `deploy/kubernetes/overlays/stable/gcr/kustomization.yaml`
# matrix format: ['k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.11.3', 'k8s.gcr.io/sig-storage/csi-attacher:v3.4.0', ...]
cmd: yq '.images | map(.name + ":" + .newTag) | . style="flow"' < deploy/kubernetes/overlays/stable/gcr/kustomization.yaml

trivy-scan:
needs: build-matrix
runs-on: ubuntu-latest
strategy:
matrix:
image: ${{ fromJson(needs.build-matrix.outputs.images) }}

steps:
- name: Scan container image
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ matrix.image }}'
output: 'results.sarif'
format: 'sarif'
ignore-unfixed: true
severity: 'HIGH,CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'results.sarif'
25 changes: 25 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Trivy Scanner
on:
pull-request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'results.sarif'
severity: 'HIGH,CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'results.sarif'