Skip to content

Commit

Permalink
Enabling the MetaMask Security Code Scanner (#2203)
Browse files Browse the repository at this point in the history
## Required Action

Prior to merging this pull request, please ensure the following has been
completed:
- [x] The lines specifying `branches` correctly specifies this
repository's default branch (usually `main`).
- [ ] Any paths you would like to ignore have been added to the
`paths_ignored` configuration option (see
[setup](https://github.com/MetaMask/Security-Code-Scanner/blob/main/README.md#setup))
- [x] Any existing CodeQL configuration has been disabled.

## What is the Security Code Scanner?
This pull request enables the [MetaMask Security Code
Scanner](https://github.com/metamask/Security-Code-Scanner/) GitHub
Action. This action runs on each pull request, and will flag potential
vulnerabilities as a review comment. It will also scan this repository's
default branch, and log any findings in this repository's [Code Scanning
Alerts Tab](https://github.com/metamask/snaps/security/code-scanning).

<img width="500" alt="Screenshot 2024-02-12 at 9 19 05 PM"
src="https://github.com/MetaMask/temp-poc-templates-repo/assets/15018469/327691d5-84e6-4603-859d-ad84c82a8b05">

The action itself runs various static analysis engines behind the
scenes. Currently, it is only running GitHub's CodeQL engine. For this
reason, we recommend disabling any existing CodeQL configuration your
repository may have.

## How do I interact with the tool?

Every finding raised by the Security Code Scanner will present context
behind the potential vulnerability identified, and allow the developer
to fix, or dismiss it.

The finding will automatically be dismissed by pushing a commit that
fixes the identified issue, or by manually dismissing the alert using
the button in GitHub's UI. If dismissing an alert manually, please add
any additional context surrounding the reason for dismissal, as this
informs our decision to disable, or improve any poor performing rules.

<img width="983" alt="Screenshot 2024-02-12 at 8 41 46 PM"
src="https://github.com/MetaMask/temp-poc-templates-repo/assets/15018469/ca1c7083-966b-4025-8722-65900dbd1b1b">



For more configuration options, please review the tool's
[README](https://github.com/MetaMask/Security-Code-Scanner/blob/main/README.md).
For any additional questions, please reach out to
`@mm-application-security` slack.

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
  • Loading branch information
3 people committed Feb 22, 2024
1 parent 06e1c8b commit df74d38
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/security-code-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'MetaMask Security Code Scanner'

on:
push:
branches: ['main']
pull_request:

jobs:
run-security-scan:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: MetaMask Security Code Scanner
uses: MetaMask/Security-Code-Scanner@main
with:
repo: ${{ github.repository }}
paths_ignored: |
tests/
'**/test/'
'**/test-utils/'
'**/__mocks__/'
'**/__snapshots__/'
'**/__fixtures__/'
'**/*.test.js*'
'**/*.test.ts*'
'**/*.test.browser.ts*'
docs/
'**/jest.environment.js'
'**/jest.config.js'
node_modules
mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}}
slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}

0 comments on commit df74d38

Please sign in to comment.