Skip to content

Commit

Permalink
[#291] Added generic scan workflow. (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
GROwen authored Sep 4, 2024
1 parent 065c9cb commit b2d6a97
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 66 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/vulnerability-scan-schedule-5x.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/vulnerability-scan-schedule-6x.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: vulnerability-scan
run-name: Scheduled CVE vulnerability scan of published images.
env:
REGISTRY: ghcr.io
on:
workflow_dispatch:
inputs:
summary:
description: 'Summary of the scheduled scan.'
required: false
default: 'Trivy CVE scan of published images.'
jobs:
setup-matrix:
runs-on: ubuntu-latest
steps:
- name: Set summary
run: echo "${{ github.event.inputs.summary }}" >> $GITHUB_STEP_SUMMARY
- if: github.ref_name == '5.x'
uses: druzsan/setup-matrix@v2
with:
matrix: |
images: ${{ vars.IMAGES }}
exclude:
- images: mailpit
- if: github.ref_name != '5.x'
uses: druzsan/setup-matrix@v2
with:
matrix: |
images: ${{ vars.IMAGES }}
exclude:
- images: mailpit
- id: setup-matrix
run: echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}
vulnerability-scan-schedule:
runs-on: ubuntu-latest
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Scan for vulnerabilities
id: scan
uses: crazy-max/ghaction-container-scan@v3
with:
image: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.images }}:${{ github.ref_name }}
dockerfile: ./images/${{ matrix.images }}
- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
2 changes: 1 addition & 1 deletion images/php/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ghcr.io/skpr/mtk:v2.0.2 AS mtk
FROM uselagoon/php-${PHP_VERSION}-cli-drupal:latest

ARG GOJQ_VERSION=0.12.16
ARG DOCKERIZE_VERSION=v0.8.0
ARG DOCKERIZE_VERSION=v0.6.1
ARG BAY_CLI_VERSION=v1.1.3

COPY --from=php-cli /usr/local/bin/phpdbg /usr/local/bin/
Expand Down

0 comments on commit b2d6a97

Please sign in to comment.