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

[DSEC-907] Notify AppSec team when Trivy action fails #337

Merged
merged 5 commits into from
Jul 25, 2024
Merged
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
26 changes: 17 additions & 9 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ name: dsp-appsec-trivy
on:
pull_request:
schedule:
- cron: '0 14 * * 1' # each Monday at 9am EST
- cron: '23 1 * * 0'

jobs:
appsec-trivy:
# Parse Dockerfile and build, scan image if a "blessed" base image is not used
name: DSP AppSec Trivy check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: broadinstitute/dsp-appsec-trivy-action@v1
- name: Checkout code
uses: actions/checkout@v3
with:
sarif: trivy-results.sarif
fetch-depth: 0

- name: Run Trivy scan
uses: broadinstitute/dsp-appsec-trivy-action@v1

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
if: ${{ !github.base_ref }} # omit upload on PRs
- name: Notify in Slack
if: failure()
uses: broadinstitute/action-slack@v3.15.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
sarif_file: trivy-results.sarif
status: ${{ job.status }}
channel: "trivy-weekly-scans-notblessedimages"
username: "Agora Trivy scan"
icon_emoji: ':alert_red_light:'
text: 'Agora Trivy scan failure. <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here> to see the run.'
Loading