Skip to content

Commit 0c9aeec

Browse files
committed
ci: Make Trivy scans non-blocking
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
1 parent 82aad37 commit 0c9aeec

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
echo "DNS_API_IMAGE=${IMAGE}" >> $GITHUB_ENV
2727
2828
- name: Run Trivy vulnerability scanner - DNS API
29+
id: trivy-api
30+
continue-on-error: true
2931
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
3032
with:
3133
image-ref: ${{ env.DNS_API_IMAGE }}
@@ -38,6 +40,8 @@ jobs:
3840
echo "DNS_PROXY_IMAGE=${IMAGE}" >> $GITHUB_ENV
3941
4042
- name: Run Trivy vulnerability scanner - DNS Proxy
43+
id: trivy-proxy
44+
continue-on-error: true
4145
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
4246
with:
4347
image-ref: ${{ env.DNS_PROXY_IMAGE }}
@@ -50,6 +54,8 @@ jobs:
5054
echo "DNS_FRONTEND_IMAGE=${IMAGE}" >> $GITHUB_ENV
5155
5256
- name: Run Trivy vulnerability scanner - DNS Frontend
57+
id: trivy-frontend
58+
continue-on-error: true
5359
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
5460
with:
5561
image-ref: ${{ env.DNS_FRONTEND_IMAGE }}
@@ -62,6 +68,8 @@ jobs:
6268
echo "DNS_BLOCKLISTS_IMAGE=${IMAGE}" >> $GITHUB_ENV
6369
6470
- name: Run Trivy vulnerability scanner - DNS blocklists
71+
id: trivy-blocklists
72+
continue-on-error: true
6573
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
6674
with:
6775
image-ref: ${{ env.DNS_BLOCKLISTS_IMAGE }}
@@ -74,7 +82,37 @@ jobs:
7482
echo "DNS_CHECK_IMAGE=${IMAGE}" >> $GITHUB_ENV
7583
7684
- name: Run Trivy vulnerability scanner - DNS check
85+
id: trivy-dnscheck
86+
continue-on-error: true
7787
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # v0.34.2
7888
with:
7989
image-ref: ${{ env.DNS_CHECK_IMAGE }}
8090
trivy-config: ./.github/trivy.yaml
91+
92+
- name: Check Trivy scan results
93+
if: always()
94+
run: |
95+
VULN_FOUND=false
96+
if [ "${{ steps.trivy-api.outcome }}" = "failure" ]; then
97+
echo "::warning::Trivy found vulnerabilities in DNS API image"
98+
VULN_FOUND=true
99+
fi
100+
if [ "${{ steps.trivy-proxy.outcome }}" = "failure" ]; then
101+
echo "::warning::Trivy found vulnerabilities in DNS Proxy image"
102+
VULN_FOUND=true
103+
fi
104+
if [ "${{ steps.trivy-frontend.outcome }}" = "failure" ]; then
105+
echo "::warning::Trivy found vulnerabilities in DNS Frontend image"
106+
VULN_FOUND=true
107+
fi
108+
if [ "${{ steps.trivy-blocklists.outcome }}" = "failure" ]; then
109+
echo "::warning::Trivy found vulnerabilities in DNS Blocklists image"
110+
VULN_FOUND=true
111+
fi
112+
if [ "${{ steps.trivy-dnscheck.outcome }}" = "failure" ]; then
113+
echo "::warning::Trivy found vulnerabilities in DNS Check image"
114+
VULN_FOUND=true
115+
fi
116+
if [ "$VULN_FOUND" = "true" ]; then
117+
echo "::warning::Vulnerabilities detected — review Trivy scan steps above and create a separate PR to upgrade affected dependencies"
118+
fi

0 commit comments

Comments
 (0)