Bumps the all group with 5 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `4.1.2` | `4.1.3` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.3.1` | `4.3.2` | | [azure/setup-helm](https://github.com/azure/setup-helm) | `4.1.0` | `4.2.0` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.4` | `4.1.5` | | [github/codeql-action](https://github.com/github/codeql-action) | `3.24.10` | `3.25.1` | Updates `actions/checkout` from 4.1.2 to 4.1.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](9bb56186c3...1d96c772d1) Updates `actions/upload-artifact` from 4.3.1 to 4.3.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](5d5d22a312...1746f4ab65) Updates `azure/setup-helm` from 4.1.0 to 4.2.0 - [Release notes](https://github.com/azure/setup-helm/releases) - [Changelog](https://github.com/Azure/setup-helm/blob/main/CHANGELOG.md) - [Commits](b7246b12e7...fe7b79cd5e) Updates `actions/download-artifact` from 4.1.4 to 4.1.5 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](c850b930e6...8caf195ad4) Updates `github/codeql-action` from 3.24.10 to 3.25.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](4355270be1...c7f9125735)
92 lines
3.2 KiB
YAML
92 lines
3.2 KiB
YAML
# 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: Vulnerability Scan
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
schedule:
|
|
- cron: '00 9 * * 1'
|
|
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
|
|
jobs:
|
|
version:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
versions: ${{ steps.version.outputs.TAGS }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Latest Tag
|
|
id: version
|
|
shell: bash
|
|
run: |
|
|
readarray -t TAGS_ARRAY <<<"$(git tag --list 'controller-v*.*.*' --sort=-version:refname | grep -v 'beta\|alpha')"
|
|
FULL_TAGS=(${TAGS_ARRAY[0]} ${TAGS_ARRAY[1]} ${TAGS_ARRAY[2]})
|
|
SHORT_TAGS=()
|
|
for i in ${FULL_TAGS[@]}
|
|
do
|
|
echo "tag: $i"
|
|
short=$(echo "$i" | cut -d - -f 2)
|
|
SHORT_TAGS+=($short)
|
|
done
|
|
echo "${SHORT_TAGS[0]},${SHORT_TAGS[1]},${SHORT_TAGS[2]}"
|
|
TAGS_JSON="[\"${SHORT_TAGS[0]}\",\"${SHORT_TAGS[1]}\",\"${SHORT_TAGS[2]}\"]"
|
|
echo "${TAGS_JSON}"
|
|
echo "TAGS=${TAGS_JSON}" >> $GITHUB_OUTPUT
|
|
|
|
scan:
|
|
runs-on: ubuntu-latest
|
|
needs: version
|
|
strategy:
|
|
matrix:
|
|
versions: ${{ fromJSON(needs.version.outputs.versions) }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
|
|
|
|
- shell: bash
|
|
id: test
|
|
run: echo "Scanning registry.k8s.io/ingress-nginx/controller@${{ matrix.versions }}"
|
|
|
|
- name: Scan image with AquaSec/Trivy
|
|
id: scan
|
|
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 # v0.19.0
|
|
with:
|
|
image-ref: registry.k8s.io/ingress-nginx/controller:${{ matrix.versions }}
|
|
format: 'sarif'
|
|
output: trivy-results-${{ matrix.versions }}.sarif
|
|
exit-code: 0
|
|
vuln-type: 'os,library'
|
|
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'
|
|
|
|
- name: Output Sarif File
|
|
shell: bash
|
|
run: cat ${{ github.workspace }}/trivy-results-${{ matrix.versions }}.sarif
|
|
|
|
# This step checks out a copy of your repository.
|
|
- name: Upload SARIF file
|
|
uses: github/codeql-action/upload-sarif@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1
|
|
with:
|
|
token: ${{ github.token }}
|
|
# Path to SARIF file relative to the root of the repository
|
|
sarif_file: ${{ github.workspace }}/trivy-results-${{ matrix.versions }}.sarif
|
|
|
|
- name: Vulz Count
|
|
shell: bash
|
|
run: |
|
|
TRIVY_COUNT=$(cat ${{ github.workspace }}/trivy-results-${{ matrix.versions }}.sarif | jq '.runs[0].results | length')
|
|
echo "TRIVY_COUNT: $TRIVY_COUNT"
|
|
echo "Image Vulnerability scan output" >> $GITHUB_STEP_SUMMARY
|
|
echo "Image ID: registry.k8s.io/ingress-nginx/controller@${{ matrix.versions }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Trivy Count: $TRIVY_COUNT" >> $GITHUB_STEP_SUMMARY
|