> For the complete documentation index, see [llms.txt](https://docs.mobb.ai/mobb-user-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mobb.ai/mobb-user-docs/integrating-sast-findings/semgrep-opengrep/generating-an-opengrep-sast-report.md).

# Generating an Opengrep SAST Report

## **Introduction**

[Opengrep](https://github.com/opengrep/opengrep) is an open-source static analysis tool. You can read more about the Opengrep project [here](https://www.opengrep.dev/).

This guide covers:

1. **Running a basic Opengrep scan** using default rules.
2. **Generating and using a SARIF report.**

***

## **Prerequisites**

Before starting, ensure the following

* **Linux, macOS,** or **Windows**
* **Internet access** to download Opengrep

## **Installing and Running Opengrep**

#### **Step 1: Download Opengrep**

Use `wget` to download the latest release:

```bash
wget https://github.com/opengrep/opengrep/releases/download/v1.0.0-alpha.15/opengrep_manylinux_x86 -O opengrep
```

💡 *Replace the version number if a newer release is available on the* [*Opengrep releases page*](https://github.com/opengrep/opengrep/releases)*.*

#### **Step 2: Make Opengrep Executable**

```bash
chmod +x opengrep
```

This step ensures the binary has the necessary permissions to run.

***

## **Running an Opengrep Scan**

#### **Step 1: Clone Your Target Repository**

For example:

```bash
git clone https://github.com/WebGoat/WebGoat
cd WebGoat
```

💡 *Replace `WebGoat` with your actual project repository.*

#### **Step 2: Run the Opengrep Scan**

```bash
./opengrep ci --sarif --sarif-output opengrep_report.sarif --config auto
```

This will scan the repository and generate a **SARIF report (`opengrep_report.sarif`)** in the current directory.
