From 68db3aef2d58858301fcfb01d85a4ec58d046540 Mon Sep 17 00:00:00 2001 From: witmicko Date: Tue, 13 Feb 2024 15:25:24 +0000 Subject: [PATCH 1/6] enable MetaMask Security Code Scanner --- .github/workflows/security-code-scanner.yml | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/security-code-scanner.yml diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml new file mode 100644 index 000000000000..07d6afa27d6f --- /dev/null +++ b/.github/workflows/security-code-scanner.yml @@ -0,0 +1,26 @@ +name: "MetaMask Security Code Scanner" + +on: + push: + branches: [ 'develop' ] + pull_request: + branches: [ 'develop' ] + +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: | + example + rules_excluded: + example + mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}} + slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }} \ No newline at end of file From 1e58a010f74054f3bc7ba620a8f044667a7a4c13 Mon Sep 17 00:00:00 2001 From: witmicko Date: Tue, 13 Feb 2024 16:15:14 +0000 Subject: [PATCH 2/6] rm codeql workflow --- .github/workflows/codeql-analysis.yml | 70 --------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index e5c1eb06b588..000000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ develop, Version-v*, cla-signatures, master, snaps ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ develop ] - schedule: - - cron: '28 12 * * 0' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 From 048aabb85bc896cd1d3d19515985544da22945ba Mon Sep 17 00:00:00 2001 From: witmicko Date: Thu, 15 Feb 2024 17:16:38 +0000 Subject: [PATCH 3/6] ignore test paths --- .github/workflows/security-code-scanner.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml index 07d6afa27d6f..875fb55cb372 100644 --- a/.github/workflows/security-code-scanner.yml +++ b/.github/workflows/security-code-scanner.yml @@ -19,7 +19,15 @@ jobs: with: repo: ${{ github.repository }} paths_ignored: | - example + test/ + docs/ + storybook/ + .storybook/ + '**/*.test.js' + '**/*.test.ts' + '**/*.test.jsx' + '**/*.test.tsx' + '**/*.stories.tsx' rules_excluded: example mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}} From 1d876574caca2be996084e9468ee07a55ded7cb6 Mon Sep 17 00:00:00 2001 From: witmicko Date: Fri, 16 Feb 2024 10:15:35 +0000 Subject: [PATCH 4/6] add to ignore paths --- .github/workflows/security-code-scanner.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml index 875fb55cb372..9562889d6e4c 100644 --- a/.github/workflows/security-code-scanner.yml +++ b/.github/workflows/security-code-scanner.yml @@ -28,6 +28,8 @@ jobs: '**/*.test.jsx' '**/*.test.tsx' '**/*.stories.tsx' + development/chromereload.js + node_modules rules_excluded: example mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}} From 64f30dc1f7ef42d78f0a5a11dc6c68f7fdd4ed31 Mon Sep 17 00:00:00 2001 From: witmicko Date: Mon, 19 Feb 2024 10:13:37 +0000 Subject: [PATCH 5/6] adding back original codeql for quality checks --- .github/workflows/codeql-analysis.yml | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000000..e5c1eb06b588 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,70 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ develop, Version-v*, cla-signatures, master, snaps ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ develop ] + schedule: + - cron: '28 12 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 03d15948ae798c8d41a25ef7413d8da0bca9d758 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Tue, 27 Feb 2024 01:30:12 +0000 Subject: [PATCH 6/6] chore: add newline at EOF --- .github/workflows/security-code-scanner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security-code-scanner.yml b/.github/workflows/security-code-scanner.yml index 9562889d6e4c..6b75b0d98bd0 100644 --- a/.github/workflows/security-code-scanner.yml +++ b/.github/workflows/security-code-scanner.yml @@ -33,4 +33,4 @@ jobs: rules_excluded: example mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}} - slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }} \ No newline at end of file + slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}