Opengrep is a fork of Semgrep that stays open-source under the LGPL 2.1 license. It aims to keep advanced static analysis accessible for every developer and organization. The project is backed by a coalition of AppSec vendors (Aikido.dev, Arnica, Amplify, Endor, Jit, Kodem, Mobb, Orca Security) and welcomes additional sponsors and contributors. Read the full manifesto at opengrep.dev.
- Ultra-fast, semantic code search across 30+ languages (Apex, Bash, C/C++, C#, Dart, Dockerfile, Elixir, Go, Java, JS/TS/TSX, Kotlin, PHP, Python, Ruby, Rust, Scala, Swift, Terraform, YAML, XML, etc.).
- Flexible rule syntax for security findings or custom linting.
- Produces SARIF output that we can archive alongside Lighthouse and coverage reports.
curl -fsSL https://raw.githubusercontent.com/opengrep/opengrep/main/install.sh | bashAlternative installation options:
- Clone the repository and run
./install.sh. - Download platform-specific binaries from the release page.
-
Create or configure rule packs (default path:
opengrep-rules/). -
Execute the PNPM script:
pnpm run security:opengrep
The script accepts optional environment variables:
Variable Default Description OPENGREP_CMDopengrepCustom path or wrapper command OPENGREP_RULESopengrep-rulesDirectory or file of rules ( -fargument)OPENGREP_TARGET.Path to scan OPENGREP_SARIF_OUTPUTreports/security/opengrep/latest-report.sarifSARIF output path -
The pre-commit hook runs
pnpm run security:scan, which now includessecurity:opengrep. Missing binaries are logged as warnings rather than blocking commits.
# rules/demo-rust-unwrap.yaml
rules:
- id: unwrapped-result
pattern: $VAR.unwrap()
message: "Unwrap detected - potential panic risk"
languages: [rust]
severity: WARNING// code/rust/main.rs
fn divide(a: i32, b: i32) -> Result<i32, String> {
if b == 0 {
return Err("Division by zero".to_string());
}
Ok(a / b)
}
fn main() {
let result = divide(10, 0).unwrap(); // Risky unwrap!
println!("Result: {}", result);
}Run:
pnpm run security:opengrepThe scan reports the risky unwrap and the SARIF summary is stored under
reports/security/opengrep/.
pnpm run archive:opengrepcopies the latest SARIF output intoreports/security/history/<yyyy-mm-dd>/opengrep-<timestamp>.sarif.pnpm run archive:securityruns Trivy, OWASP, and Opengrep archives together.
Join the open roadmap sessions or sponsor the initiative via the Opengrep GitHub repository. Issues and PRs are welcome to expand rule libraries, improve the CLI, or integrate with additional tooling.