-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the correct defaults and point to the right workflow
- Loading branch information
1 parent
9885fc5
commit 8921ddb
Showing
1 changed file
with
37 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: | |
branches: | ||
- renovate/** | ||
pull_request: | ||
schedule: | ||
- cron: "14 3 * * *" # Daily at 3:14 AM | ||
|
||
jobs: | ||
build: | ||
|
@@ -40,4 +42,38 @@ jobs: | |
severity: "CRITICAL,HIGH" | ||
env: | ||
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db | ||
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db | ||
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db | ||
|
||
- 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" | ||
env: | ||
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db | ||
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db | ||
|
||
- 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" | ||
|
||
notify-failure: | ||
if: ${{ github.event_name == 'schedule' && failure() }} | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify failure via Slack | ||
uses: archive/github-actions-slack@master | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||
slack-channel: ${{ secrets.CAOS_COREINT_SLACK_CHANNEL }} | ||
slack-text: "❌ `'newrelic/infrastructure-bundle'`: [security pipeline failed](${{ github.server_url }}/newrelic/infrastructure-bundle/actions/runs/${{ github.run_id }})." |