Skip to content
ES EN

SAST Scan

Static Application Security Testing (SAST) examines source code to detect vulnerabilities without executing the application. Gerion uses Opengrep with rules from the Semgrep Registry.

Run

Ventana de terminal
gerion sast-scan [PATH]
Ventana de terminal
# Scan the current directory
gerion sast-scan .
# Save results as SARIF
gerion sast-scan . --format sarif --output-file sast.sarif
# Send results to the Gerion API
gerion sast-scan . --api-url $GERION_API_URL --api-key $GERION_API_KEY

Supported languages

LanguageExtensions
Python.py
JavaScript.js, .jsx, .mjs
TypeScript.ts, .tsx
Java.java
Go.go
C.c, .h
C++.cpp, .cc, .cxx, .hpp
C#.cs
PHP.php
Ruby.rb
Kotlin.kt
Scala.scala
Rust.rs
Swift.swift
Dart.dart
Bash / Shell.sh, .bash
DockerfileDockerfile
Terraform.tf
YAML.yml, .yaml
JSON.json

Detected vulnerability types

CategoryExamples
InjectionSQL injection, command injection, LDAP injection
XSSReflected and stored cross-site scripting
AuthenticationHardcoded passwords, unsigned JWTs
CryptographyWeak algorithms (MD5, SHA1, RC4), static IVs
DeserializationUnsafe object deserialization
Path traversalFile access outside the allowed directory
SSRFServer-side request forgery
LogicIncorrect security comparisons

Options

OptionDescription
--formatOutput format: json | markdown | sarif
--output-fileSave results to a file (disables API submission)
--api-urlGerion API Gateway URL
--api-keyM2M API key
--timeoutTimeout in seconds (default: 180)
--log-leveldebug | info | warning | error

Reading results

┌──────────────┬───────────────────────────────┬────────────────┐
│ Severity │ Rule │ File:Line │
├──────────────┼───────────────────────────────┼────────────────┤
│ 🔴 High │ python.lang.security.sql-inj │ db.py:42 │
│ 🟡 Medium │ javascript.crypto.weak-hash │ auth.js:15 │
└──────────────┴───────────────────────────────┴────────────────┘

For full descriptions and recommended mitigations, see the Gerion Dashboard.