> ## Documentation Index
> Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Supply Chain requirements and feature support

> This document discusses the requirements to use Supply Chain and the features supported by Semgrep Supply Chain.

Supply Chain begins the scan process by parsing the manifest file (Describes dependencies used in a codebase. Package managers read manifest files to resolve and install specific dependency versions and generate lockfiles.) or lockfile (Describes a dependency tree to ensure installs use the same dependencies and exact versions. Lockfiles include versions of dependencies and transitive dependencies and are generated by package managers like pip or npm.). For projects without a lockfile or an incomplete lockfile, Supply Chain's Dynamic Dependency Resolution provides a complete inventory of dependencies (Publicly available code used as part of your application. Dependencies are listed in registries such as npm for JavaScript and PyPI for Python.). The following sections list the requirements for both projects with and without lockfiles, as well as the features available to you based on your project's language and package manager (Software that interacts with a package registry to download, upload, or search for dependencies. Package managers typically generate manifest files or lockfiles.).

## Package manager support

> [!NOTE]
>
> See [Supported languages](https://docs.semgrep.dev/supported-languages) for language-level coverage and feature maturity.

> [!WARNING]
>
> **Dynamic Dependency Resolution doesn't work on Windows**
>
> [Dynamic Dependency Resolution](https://docs.semgrep.dev/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta) (`--allow-local-builds`) isn't supported on Windows for any language or package manager.
>
> * **On Windows:** Supply Chain scans only the lockfiles and manifest files in the following table that don't require Dynamic Dependency Resolution.
> * **To scan projects without lockfiles:** Run Semgrep on Linux or macOS, such as on a Linux CI runner.

The following table lists all Semgrep-supported package managers for each language. Languages with **reachability (Whether a vulnerable code pattern from a dependency is used in the codebase that imports it. Semgrep Supply Chain requires both a vulnerable version and a matching pattern for reachability.)** support are listed first.

<table>
  <thead>
    <tr>
      <th>Language</th>
      <th>Supported package managers</th>
      <th>Manifest file or lockfile</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>C#</td>
      <td>NuGet</td>
      <td>`packages.lock.json` on Managed Scans, in your own CI, and on a local machine. Without `packages.lock.json`, [Dynamic
      Dependency Resolution](https://docs.semgrep.dev/docs/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta) uses `.csproj` in your own CI or on a local machine. If both files exist, Semgrep uses the lockfile. Managed Scans doesn't support Dynamic Dependency Resolution for NuGet.</td>
    </tr>

    <tr>
      <td>Go</td>
      <td>Go modules (`go mod`)</td>
      <td>`go.mod`</td>
    </tr>

    <tr>
      <td rowspan="2">Java</td>
      <td>Gradle</td>
      <td>`gradle.lockfile` **or** \
      `build.gradle` or
      `build.gradle.kts` through [Dynamic
      Dependency Resolution](https://docs.semgrep.dev/docs/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta).</td>
    </tr>

    <tr>
      <td>Maven</td>
      <td>Maven-generated dependency tree (see [Setting up SSC scans for Apache Maven](https://docs.semgrep.dev/docs/semgrep-supply-chain/setup-maven.md) for instructions) **or** \
      `pom.xml` through [Dynamic
      Dependency Resolution](https://docs.semgrep.dev/docs/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta).</td>
    </tr>

    <tr>
      <td rowspan="4">JavaScript or TypeScript</td>
      <td>npm</td>
      <td>`package-lock.json`</td>
    </tr>

    <tr>
      <td>Yarn</td>
      <td>`yarn.lock`</td>
    </tr>

    <tr>
      <td>pnpm</td>
      <td>`pnpm-lock.yaml`</td>
    </tr>

    <tr>
      <td>Bun</td>
      <td>`package.json` and `bun.lock`. Both files must be present. Bun 1.2 and later create `bun.lock` by default. The older binary `bun.lockb` format isn't supported. See [Bun's lockfile documentation](https://bun.com/docs/pm/lockfile) to migrate.</td>
    </tr>

    <tr>
      <td rowspan="2">Kotlin</td>
      <td>Gradle</td>
      <td>`gradle.lockfile`</td>
    </tr>

    <tr>
      <td>Maven</td>
      <td>Maven-generated dependency tree (See [Setting up SSC scans for Apache Maven](https://docs.semgrep.dev/docs/semgrep-supply-chain/setup-maven.md) for instructions.)</td>
    </tr>

    <tr>
      <td rowspan="5">Python</td>
      <td>pip</td>
      <td rowspan="2"><ul><li>A `*requirement*.txt`, `*requirement*.pip`, `**/requirements/*.txt`, or `**/requirements/*.pip` with dependencies pinned†</li><li>`setup.py` with [Dynamic
      Dependency Resolution.](https://docs.semgrep.dev/docs/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta)</li></ul></td>
    </tr>

    <tr>
      <td>pip-tools</td>
    </tr>

    <tr>
      <td>Pipenv</td>
      <td>`Pipfile.lock`</td>
    </tr>

    <tr>
      <td>Poetry</td>
      <td>`poetry.lock`</td>
    </tr>

    <tr>
      <td>uv</td>
      <td>`uv.lock`</td>
    </tr>

    <tr>
      <td>Ruby</td>
      <td>RubyGems</td>
      <td>`Gemfile.lock`</td>
    </tr>

    <tr>
      <td>Scala</td>
      <td>Maven</td>
      <td>Maven-generated dependency tree (See [Setting up SSC scans for Apache Maven](https://docs.semgrep.dev/docs/semgrep-supply-chain/setup-maven.md) for instructions.)</td>
    </tr>

    <tr>
      <td>Swift</td>
      <td>SwiftPM</td>
      <td>`Package.swift` file and Swift-generated `Package.resolved` file. (See [Swift documentation ](https://www.swift.org/documentation/package-manager/) for instructions.)</td>
    </tr>

    <tr>
      <td>Rust</td>
      <td>Cargo‡</td>
      <td>`cargo.lock`</td>
    </tr>

    <tr>
      <td>Dart</td>
      <td>Pub</td>
      <td>`pubspec.lock`</td>
    </tr>

    <tr>
      <td>Elixir</td>
      <td>Hex</td>
      <td>`mix.exs` and `mix.lock`. Both files must be present.</td>
    </tr>

    <tr>
      <td>PHP</td>
      <td>Composer</td>
      <td>`composer.lock`</td>
    </tr>
  </tbody>
</table>

***†**Supply Chain can treat `requirements.txt` as a lockfile with pip-compiled output and fully pinned dependencies, or as a manifest file with more flexible specifiers. Semgrep includes every dependency declared in `requirements.txt` in the dependency inventory and SBOM, but only dependencies pinned to an exact version with `==` produce Supply Chain findings. Dependencies with non-exact specifiers, such as `>=`, `>`, or `~=`, or with no version, appear with their declared specifier but have no resolved version to check against advisories. To get findings for these dependencies, use the [`--allow-local-builds` flag](https://docs.semgrep.dev/semgrep-supply-chain/set-up-and-configure#dynamic-dependency-resolution-beta) when you run your scan. The `--allow-local-builds` flag doesn't work on Windows, so on Windows, pin all dependencies with `==` to get findings for them.*\
\

***‡**Supply Chain does not analyze the transitivity of packages for these language and manifest file or lockfile combinations. All dependencies are listed as **No reachability (Whether a vulnerable code pattern from a dependency is used in the codebase that imports it. Semgrep Supply Chain requires both a vulnerable version and a matching pattern for reachability.) Analysis.***

## Feature availability

The following sections discuss the features supported by Supply Chain and available to you based on your project's language, package manager, and lockfile or manifest file availability.

For projects with lockfiles, Semgrep parses lockfiles for dependencies, then scans your codebase for reachable findings based on the lockfiles. For a lockfile to be scanned by Semgrep Supply Chain, it must have one of the supported lockfile names.

For some languages, a lockfile or manifest file is required to determine accurately transitivity (Describes a dependency's relationship to your codebase or first-party code. Semgrep uses Direct, Transitive, and Undetermined transitivity.). See [Transitive dependencies and reachability analysis](https://docs.semgrep.dev/semgrep-supply-chain/overview.md#transitive-dependencies-and-reachability-analysis) for more information.

Semgrep offers beta support for the scanning of projects written in several languages without lockfiles using Dynamic Dependency Resolution. See the table in the following section for more information.

### Features for supported languages

The following table lists all Supply Chain features for each language. Languages with **reachability** support are listed first.

<table>
  <thead>
    <tr>
      <th>Language</th>
      <th align="center">Reachability\
      (see [CVE coverage](#cve-coverage))</th>
      <th>[Dynamic dependency resolution (beta)](https://docs.semgrep.dev/docs/semgrep-supply-chain/set-up-and-configure.md#dynamic-dependency-resolution-beta)</th>
      <th>License detection</th>
      <th>Malicious dependency\
      detection</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>C#</td>
      <td align="center">✅</td>
      <td align="center">✅\
      `.csproj` in your own CI or on a local machine when `packages.lock.json` isn't present. If both files exist, Semgrep uses the lockfile.\
      Not supported on Managed Scans</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Go</td>
      <td align="center">✅</td>
      <td align="center">--</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Java</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>JavaScript or TypeScript</td>
      <td align="center">✅</td>
      <td align="center">--</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Kotlin</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>Python</td>
      <td align="center">✅</td>
      <td align="center">✅\
      `setup.py` in CLI or CI</td>
      <td align="center">✅\
      For PyPi only</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Ruby</td>
      <td align="center">✅</td>
      <td align="center">--</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Scala</td>
      <td align="center">✅</td>
      <td align="center">✅\
      SBT in CLI or CI</td>
      <td align="center">✅</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>Swift</td>
      <td align="center">✅</td>
      <td align="center">--</td>
      <td align="center">✅†</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>PHP</td>
      <td align="center">✅</td>
      <td align="center">--</td>
      <td align="center">✅</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>Rust</td>
      <td align="center" width="180px" rowspan="3">No reachability analysis. However, Semgrep can compare a package's version against a list of versions with known vulnerabilities.</td>
      <td align="center">--</td>
      <td align="center">✅</td>
      <td align="center">✅</td>
    </tr>

    <tr>
      <td>Dart</td>
      <td align="center">--</td>
      <td align="center">--</td>
      <td align="center">--</td>
    </tr>

    <tr>
      <td>Elixir</td>
      <td align="center">--</td>
      <td align="center">--</td>
      <td align="center">--</td>
    </tr>
  </tbody>
</table>

***†**License detection for new packages is asynchronous and processed after the initial scan. Policies aren't applied on first detection, but are enforced in subsequent scans.*

### Common vulnerabilities and exposures (CVE) coverage

For customers with an active paid subscription, Semgrep's reachability analysis
covers all **critical and high severity** CVEs from [supported sources](#supported-sources)
starting in 2017 across all supported languages.

#### Supported sources

* [ Reviewed GitHub Security Advisories](https://github.com/advisories?query=type%3Areviewed)
* [ Electron release notes](https://releases.electronjs.org/releases/stable)
* [ OSV](http://osv.dev/)
