Skip to content

Update converted SAST analyzers with new rules from upstream

Proposal

Conduct a one-time census to identify rules added upstream after we converted open-source analyzers to Semgrep-based scanning. Add rules whenever feasible.

  • Bandit
  • Gosec
  • SpotBugs/find-sec-bugs
  • eslint
  • security-code-scan

Implementation Plan

Steps

  1. Pull the newly added rules from the Upstream, excluding the rules which could not be translated due to Semgrep limitations.
  2. Translate these rules into Semgrep-equivalent rules and add them along with the mapping of native analyzer's IDs into sast-rules repository.
  3. Generate a new ruleset distribution using the instructions described here.
  4. Copy over the new ruleset distribution into Semgrep/rules to reflect rule changes in the Analyzer. NOTE: Follow this step only until gitlab-org/security-products/analyzers/semgrep!147 (closed) is merged.

New Rules from Upstream

There are a few new rules across the above-mentioned upstreams that are as follows:

A task is created for each analyzer in this issue to track the progress of the sync process.

Edited by Vishwa Bhat