|
| 1 | +## ⚠️ Important Notice - Action Required |
| 2 | + |
| 3 | +**This PR may be auto-merged in the future if not configured.** |
| 4 | + |
| 5 | +If your team does not need the security scanner: |
| 6 | + |
| 7 | +1. **Add a comment on this PR** explaining why your team is opting out |
| 8 | +2. **Close this PR** to prevent auto-merge |
| 9 | +3. **Add a `.github/no-security-scanner` file** to your repository to prevent future onboarding attempts |
| 10 | + |
| 11 | +If you need the scanner but want to customize it: |
| 12 | + |
| 13 | +1. Complete the checklist below |
| 14 | +2. Review and modify the workflow file as needed |
| 15 | +3. Approve and merge this PR when ready |
| 16 | + |
| 17 | +If no action is taken, this PR may be automatically merged after a grace period to ensure baseline security coverage across all repositories. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Required Action |
| 22 | + |
| 23 | +Prior to merging this pull request, please ensure the following has been completed: |
| 24 | + |
| 25 | +- [ ] The lines specifying `branches` correctly specify this repository's default branch (usually `main` or `master`). |
| 26 | +- [ ] Any paths you would like to ignore have been added to the `paths-ignored` configuration option (see [setup](https://github.com/MetaMask/action-security-code-scanner/blob/main/README.md#setup)) |
| 27 | +- [ ] Language configuration has been reviewed - ignore falsely detected languages or add build commands for Java/Kotlin if needed (see Configuration section below) |
| 28 | +- [ ] Any existing CodeQL configuration has been disabled. |
| 29 | + |
| 30 | +## What is the Security Code Scanner? |
| 31 | + |
| 32 | +This pull request enables the [MetaMask Security Code Scanner](https://github.com/MetaMask/action-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]({{SECURITY_SCANNING_URL}}). |
| 33 | + |
| 34 | +<img width="500" alt="Security Scanner Screenshot" src="https://github.com/user-attachments/assets/41c87b70-79b7-44dd-a444-791b142fbbe1"> |
| 35 | + |
| 36 | +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. |
| 37 | + |
| 38 | +## How do I interact with the tool? |
| 39 | + |
| 40 | +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. |
| 41 | + |
| 42 | +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. |
| 43 | + |
| 44 | +<img width="983" alt="Alert Dismissal Screenshot" src="https://github.com/user-attachments/assets/114219d5-4b4c-4d9d-8bfe-f4666012b73e"> |
| 45 | + |
| 46 | +## Configuration |
| 47 | + |
| 48 | +### Language Configuration |
| 49 | + |
| 50 | +The scanner auto-detects languages in your repository. If you need to customize language-specific settings, you can modify the `languages-config` section in the workflow file. |
| 51 | + |
| 52 | +**Common use cases:** |
| 53 | + |
| 54 | +1. **Ignore falsely detected languages:** |
| 55 | + |
| 56 | + ```yaml |
| 57 | + languages-config: | |
| 58 | + [ |
| 59 | + { |
| 60 | + "language": "ruby", |
| 61 | + "ignore": true |
| 62 | + } |
| 63 | + ] |
| 64 | + ``` |
| 65 | +
|
| 66 | +2. **Configure Java/Kotlin builds:** |
| 67 | +
|
| 68 | + ```yaml |
| 69 | + languages-config: | |
| 70 | + [ |
| 71 | + { |
| 72 | + "language": "java-kotlin", |
| 73 | + "build_mode": "manual", |
| 74 | + "build_command": "./gradlew build", |
| 75 | + "version": "21", |
| 76 | + "distribution": "temurin" |
| 77 | + } |
| 78 | + ] |
| 79 | + ``` |
| 80 | +
|
| 81 | +**Supported languages:** `javascript-typescript`, `python`, `java-kotlin`, `go`, `cpp`, `csharp`, `ruby` |
| 82 | + |
| 83 | +**Build modes:** `none`, `autobuild`, `manual` |
| 84 | + |
| 85 | +### Additional Configuration |
| 86 | + |
| 87 | +For more configuration options, please review the tool's [README](https://github.com/MetaMask/action-security-code-scanner/blob/main/README.md). |
| 88 | + |
| 89 | +For any additional questions, please reach out to `@app-sec` in Slack. |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +🤖 _This PR was automatically created by the MetaMask Security onboarding system_ |
0 commit comments