Skip to content

Commit 1e5fb11

Browse files
committed
chore: add trivy as a second security scanner
Closes #393 Signed-off-by: Jonathan Gonzalez V <jonathan.gonzalez@enterprisedb.com>
1 parent 167acba commit 1e5fb11

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

.github/actions/security-scans/action.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,28 @@ runs:
6262
if: ${{ steps.snyk.outcome == 'success' }}
6363
with:
6464
sarif_file: snyk.sarif
65+
66+
- name: Run Trivy vulnerability scanner
67+
uses: aquasecurity/trivy-action@0.33.1
68+
id: trivy
69+
continue-on-error: true
70+
with:
71+
version: 'latest'
72+
image-ref: '${{ inputs.image }}'
73+
format: 'sarif'
74+
output: 'trivy-results.sarif'
75+
76+
- name: Upload Trivy scan results to GitHub Security tab
77+
uses: github/codeql-action/upload-sarif@v4
78+
if: ${{ steps.trivy.outcome == 'success' }}
79+
with:
80+
sarif_file: 'trivy-results.sarif'
81+
82+
- name: Review Security checks
83+
if: |
84+
steps.snyk.outcome != 'success' &&
85+
steps.trivy.outcome != 'success'
86+
shell: bash
87+
run: |
88+
echo "Snyk or Trivy check failed"
89+
exit 1

.github/workflows/bake_targets.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
testbuild:
4040
# Start by building images for testing. We want to run security checks before pushing those to production.
4141
name: PostgreSQL ${{ inputs.postgresql_version }}
42-
runs-on: ubuntu-24.04
42+
runs-on: ubuntu-latest-16-cores
4343
permissions:
4444
contents: read
4545
packages: write
@@ -130,7 +130,7 @@ jobs:
130130
131131
security:
132132
name: Security checks
133-
runs-on: ubuntu-latest
133+
runs-on: ubuntu-latest-4-cores
134134
permissions:
135135
contents: read
136136
packages: read
@@ -145,7 +145,7 @@ jobs:
145145
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
146146

147147
- name: Security checks
148-
uses: cloudnative-pg/postgres-containers/.github/actions/security-scans@main
148+
uses: ./.github/actions/security-scans/
149149
with:
150150
image: "${{ matrix.image }}"
151151
registry_user: ${{ github.actor }}

0 commit comments

Comments
 (0)