-
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.
Browse files
Browse the repository at this point in the history
## Summary Solves 50% of #2496 ### Time to review: __2.5 mins__ ## Changes proposed - Sets up vuln scans on a cron job - Posts it to slack ## Context for reviewers I setup a highlight word on "CI Vulnerability Scans" so this bothers me specifically ## Testing see `#internal-alerts-infra` --------- Co-authored-by: Michael Chouinard <[email protected]>
- Loading branch information
1 parent
88cb722
commit b9b8ff8
Showing
5 changed files
with
58 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
paths: | ||
# actionlint doesn't know how to handle the json inside of this file | ||
.github/workflows/ci-cron-vulnerability-scans.yml: | ||
ignore: | ||
- ".*SC2046.*" |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# GitHub Actions CI workflow that runs vulnerability scans on the application's Docker image | ||
# to ensure images built are secure before they are deployed. | ||
|
||
name: CI Vulnerability Scans | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Run every day at (8am ET, 11am PT) right before the start of the workday | ||
- cron: "0 12 * * *" | ||
|
||
jobs: | ||
vulnerability-scans: | ||
name: Vulnerability Scans | ||
strategy: | ||
matrix: | ||
app_name: ["frontend", "api", "analytics"] | ||
uses: ./.github/workflows/vulnerability-scans.yml | ||
with: | ||
app_name: ${{ matrix.app_name }} | ||
|
||
send-slack-notification: | ||
name: Send Slack notification on failure | ||
needs: vulnerability-scans | ||
runs-on: ubuntu-latest | ||
# if: failure() | ||
steps: | ||
- name: Send Slack notification | ||
run: | | ||
curl -X POST -H "Authorization: Bearer ${{ secrets.ALERTS_SLACK_BOT_TOKEN }}" \ | ||
-H "Content-Type: application/json; charset=utf-8" \ | ||
--data '{ | ||
"channel": "${{ secrets.SLACK_ALERTS_CHANNEL_ID }}", | ||
"text": ":x: *GitHub Actions Failure Alert*", | ||
"attachments": [ | ||
{ | ||
"color": "#ff0000", | ||
"title": "Workflow *'"${{ github.workflow }}"'* failed", | ||
"fields": [ | ||
{ | ||
"title": "Workflow URL", | ||
"value": "'"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"'" | ||
} | ||
], | ||
"footer": "GitHub Actions", | ||
"footer_icon": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png", | ||
"ts": '$(date +%s)' | ||
} | ||
] | ||
}' https://slack.com/api/chat.postMessage |
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