Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide for disabling security scan in ci-pr.yml and adding alternative repo #6080

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CI PRs
on:
pull_request:

env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db,aquasec/trivy-db,ghcr.io/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db,aquasec/trivy-java-db,ghcr.io/aquasecurity/trivy-java-db

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -17,3 +21,24 @@ jobs:
timeout-minutes: 75
run: |
./mvnw -B -s .github/settings.xml -Pdocs clean install
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'table'
severity: 'CRITICAL,HIGH'
- name: 'Scanned'
shell: bash
run: echo "::info ::Scanned"
done:
runs-on: ubuntu-latest
needs: [ scan, build ]
steps:
- name: 'Done'
shell: bash
run: echo "::info ::Done"
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
enableSecurityScan:
type: boolean
default: false
default: true
description: 'Enable security scan with Trivy'
push:
branches:
Expand All @@ -15,6 +15,8 @@ on:

env:
MAVEN_THREADS: '-T 1'
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db,aquasec/trivy-db,ghcr.io/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db,aquasec/trivy-java-db,ghcr.io/aquasecurity/trivy-java-db

jobs:
build:
Expand Down Expand Up @@ -193,7 +195,7 @@ jobs:
GCR_JSON_KEY: ${{ secrets.GCR_JSON_KEY }}
scan:
runs-on: ubuntu-latest
if: ${{ inputs.enableSecurityScan != null && inputs.enableSecurityScan }}
if: ${{ inputs.enableSecurityScan == null || inputs.enableSecurityScan }}
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
Expand Down
Loading