|
| 1 | +name: Scan image vulnerability |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # Sunday, 18:00 JST |
| 7 | + - cron: '0 9 * * 0' |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.head_ref || github.sha }}-${{ github.workflow }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + debian: |
| 15 | + name: Scan debian image with grype |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - name: Pull and scan upstream trixie image |
| 21 | + run: | |
| 22 | + docker pull debian:trixie |
| 23 | + echo "# Scan debian image with grype (filter)" >> $GITHUB_STEP_SUMMARY |
| 24 | + docker run --rm anchore/grype:latest debian:trixie --ignore-states wont-fix | grep -v Negligible >> $GITHUB_STEP_SUMMARY |
| 25 | + echo "# Scan debian image with grype (details)" >> $GITHUB_STEP_SUMMARY |
| 26 | + echo "|NAME | INSTALLED | FIXED | IN | TYPE | VULNERABILITY | SEVERITY | EPSS | RISK | |" >> $GITHUB_STEP_SUMMARY |
| 27 | + echo "|---| ---|---|---|----|---|---|---|---|---|" >> $GITHUB_STEP_SUMMARY |
| 28 | + docker run --rm anchore/grype:latest debian:trixie | sed -e "s/won't fix/won'tfix/g" | grep -v "^NAME" | sed 's/^/|/; s/ */ | /g; s/$/ |/' >> $GITHUB_STEP_SUMMARY |
| 29 | + ruby: |
| 30 | + name: Scan Ruby image with grype |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Pull and scan upstream Ruby image |
| 36 | + run: | |
| 37 | + docker pull ruby:3.4-slim |
| 38 | + echo "# Scan Ruby image with grype (filter)" >> $GITHUB_STEP_SUMMARY |
| 39 | + docker run --rm anchore/grype:latest ruby:3.4-slim --ignore-states wont-fix | grep -v Negligible >> $GITHUB_STEP_SUMMARY |
| 40 | + echo "# Scan Ruby image with grype (details)" >> $GITHUB_STEP_SUMMARY |
| 41 | + echo "|NAME | INSTALLED | FIXED | IN | TYPE | VULNERABILITY | SEVERITY | EPSS | RISK | |" >> $GITHUB_STEP_SUMMARY |
| 42 | + echo "|---| ---|---|---|----|---|---|---|---|---|" >> $GITHUB_STEP_SUMMARY |
| 43 | + docker run --rm anchore/grype:latest ruby:3.4-slim | sed -e "s/won't fix/won'tfix/g" | grep -v "^NAME" | sed 's/^/|/; s/ */ | /g; s/$/ |/' >> $GITHUB_STEP_SUMMARY |
| 44 | + fluentd: |
| 45 | + name: Scan Fluentd image with grype |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v6 |
| 51 | + - name: Pull and scan Fluentd image |
| 52 | + run: | |
| 53 | + # v1.19.1-debian-amd64 |
| 54 | + IMAGE=$(make echo-all-images | cut -d' ' -f1|cut -d',' -f3) |
| 55 | + echo "# Scan Fluentd image with grype (filter)" >> $GITHUB_STEP_SUMMARY |
| 56 | + docker run --rm anchore/grype:latest fluent/fluentd:$IMAGE --ignore-states wont-fix | grep -v Negligible >> $GITHUB_STEP_SUMMARY |
| 57 | + echo "# Scan Fluentd image with grype (details)" >> $GITHUB_STEP_SUMMARY |
| 58 | + echo "|NAME | INSTALLED | FIXED | IN | TYPE | VULNERABILITY | SEVERITY | EPSS | RISK | |" >> $GITHUB_STEP_SUMMARY |
| 59 | + echo "|---| ---|---|---|----|---|---|---|---|---|" >> $GITHUB_STEP_SUMMARY |
| 60 | + docker run --rm anchore/grype:latest fluent/fluentd:$IMAGE | sed -e "s/won't fix/won'tfix/g" | grep -v "^NAME" | sed 's/^/|/; s/ */ | /g; s/$/ |/' >> $GITHUB_STEP_SUMMARY |
0 commit comments