SecGuard — AI-Assisted SAST CLI Tool
SecGuard is a command-line Static Application Security Testing (SAST) tool that scans source code and configuration files prior to production deployment to detect security vulnerabilities, filter out false positives, and generate validated remediation patches.
Key Features
- Multi-Language Static Analysis: Detects 15+ OWASP Top 10 vulnerability categories (SQLi, Command Injection, SSTI, Path Traversal, SSRF, XXE, Insecure Deserialization, Hardcoded Secrets, etc.) across Python, JavaScript/TypeScript, PHP, C, and Dockerfile targets.
- Advanced Python AST & Data-Flow Analysis: Resolves obfuscated calls via constant folding, dictionary/variable unpacking (
**kwargs), and cross-file/intra-class taint tracking while distinguishing safe sanitization patterns.
- Batch LLM Triage & Automatic Failover: Groups findings per file into single batch requests and automatically fails over to fallback models or local Ollama instances when Groq API rate limits are reached.
- Validated Auto-Patching & Rollback: Applies verified security patches bottom-up in a single pass and automatically rolls back changes if syntax or test validation fails.
- DevSecOps & CI/CD Integration: Includes Git commit history secret scanning,
--fail-on severity threshold gating, dependency vulnerability auditing, and GitHub Security-compatible SARIF v2.1.0 reporting.
Installation
Option 1: One-Line Quick Install (Linux / macOS)
Installs the global secguard CLI directly without manually creating a virtual environment:
curl -fsSL [https://raw.githubusercontent.com/omeryigithardal53/secguard/main/install.sh](https://raw.githubusercontent.com/omeryigithardal53/secguard/main/install.sh) | bash
Once installed, open a new terminal or run source ~/.zshrc (source ~/.bashrc for Bash).
Option 2: Install via pip or pipx (PyPI)
pip install secguard-cli
# or
pipx install secguard-cli
Option 3: Developer Install (From Source)
git clone [https://github.com/omeryigithardal53/secguard.git](https://github.com/omeryigithardal53/secguard.git)
cd secguard
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage Examples
# Configure API key (Groq) or local Ollama provider
secguard config
# Scan a file or project directory
secguard scan path/to/project
# Review and apply validated patches for detected vulnerabilities
secguard fix path/to/file.py --apply
# Fail CI/CD pipeline on HIGH+ findings and export a SARIF report
secguard scan . --fail-on high --format sarif -o secguard-results.sarif
# Scan Git commit history for leaked secrets
secguard scan . --git-history
Verification & Tests
Verified with 116 automated tests covering static analysis rules, indirect data-flow scenarios, false-positive guards, patch rollback mechanisms, and CI/CD outputs:
pytest -v
Author & License
- Author: Ömer Yiğit Hardal (@omeryigithardal53)
- License: MIT License — See the
LICENSE file for copyright details.