Skip to content

4. Add Semgrep action#44

Merged
witmicko merged 12 commits intov2from
monorepo-semgrep-action
Oct 29, 2025
Merged

4. Add Semgrep action#44
witmicko merged 12 commits intov2from
monorepo-semgrep-action

Conversation

@witmicko
Copy link
Contributor

@witmicko witmicko commented Oct 24, 2025

migrating semgrep action into monorepo,
core code unchanged from https://github.com/MetaMask/semgrep-action
added monorepo support


Note

Adds a monorepo Semgrep action and a unified, callable security scan workflow with language detection, per-language CodeQL, and consolidated rules/tests.

  • Workflows
    • Add unified /.github/workflows/security-scan.yml (callable) that:
      • Detects languages, runs CodeQL per-language, runs Semgrep once, and finalizes with optional Slack/metrics.
    • Add /.github/workflows/test-semgrep.yml to validate and test Semgrep rules.
    • Remove legacy /.github/workflows/reusable-codeql.yml and /.github/workflows/security-code-scanner.yml.
  • New Package: packages/semgrep-action
    • Add composite action (action.yml) to install Semgrep, run scan with repo rules, and upload SARIF.
    • Add scripts (bin/validate-rules, bin/test, bin/scan), README, and CONTRIBUTING guide.
  • Semgrep Rules and Tests
    • Add rules:
      • generic/npx-usage for JSON and shell/Dockerfile.
      • github-actions/publish-actions-cache-used to flag cache usage in publish workflows.
    • Add corresponding test fixtures under rules/test/....
  • Changelog & Config
    • Update CHANGELOG.md with multi-language support and repo consolidation; update links.
    • Update package.json (add lint:changelog, bump @metamask/auto-changelog).

Written by Cursor Bugbot for commit a5b3e0d. This will update automatically on new commits. Configure here.

@witmicko witmicko requested a review from a team as a code owner October 24, 2025 15:19
@socket-security
Copy link

socket-security bot commented Oct 24, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • istanbul-lib-report@3.0.1
  • convert-source-map@2.0.0
  • @babel/plugin-syntax-import-meta@7.10.4
  • @babel/plugin-syntax-logical-assignment-operators@7.10.4
  • @babel/plugin-syntax-numeric-separator@7.10.4
  • @octokit/request@8.4.1
  • babel-plugin-istanbul@7.0.1
  • jest-haste-map@30.2.0
  • jest-worker@30.2.0
  • @babel/core@7.28.5

View full report

cursor[bot]

This comment was marked as outdated.

@witmicko witmicko force-pushed the monorepo-semgrep-action branch from 1899e28 to 507f179 Compare October 24, 2025 16:12
cursor[bot]

This comment was marked as outdated.

@witmicko witmicko force-pushed the monorepo-semgrep-action branch from e1fa3a7 to 980be76 Compare October 24, 2025 16:33
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@EllusionN EllusionN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should bring over the CI tests to this repository as well: https://github.com/MetaMask/semgrep-action/blob/main/.github/workflows/test.yml

@witmicko witmicko force-pushed the monorepo-semgrep-action branch from 980be76 to 26ff398 Compare October 28, 2025 12:01
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@witmicko witmicko force-pushed the monorepo-semgrep-action branch from 9f9c16a to 8998866 Compare October 28, 2025 14:47
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@EllusionN EllusionN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you open a follow up PR adding the remaining semgrep rules?

Copy link
Contributor

@EllusionN EllusionN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting CI failure due to linting errors

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@socket-security
Copy link

socket-security bot commented Oct 28, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​auto-changelog@​4.1.0 ⏵ 5.1.0100 +2100100 +1100 +13100

View full report

cursor[bot]

This comment was marked as outdated.

@witmicko
Copy link
Contributor Author

@SocketSecurity ignore npm/@octokit/request@8.4.1
@SocketSecurity ignore npm/babel-plugin-istanbul@7.0.1
@SocketSecurity ignore npm/jest-haste-map@30.2.0
@SocketSecurity ignore npm/jest-worker@30.2.0
build and cli tools, ok

@SocketSecurity ignore npm/@babel/plugin-syntax-import-meta@7.10.4
@SocketSecurity ignore npm/@babel/plugin-syntax-logical-assignment-operators@7.10.4
@SocketSecurity ignore npm/@babel/plugin-syntax-numeric-separator@7.10.4
@SocketSecurity ignore npm/convert-source-map@2.0.0
@SocketSecurity ignore npm/istanbul-lib-report@3.0.1
authors ok

@SocketSecurity ignore npm/@babel/core@7.28.5
@SocketSecurity ignore npm/istanbul-lib-report@3.0.1

@witmicko witmicko merged commit 6f2836e into v2 Oct 29, 2025
11 checks passed
@witmicko witmicko deleted the monorepo-semgrep-action branch October 29, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants