Skip to content

Merge pull request #7096 from MartinForReal/shafan/client57 #7067

Merge pull request #7096 from MartinForReal/shafan/client57

Merge pull request #7096 from MartinForReal/shafan/client57 #7067

Workflow file for this run

name: Trivy scanner
on:
workflow_dispatch:
push:
branches: [ master, 'release-**' ]
paths:
- '.github/workflows/trivy.yaml'
- 'pkg/**.go'
- '!kubetest2-aks/**.go'
- 'cmd/**.go'
- 'go.*'
- '!vendor/**'
- 'health-probe-proxy/**'
pull_request:
branches: [ master, 'release-**' ]
paths:
- '.github/workflows/trivy.yaml'
- 'pkg/**.go'
- '!kubetest2-aks/**.go'
- 'cmd/**.go'
- 'go.*'
- '!vendor/**'
- 'health-probe-proxy/**'
schedule:
- cron: '0 */24 * * *'
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for sbom
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Build
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go 1.x
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '>=1.20'
check-latest: true
id: go
- name: Build images
run: |
export TAG=${{ github.sha }}
export IMAGE_TAG=${{ github.sha }}
make build-ccm-image
make build-node-image-linux-amd64
cd health-probe-proxy && make build-health-probe-proxy-image && cd ..
- name: Run Trivy scanner CCM
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
image-ref: 'local/azure-cloud-controller-manager:${{ github.sha }}'
format: 'sarif'
output: 'trivy-ccm-results.sarif'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
with:
sarif_file: 'trivy-ccm-results.sarif'
category: azure-cloud-controller-manager-image
- name: Run Trivy scanner CNM
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
image-ref: 'local/azure-cloud-node-manager:${{ github.sha }}-linux-amd64'
format: 'sarif'
output: 'trivy-cnm-linux-results.sarif'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
with:
sarif_file: 'trivy-cnm-linux-results.sarif'
category: azure-cloud-node-manager-linux-image
- name: Run Trivy scanner health-probe-proxy
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
image-ref: 'local/health-probe-proxy:${{ github.sha }}'
format: 'sarif'
output: 'trivy-health-probe-proxy-linux-results.sarif'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
with:
sarif_file: 'trivy-health-probe-proxy-linux-results.sarif'
category: health-probe-proxy-linux-image
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # master
with:
scan-type: 'fs'
format: 'github'
output: 'dependency-results.sbom.json'
scan-ref: '.'
github-pat: ${{ secrets.GITHUB_TOKEN }}