Skip to content
Closed
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
56 changes: 26 additions & 30 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Security Check
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/security.yml'
push:
branches:
- main
paths:
- '.github/workflows/security.yml'
schedule:
- cron: '0 1 * * *'

Expand All @@ -10,7 +18,7 @@ permissions:

jobs:
scan:
name: 'Image Scan (PHP: ${{ matrix.php-version }}, Variant: ${{ matrix.variant.name }})'
name: 'Image Scan (PHP: ${{ matrix.php-version }}, Variant: ${{ matrix.variant }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -21,42 +29,30 @@ jobs:
- '8.4'
- '8.5'
variant:
- name: fpm
dockerfile: fpm/Dockerfile
- name: fpm-otel
dockerfile: fpm-otel/Dockerfile
- name: caddy
dockerfile: caddy/Dockerfile
- name: caddy-otel
dockerfile: caddy/Dockerfile
- name: nginx
dockerfile: nginx/Dockerfile
- name: nginx-otel
dockerfile: nginx/Dockerfile
- name: frankenphp
dockerfile: frankenphp/Dockerfile
- name: frankenphp-otel
dockerfile: frankenphp-otel/Dockerfile
- fpm
- fpm-otel
- caddy
- caddy-otel
- nginx
- nginx-otel
- frankenphp
- frankenphp-otel
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Pull image
run: docker pull shopware/docker-base:${{ matrix.php-version }}-${{ matrix.variant.name }}

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Scan for vulnerabilities
id: scan
uses: crazy-max/ghaction-container-scan@v4
uses: docker/scout-action@v1
with:
image: shopware/docker-base:${{ matrix.php-version }}-${{ matrix.variant.name }}
dockerfile: ./${{ matrix.variant.dockerfile }}
command: cves
image: registry://shopware/docker-base:${{ matrix.php-version }}-${{ matrix.variant }}
dockerhub-user: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKER_HUB_PASSWORD }}
sarif-file: scout.sarif.json
write-comment: false

- name: Upload SARIF file
if: ${{ steps.scan.outputs.sarif != '' }}
uses: github/codeql-action/upload-sarif@v4.39.1
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
category: ${{ matrix.php-version }}-${{ matrix.variant.name }}
sarif_file: scout.sarif.json
category: ${{ matrix.php-version }}-${{ matrix.variant }}
Loading