Skip to content

Commit

Permalink
Fix trivy scanning [5.2.z] (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldziedziul authored Jun 13, 2023
1 parent 3550d9a commit efad298
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/containerscan/trivy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
dependency-tree: true
exit-code: 1
ignorefile: .github/containerscan/.trivyignore
severity:
- CRITICAL
- HIGH
vulnerability:
ignore-unfixed: true
debug: true
debug: true
23 changes: 15 additions & 8 deletions .github/workflows/vulnerability_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [ opened, synchronize, edited ]

jobs:
build:
scan-oss:
env:
DOCKLE_HOST: "unix:///var/run/docker.sock"
runs-on: ubuntu-latest
Expand All @@ -21,17 +21,13 @@ jobs:
- name: Build OSS image
run: |
docker build -t hazelcast/oss:${{ github.sha }} hazelcast-oss
- name: Build EE image
run: |
docker build -t hazelcast/ee:${{ github.sha }} hazelcast-enterprise
- name: Scan OSS image by Trivy
if: always()
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.11.2
with:
image-ref: hazelcast/oss:${{ github.sha }}
trivy-config: .github/containerscan/trivy.yaml
severity: 'CRITICAL,HIGH'

- name: Scan OSS image by Dockle
if: always()
Expand All @@ -51,13 +47,24 @@ jobs:
image: hazelcast/oss:${{ github.sha }}
args: --file=hazelcast-oss/Dockerfile --policy-path=.github/containerscan --severity-threshold=high --exclude-base-image-vulns

scan-ee:
env:
DOCKLE_HOST: "unix:///var/run/docker.sock"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Build EE image
run: |
docker build -t hazelcast/ee:${{ github.sha }} hazelcast-enterprise
- name: Scan EE image by Trivy
if: always()
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.11.2
with:
image-ref: hazelcast/ee:${{ github.sha }}
trivy-config: .github/containerscan/trivy.yaml
severity: 'CRITICAL,HIGH'

- name: Scan EE image by Dockle
if: always()
Expand Down

0 comments on commit efad298

Please sign in to comment.