-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(trivy): disable caching, notify nightly failures (#436)
* ci(trivy): disable caching * ci(nightlies): notify pipeline failures * style: fmt
- Loading branch information
1 parent
f5c5a78
commit bf2ebda
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
build: | ||
name: Build and scan image | ||
runs-on: ubuntu-latest | ||
env: # Variables as understood by docker-build.sh | ||
env: # Variables as understood by docker-build.sh | ||
DOCKER_IMAGE: newrelic/infrastructure-bundle | ||
DOCKER_IMAGE_TAG: ci | ||
steps: | ||
|
@@ -39,26 +39,27 @@ jobs: | |
format: table | ||
exit-code: 1 | ||
ignore-unfixed: true | ||
severity: 'CRITICAL,HIGH' | ||
severity: "CRITICAL,HIGH" | ||
cache: false | ||
|
||
- name: Run Trivy in report mode | ||
# Only generate sarif when running nightly on the main branch. | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_IMAGE_TAG }} | ||
format: 'template' | ||
template: '@/contrib/sarif.tpl' | ||
output: 'trivy-results.sarif' | ||
ignore-unfixed: false # Get full report when running nightly. | ||
severity: 'CRITICAL,HIGH' | ||
format: "template" | ||
template: "@/contrib/sarif.tpl" | ||
output: "trivy-results.sarif" | ||
ignore-unfixed: false # Get full report when running nightly. | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
# Only upload sarif when running nightly on the main branch. | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' | ||
sarif_file: "trivy-results.sarif" | ||
|
||
- name: Run Snyk to check Docker image for vulnerabilities | ||
uses: snyk/actions/docker@master | ||
|
@@ -67,7 +68,7 @@ jobs: | |
with: | ||
image: ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_IMAGE_TAG }} | ||
args: --file=Dockerfile --severity-threshold=critical | ||
|
||
notify-failure: | ||
if: ${{ github.event_name == 'schedule' && failure() }} | ||
needs: [build] | ||
|