Skip to content

Commit facdebc

Browse files
authored
Merge pull request #50 from voxpupuli/switch_to_grype
feat: switch container scanning to grype
2 parents 79c0c5e + a401b9c commit facdebc

File tree

2 files changed

+68
-31
lines changed

2 files changed

+68
-31
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,6 @@ jobs:
5151
RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }}
5252
RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }}
5353
54-
- name: Login to Docker Hub
55-
uses: docker/login-action@v3
56-
with:
57-
username: voxpupulibot
58-
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
59-
60-
- name: Analyze container image for CVEs
61-
id: analyze-image-cves
62-
uses: docker/scout-action@v1
63-
with:
64-
command: cves
65-
image: 'local://ci/voxbox:${{ matrix.rubygem_puppet }}'
66-
sarif-file: sarif.output.${{ matrix.rubygem_puppet }}.${{ github.sha }}.json
67-
write-comment: false
68-
69-
- name: Compare container image to latest from Registry
70-
id: compare-image
71-
uses: docker/scout-action@v1
72-
with:
73-
command: compare
74-
image: 'local://ci/voxbox:${{ matrix.rubygem_puppet }}'
75-
to: 'ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-main'
76-
summary: true
77-
keep-previous-comments: true
78-
79-
- name: Upload SARIF result
80-
id: upload-sarif
81-
uses: github/codeql-action/upload-sarif@v3
82-
with:
83-
sarif_file: sarif.output.${{ matrix.rubygem_puppet }}.${{ github.sha }}.json
84-
8554
- name: Clone voxpupuli/puppet-example repository
8655
uses: actions/checkout@v4
8756
with:
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Security Scanning 🕵️
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
setup-matrix:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
matrix: ${{ steps.set-matrix.outputs.matrix }}
17+
steps:
18+
- name: Source checkout
19+
uses: actions/checkout@v4
20+
21+
- id: set-matrix
22+
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT
23+
24+
scan_ci_container:
25+
name: 'Scan CI container'
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
needs: setup-matrix
32+
strategy:
33+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Build CI container
39+
uses: docker/build-push-action@v6
40+
with:
41+
tags: 'ci/voxbox:${{ matrix.rubygem_puppet }}'
42+
push: false
43+
build-args: |
44+
BASE_IMAGE=${{ matrix.base_image }}
45+
RUBYGEM_PUPPET=${{ matrix.rubygem_puppet }}
46+
RUBYGEM_FACTER=${{ matrix.facter_version }}
47+
RUBYGEM_VOXPUPULI_TEST=${{ matrix.rubygem_voxpupuli_test }}
48+
RUBYGEM_VOXPUPULI_ACCEPTANCE=${{ matrix.rubygem_voxpupuli_acceptance }}
49+
RUBYGEM_VOXPUPULI_RELEASE=${{ matrix.rubygem_voxpupuli_release }}
50+
RUBYGEM_PUPPET_METADATA=${{ matrix.rubygem_puppet_metadata }}
51+
RUBYGEM_OVERCOMMIT=${{ matrix.rubygem_overcommit }}
52+
RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }}
53+
RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }}
54+
55+
- name: Scan image with Anchore Grype
56+
uses: anchore/scan-action@v4
57+
id: scan
58+
with:
59+
image: 'ci/voxbox:${{ matrix.rubygem_puppet }}'
60+
fail-build: false
61+
62+
- name: Inspect action SARIF report
63+
run: jq . ${{ steps.scan.outputs.sarif }}
64+
65+
- name: Upload Anchore scan SARIF report
66+
uses: github/codeql-action/upload-sarif@v3
67+
with:
68+
sarif_file: ${{ steps.scan.outputs.sarif }}

0 commit comments

Comments
 (0)