feat(deps): update helm release argo-cd to v7.8.0 (#1034) #184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- '.github/workflows/trivy-scans.yaml' | |
- 'platform-apps/charts/image-list.md' | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- '.github/workflows/trivy-scans.yaml' | |
- 'platform-apps/charts/image-list.md' | |
workflow_dispatch: | |
name: scan images | |
jobs: | |
evaluate: | |
if: ${{ vars.TRIVY_GITHUB_CODE_SCANNING == 'true' }} | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.dataStep.outputs.matrix }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: create image json | |
shell: bash | |
run: | | |
helm plugin install https://github.com/nikhilsbhat/helm-images | |
cd platform-apps/charts | |
echo -n "" > image-list.json | |
for chart in $( ls -d */ | sed 's#/##' ); do | |
echo "${chart}" | |
helm dependency update ${chart} 1> /dev/null 2>&1 | |
for image in $( | |
for value in $( find ${chart} -type f -name "values-*" ); do | |
helm images get ${chart} -f ${value} --log-level error --kind "Deployment,StatefulSet,DaemonSet,CronJob,Job,ReplicaSet,Pod,Alertmanager,Prometheus,ThanosRuler,Grafana,Thanos,Receiver" | |
done | sort -u ); do | |
# id=$( echo "${chart}_${image}" | base64 -w 0 ) | |
id=$( echo -n "${chart}_$( echo ${image} | awk -F/ '{print $NF}' | awk -F: '{print $1}' )" ) | |
echo -n "{chart: \"${chart}\", image: \"${image}\", id: \"${id}\"}," >> image-list.json | |
done | |
done | |
- id: dataStep | |
run: | | |
echo "matrix=[$( cat platform-apps/charts/image-list.json )]" | |
#echo "matrix<<EOF" >> ${GITHUB_OUTPUT} | |
echo "matrix=[$( cat platform-apps/charts/image-list.json )]" >> ${GITHUB_OUTPUT} | |
#echo "EOF" >> ${GITHUB_OUTPUT} | |
scan-images: | |
needs: evaluate | |
strategy: | |
matrix: | |
images: ${{ fromJson(needs.evaluate.outputs.matrix) }} | |
# matrix: | |
# images: [ | |
# {chart: "argocd", image: "ghcr.io/dexidp/dex:v2.41.1", id: "dex"}, | |
# {chart: "argocd", image: "public.ecr.aws/docker/library/redis:7.4.1-alpine", id: "redis"}, | |
# {chart: "argocd", image: "quay.io/argoproj/argocd:v2.13.2", id: "argocd"} | |
# ] | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/[email protected] | |
with: | |
image-ref: ${{ matrix.images.image }} | |
format: 'sarif' | |
output: 'trivy-results-${{ matrix.images.id }}.sarif' | |
# exit-code: '1' | |
ignore-unfixed: true | |
# vuln-type: 'os,library' | |
severity: 'CRITICAL,HIGH' | |
- name: print sarif | |
shell: bash | |
run: | | |
cat trivy-results-${{ matrix.images.id }}.sarif | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
category: "trivy-${{ matrix.images.id }}" | |
sarif_file: 'trivy-results-${{ matrix.images.id }}.sarif' |