-
Notifications
You must be signed in to change notification settings - Fork 20
chore(github): separate vulnerability scans #739
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
Merged
duncanista
merged 6 commits into
main
from
jordan.gonzalez/github/separate-vulnerability-scans
Jul 14, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a8380ca
remove `serverless-vuln-scan.yml`
duncanista 115b99b
add `serverless-init` vulnerability scans
duncanista f98cce7
add lambda vulnerability scans
duncanista edd9c3a
add `on: pull_request:` so we can test if tests work
duncanista be68aef
eol
duncanista 4597490
remove `on: pull_request:`
duncanista File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,89 @@ | ||
| name: "Serverless Init Vulnerability Scan" | ||
|
|
||
| on: | ||
| schedule: | ||
| # daily at midnight | ||
| - cron: "0 0 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| # adds public.ecr.aws as fallback incase rate limit on ghcr.io is hit | ||
| TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db | ||
| TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db | ||
|
|
||
| jobs: | ||
| trivy-scans: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Scan latest serverless-init image with trivy | ||
| uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0 | ||
| with: | ||
| image-ref: "datadog/serverless-init:latest" | ||
| ignore-unfixed: true | ||
| exit-code: 1 | ||
| format: table | ||
|
|
||
| - name: Scan latest-alpine serverless-init image with trivy | ||
| uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0 | ||
| with: | ||
| image-ref: "datadog/serverless-init:latest-alpine" | ||
| ignore-unfixed: true | ||
| exit-code: 1 | ||
| format: table | ||
|
|
||
| grype-scans: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Scan latest serverless-init image with grype | ||
| uses: anchore/scan-action@16910ac423301c6d30554b83a7f71ac6ff4a51f3 # v6.4.0 | ||
| with: | ||
| image: "datadog/serverless-init:latest" | ||
| only-fixed: true | ||
| fail-build: true | ||
| severity-cutoff: low | ||
| output-format: table | ||
|
|
||
| - name: Scan latest-alpine serverless-init image with grype | ||
| uses: anchore/scan-action@16910ac423301c6d30554b83a7f71ac6ff4a51f3 # v6.4.0 | ||
| with: | ||
| image: "datadog/serverless-init:latest-alpine" | ||
| only-fixed: true | ||
| fail-build: true | ||
| severity-cutoff: low | ||
| output-format: table | ||
|
|
||
| retry: | ||
| needs: [trivy-scans, grype-scans] | ||
| if: failure() && fromJSON(github.run_attempt) < 2 | ||
| runs-on: ubuntu-22.04 | ||
| permissions: | ||
| actions: write | ||
| steps: | ||
| - name: Retry failed action | ||
| env: | ||
| GH_REPO: ${{ github.repository }} | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }} | ||
|
|
||
| notify: | ||
| needs: [trivy-scans, grype-scans] | ||
| if: failure() && fromJSON(github.run_attempt) >= 2 | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Notify | ||
| env: | ||
| SLACK_CHANNEL: "#serverless-agent" | ||
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | ||
| run: | | ||
| set -x | ||
|
|
||
| OPS_MESSAGE=":gh-check-failed: Serverless Init Vulnerability Scan failed! :radar-scan: | ||
|
|
||
| Whoever is on support, please fix the vulnerability, before a customer alerts us to it. | ||
|
|
||
| See ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} for the full info on the found vulnerability. :bufo-thanks:" | ||
|
|
||
| curl -H "Content-type: application/json" -X POST "$SLACK_WEBHOOK" -d '{ | ||
| "channel": "'"$SLACK_CHANNEL"'", | ||
| "text": "'"$OPS_MESSAGE"'" | ||
| }' | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.