Metadata-Version: 2.4
Name: secguard-cli
Version: 1.1.0
Summary: Hybrid AI-assisted SAST CLI tool for source code and dependencies
Author: Ömer Yiğit Hardal
License: MIT
Project-URL: Homepage, https://github.com/omeryigithardal53/secguard
Project-URL: Repository, https://github.com/omeryigithardal53/secguard
Project-URL: Issues, https://github.com/omeryigithardal53/secguard/issues
Keywords: security,sast,static-analysis,vulnerability-scanner,devsecops,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.7.0
Requires-Dist: openai>=1.30.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: tree-sitter>=0.23.0
Requires-Dist: tree-sitter-javascript>=0.23.0
Requires-Dist: tree-sitter-typescript>=0.23.0
Requires-Dist: tree-sitter-php>=0.23.0
Requires-Dist: tree-sitter-c>=0.23.0
Dynamic: license-file

# 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:

```bash
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)

```bash
pip install secguard-cli
# or
pipx install secguard-cli
```

### Option 3: Developer Install (From Source)

```bash
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

```bash
# 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:

```bash
pytest -v
```

## Author & License

- **Author:** Ömer Yiğit Hardal ([@omeryigithardal53](https://github.com/omeryigithardal53))
- **License:** MIT License — See the `LICENSE` file for copyright details.
