secguard-cli 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
secguard/test.py ADDED
@@ -0,0 +1,5 @@
1
+ from yaml import load as parse
2
+ decoder = parse
3
+
4
+ def read_document(document):
5
+ return decoder(document)
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: secguard-cli
3
+ Version: 1.1.0
4
+ Summary: Hybrid AI-assisted SAST CLI tool for source code and dependencies
5
+ Author: Ömer Yiğit Hardal
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/omeryigithardal53/secguard
8
+ Project-URL: Repository, https://github.com/omeryigithardal53/secguard
9
+ Project-URL: Issues, https://github.com/omeryigithardal53/secguard/issues
10
+ Keywords: security,sast,static-analysis,vulnerability-scanner,devsecops,cli
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Security
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: typer>=0.12.0
25
+ Requires-Dist: rich>=13.7.0
26
+ Requires-Dist: openai>=1.30.0
27
+ Requires-Dist: httpx>=0.27.0
28
+ Requires-Dist: tree-sitter>=0.23.0
29
+ Requires-Dist: tree-sitter-javascript>=0.23.0
30
+ Requires-Dist: tree-sitter-typescript>=0.23.0
31
+ Requires-Dist: tree-sitter-php>=0.23.0
32
+ Requires-Dist: tree-sitter-c>=0.23.0
33
+ Dynamic: license-file
34
+
35
+ # SecGuard — AI-Assisted SAST CLI Tool
36
+
37
+ **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.
38
+
39
+ ## Key Features
40
+
41
+ - **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.
42
+ - **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.
43
+ - **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.
44
+ - **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.
45
+ - **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.
46
+
47
+ ## Installation
48
+
49
+ ### Option 1: One-Line Quick Install (Linux / macOS)
50
+ Installs the global `secguard` CLI directly without manually creating a virtual environment:
51
+
52
+ ```bash
53
+ curl -fsSL [https://raw.githubusercontent.com/omeryigithardal53/secguard/main/install.sh](https://raw.githubusercontent.com/omeryigithardal53/secguard/main/install.sh) | bash
54
+ ```
55
+
56
+ Once installed, open a new terminal or run `source ~/.zshrc` (`source ~/.bashrc` for Bash).
57
+
58
+ ### Option 2: Install via `pip` or `pipx` (PyPI)
59
+
60
+ ```bash
61
+ pip install secguard-cli
62
+ # or
63
+ pipx install secguard-cli
64
+ ```
65
+
66
+ ### Option 3: Developer Install (From Source)
67
+
68
+ ```bash
69
+ git clone [https://github.com/omeryigithardal53/secguard.git](https://github.com/omeryigithardal53/secguard.git)
70
+ cd secguard
71
+ python3 -m venv .venv
72
+ source .venv/bin/activate
73
+ pip install -e .
74
+ ```
75
+
76
+ ## Usage Examples
77
+
78
+ ```bash
79
+ # Configure API key (Groq) or local Ollama provider
80
+ secguard config
81
+
82
+ # Scan a file or project directory
83
+ secguard scan path/to/project
84
+
85
+ # Review and apply validated patches for detected vulnerabilities
86
+ secguard fix path/to/file.py --apply
87
+
88
+ # Fail CI/CD pipeline on HIGH+ findings and export a SARIF report
89
+ secguard scan . --fail-on high --format sarif -o secguard-results.sarif
90
+
91
+ # Scan Git commit history for leaked secrets
92
+ secguard scan . --git-history
93
+ ```
94
+
95
+ ## Verification & Tests
96
+
97
+ Verified with **116 automated tests** covering static analysis rules, indirect data-flow scenarios, false-positive guards, patch rollback mechanisms, and CI/CD outputs:
98
+
99
+ ```bash
100
+ pytest -v
101
+ ```
102
+
103
+ ## Author & License
104
+
105
+ - **Author:** Ömer Yiğit Hardal ([@omeryigithardal53](https://github.com/omeryigithardal53))
106
+ - **License:** MIT License — See the `LICENSE` file for copyright details.
@@ -0,0 +1,15 @@
1
+ secguard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ secguard/ai_engine.py,sha256=Zhpxg8JX_OXNP8_vrHO864TTjbCbYc14cAXCzkdXWu8,57409
3
+ secguard/cli.py,sha256=iUc4EyinGXvVUYu-BfdP6II__NoFCCw_BgLdwP682Lk,31661
4
+ secguard/config.py,sha256=iG9qTgwt0pfPsaSmO35mHK-tnINmaQQibiVverbDcKk,5603
5
+ secguard/dependency_scanner.py,sha256=jOWzEwpJyzaNpVox6yl2hVDKijxz2L_dw2gEz6b0Vuc,18528
6
+ secguard/patcher.py,sha256=8eyfAE60m_8ZJ9PTrBA4OokVPccH49x_axI_of8Vw1w,24193
7
+ secguard/reporter.py,sha256=pfaF1LIQyw-lJHtn8AZmgwmQHuWj5nx0mrh8JjQfiqE,9262
8
+ secguard/scanner.py,sha256=J8repzjcnAnNUYDe8LVNyH0p0px9LrA10mp51S60N5w,225974
9
+ secguard/test.py,sha256=ZgwP8qVnqBISiw8jg5Mun5U2e89MUNVnLDAM_SY09mQ,106
10
+ secguard_cli-1.1.0.dist-info/licenses/LICENSE,sha256=Kj004WIrTMpeE9vUlWU1AvF4ybGCWxanl8eOLGOn11k,1076
11
+ secguard_cli-1.1.0.dist-info/METADATA,sha256=wB8QVq4xCZLT8KoYGok8Q9y6p3S2vcc17D_y26OBMLY,4490
12
+ secguard_cli-1.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
13
+ secguard_cli-1.1.0.dist-info/entry_points.txt,sha256=Lj1oRFpFhtRPJG7SbzeO1DTPFLt0ShvT_-GkKCkr4mo,46
14
+ secguard_cli-1.1.0.dist-info/top_level.txt,sha256=Qs6S7gJkUqBzGf3UwMzRZUXLCokE7lkQEupB568gKlY,9
15
+ secguard_cli-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ secguard = secguard.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ömer Yiğit Hardal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ secguard