-
Notifications
You must be signed in to change notification settings - Fork 67
chore: add Snyk security scanning and dependency review workflows #289
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Security Scan | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| snyk: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| security-events: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Run Snyk to check for vulnerabilities | ||
| if: github.event_name == 'pull_request' | ||
| uses: snyk/actions/gradle-jdk8@master | ||
| continue-on-error: true | ||
| env: | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| with: | ||
| args: --severity-threshold=high --sarif-file-output=snyk.sarif | ||
| - name: Upload result to GitHub Code Scanning | ||
| if: github.event_name == 'pull_request' | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: snyk.sarif | ||
| - name: Monitor on default branch | ||
| if: github.event_name == 'push' | ||
|
Comment on lines
+17
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| uses: snyk/actions/gradle-jdk8@master | ||
| env: | ||
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
| with: | ||
| command: monitor | ||
|
|
||
| dependency-review: | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/dependency-review-action@v4 | ||
| continue-on-error: true | ||
| with: | ||
| fail-on-severity: high | ||
| comment-summary-in-pr: always | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masterrefThe
snyk/actions/gradle-jdk8@masterreference (lines 19 and 32) tracks a mutable branch. A compromised or force-pushed upstreammastercould inject arbitrary code into the workflow with access to theSNYK_TOKENsecret andsecurity-events: writepermission. Pin to a specific commit SHA (or at minimum a release tag) to prevent supply-chain attacks.The
actions/checkout@v4and other actions already use tags; Snyk should follow the same pattern.Pin the Snyk action to a specific commit SHA (look up the latest release SHA from https://github.com/snyk/actions/releases and substitute it).:
Was this helpful? React with 👍 / 👎