devsecops-radar 0.4.0__tar.gz → 0.4.1__tar.gz

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.
Files changed (80) hide show
  1. devsecops_radar-0.4.1/PKG-INFO +579 -0
  2. devsecops_radar-0.4.1/README.md +542 -0
  3. devsecops_radar-0.4.1/devsecops_radar/cli/scanner.py +459 -0
  4. devsecops_radar-0.4.1/devsecops_radar/core/analyzer.py +227 -0
  5. devsecops_radar-0.4.1/devsecops_radar/core/attack_simulation.py +46 -0
  6. devsecops_radar-0.4.1/devsecops_radar/core/auth.py +39 -0
  7. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/database.py +12 -16
  8. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/models.py +19 -11
  9. devsecops_radar-0.4.1/devsecops_radar/core/notifier.py +61 -0
  10. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/remediation.py +17 -13
  11. devsecops_radar-0.4.1/devsecops_radar/core/reporting.py +100 -0
  12. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/rule_fusion.py +34 -27
  13. devsecops_radar-0.4.1/devsecops_radar/core/sarif_export.py +63 -0
  14. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/gitleaks.py +9 -6
  15. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/poutine.py +9 -6
  16. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/semgrep.py +9 -6
  17. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/trivy.py +9 -6
  18. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/zizmor.py +9 -6
  19. devsecops_radar-0.4.1/devsecops_radar/web/attack_paths/routes.py +59 -0
  20. devsecops_radar-0.4.1/devsecops_radar/web/dashboard/routes.py +2138 -0
  21. devsecops_radar-0.4.1/devsecops_radar/web/static/js/d3.v7.min.js +2 -0
  22. devsecops_radar-0.4.1/devsecops_radar/web/static/js/echarts.min.js +45 -0
  23. devsecops_radar-0.4.1/devsecops_radar.egg-info/PKG-INFO +579 -0
  24. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar.egg-info/SOURCES.txt +11 -2
  25. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar.egg-info/requires.txt +3 -0
  26. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/pyproject.toml +5 -1
  27. devsecops_radar-0.4.1/tests/test_analyzer.py +133 -0
  28. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/tests/test_api.py +5 -1
  29. devsecops_radar-0.4.1/tests/test_attack_simulation.py +41 -0
  30. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/tests/test_cli.py +4 -2
  31. devsecops_radar-0.4.1/tests/test_notifier.py +92 -0
  32. devsecops_radar-0.4.1/tests/test_sarif_export.py +103 -0
  33. devsecops_radar-0.4.1/tests/test_sbom.py +86 -0
  34. devsecops_radar-0.4.1/tests/test_scanner.py +155 -0
  35. devsecops_radar-0.4.1/tests/test_valuation.py +81 -0
  36. devsecops_radar-0.4.0/PKG-INFO +0 -583
  37. devsecops_radar-0.4.0/README.md +0 -549
  38. devsecops_radar-0.4.0/devsecops_radar/cli/scanner.py +0 -215
  39. devsecops_radar-0.4.0/devsecops_radar/core/analyzer.py +0 -183
  40. devsecops_radar-0.4.0/devsecops_radar/core/attack_simulation.py +0 -23
  41. devsecops_radar-0.4.0/devsecops_radar/core/auth.py +0 -32
  42. devsecops_radar-0.4.0/devsecops_radar/core/parser.py +0 -60
  43. devsecops_radar-0.4.0/devsecops_radar/core/reporting.py +0 -80
  44. devsecops_radar-0.4.0/devsecops_radar/web/attack_paths/routes.py +0 -43
  45. devsecops_radar-0.4.0/devsecops_radar/web/dashboard/routes.py +0 -664
  46. devsecops_radar-0.4.0/devsecops_radar.egg-info/PKG-INFO +0 -583
  47. devsecops_radar-0.4.0/tests/test_analyzer.py +0 -53
  48. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/LICENSE +0 -0
  49. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/__init__.py +0 -0
  50. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/cli/__init__.py +0 -0
  51. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/__init__.py +0 -0
  52. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/rag.py +0 -0
  53. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/sbom.py +0 -0
  54. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/settings.py +0 -0
  55. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/core/valuation.py +0 -0
  56. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/plugins/__init__.py +0 -0
  57. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/adapter.py +0 -0
  58. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/scanners/base.py +0 -0
  59. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/__init__.py +0 -0
  60. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/app.py +0 -0
  61. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/attack_paths/__init__.py +0 -0
  62. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/dashboard/__init__.py +0 -0
  63. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/sentry/routes.py +0 -0
  64. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/static/css/bootstrap.min.css +0 -0
  65. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/static/css/style.css +0 -0
  66. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/static/js/bootstrap.bundle.min.js +0 -0
  67. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/static/js/chart.umd.min.js +0 -0
  68. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/static/js/dashboard.js +0 -0
  69. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/summary/__init__.py +0 -0
  70. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/summary/routes.py +0 -0
  71. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/templates/index.html +0 -0
  72. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/topology/__init__.py +0 -0
  73. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar/web/topology/routes.py +0 -0
  74. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar.egg-info/dependency_links.txt +0 -0
  75. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar.egg-info/entry_points.txt +0 -0
  76. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/devsecops_radar.egg-info/top_level.txt +0 -0
  77. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/setup.cfg +0 -0
  78. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/tests/test_database.py +0 -0
  79. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/tests/test_rule_fusion.py +0 -0
  80. {devsecops_radar-0.4.0 → devsecops_radar-0.4.1}/tests/test_scanners.py +0 -0
@@ -0,0 +1,579 @@
1
+ Metadata-Version: 2.4
2
+ Name: devsecops-radar
3
+ Version: 0.4.1
4
+ Summary: Unified CI/CD Security Dashboard — Pipeline Sentinel
5
+ Author-email: Mehrdoost <70381337+Mehrdoost@users.noreply.github.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Mehrdoost/devsecops-radar
8
+ Project-URL: Source, https://github.com/Mehrdoost/devsecops-radar
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Topic :: Security
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: flask>=3.0
17
+ Requires-Dist: semgrep>=1.0
18
+ Requires-Dist: pyyaml>=6.0
19
+ Requires-Dist: requests>=2.31
20
+ Requires-Dist: loguru>=0.7
21
+ Requires-Dist: reportlab>=4.0
22
+ Requires-Dist: litellm>=1.50
23
+ Requires-Dist: sqlalchemy>=2.0
24
+ Requires-Dist: pydantic>=2.0
25
+ Requires-Dist: pyjwt>=2.8
26
+ Requires-Dist: httpx>=0.27
27
+ Requires-Dist: werkzeug>=3.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Requires-Dist: pytest-flask>=1.3; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
32
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
33
+ Requires-Dist: mypy>=1.9; extra == "dev"
34
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
35
+ Requires-Dist: pre-commit>=3.5; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ <div align="center">
39
+
40
+ # 🛡️ Pipeline Sentinel
41
+
42
+ **The Open‑Source DevSecOps Command Center — Unify, Analyse, Remediate.**
43
+
44
+ [![PyPI version](https://img.shields.io/pypi/v/devsecops-radar?style=for-the-badge&color=2196F3)](https://pypi.org/project/devsecops-radar/)
45
+ [![License](https://img.shields.io/github/license/Mehrdoost/devsecops-radar?style=for-the-badge&color=4CAF50)](LICENSE)
46
+ [![GitHub release](https://img.shields.io/github/v/release/Mehrdoost/devsecops-radar?include_prereleases&style=for-the-badge&color=FF9800)](https://github.com/Mehrdoost/devsecops-radar/releases)
47
+ [![CI](https://img.shields.io/github/actions/workflow/status/Mehrdoost/devsecops-radar/ci.yml?branch=main&style=for-the-badge&color=9C27B0)](https://github.com/Mehrdoost/devsecops-radar/actions)
48
+ [![codecov](https://codecov.io/gh/Mehrdoost/devsecops-radar/branch/main/graph/badge.svg?token=TOKEN&style=for-the-badge)](https://codecov.io/gh/Mehrdoost/devsecops-radar)
49
+ [![Stars](https://img.shields.io/github/stars/Mehrdoost/devsecops-radar?style=for-the-badge&color=FFEB3B)](https://github.com/Mehrdoost/devsecops-radar/stargazers)
50
+
51
+ <br>
52
+
53
+ > 📖 **Read this in:** [Русский](README_ru.md) | [中文](README_zh.md) | [العربية](README_ar.md)
54
+
55
+ <br>
56
+
57
+ *Severity doughnut, trend line chart, attack‑path graph (clickable nodes), topology view, executive summary, and attack simulation panel — all fully offline.*
58
+
59
+ ![Pipeline Sentinel Dashboard](docs/Demo.gif)
60
+
61
+ </div>
62
+
63
+ ---
64
+
65
+ <details>
66
+ <summary><b>📑 Table of Contents (Click to expand)</b></summary>
67
+
68
+ 1. [What Is Pipeline Sentinel? (Simple Explanation)](#-what-is-pipeline-sentinel-simple-explanation)
69
+ 2. [Why You Need It](#-why-you-need-it)
70
+ 3. [Where to Run It in Your Network](#-where-to-run-it-in-your-network)
71
+ 4. [Dashboard Preview](#-dashboard-preview)
72
+ 5. [Quick Start](#-quick-start)
73
+ 6. [Prerequisites](#-prerequisites)
74
+ 7. [Installation](#-installation)
75
+ 8. [How to Use (Step‑by‑Step)](#-how-to-use-stepbystep)
76
+ 9. [Complete Command Reference](#-complete-command-reference)
77
+ 10. [Core Capabilities](#-core-capabilities)
78
+ 11. [Community Rules & Online Updates](#-community-rules--online-updates)
79
+ 12. [Attack Simulation & What‑If Analysis](#-attack-simulation--what‑if-analysis)
80
+ 13. [Security Hardening (v0.4.1)](#-security-hardening-v060)
81
+ 14. [Architecture](#-architecture)
82
+ 15. [Roadmap](#-roadmap)
83
+ 16. [Testing & CI](#-testing--ci)
84
+ 17. [Security Policy](#-security-policy)
85
+ 18. [Contributing](#-contributing)
86
+ 19. [Code of Conduct](#-code-of-conduct)
87
+ 20. [Author](#-author)
88
+ 21. [License](#-license)
89
+
90
+ </details>
91
+
92
+ ---
93
+
94
+ ## 👨‍👩‍👧 What Is Pipeline Sentinel? (Simple Explanation)
95
+
96
+ > **Imagine you have several security guards**, each watching a different door of a building. They all shout their findings in different languages, and you have to run around to understand what’s going on.
97
+
98
+ **Pipeline Sentinel** puts them all in one room, translates their reports, and shows you a single, clear screen with the full picture. It connects to tools like **Trivy** (checks your containers), **Semgrep** (scans your code), **Poutine** (audits your GitLab pipelines), **Zizmor** (secures your GitHub Actions), and **Gitleaks** (finds secrets).
99
+
100
+ Instead of digging through multiple JSON files, you get a **beautiful, dark‑mode command‑center dashboard** that tells you what’s critical, how risks are trending, and even how an attacker might chain several small issues into a big problem.
101
+
102
+ *Think of it as a **security camera system for your entire CI/CD pipeline** — it watches everything, alerts you, suggests fixes, and even lets you simulate attack chains, all without needing internet access if you want.*
103
+
104
+ ---
105
+
106
+ ## 💥 Why You Need It
107
+
108
+ In 2026, **supply chain attacks** have become the #1 threat. Tools like Trivy themselves were compromised, and attackers now inject malicious code directly into build pipelines. **You can no longer just scan your code; you must scan your pipeline.**
109
+
110
+ **Pipeline Sentinel gives you:**
111
+ - ✅ **One screen for all scanners** – stop juggling log files.
112
+ - ✅ **AI that understands attack chains** – “A leaked secret + an old library = a disaster.”
113
+ - ✅ **Automatic fixes** – with a single flag, it patches files and opens a pull request (with backup).
114
+ - ✅ **Human review mode** – inspect each fix before applying.
115
+ - ✅ **Compliance reports** – generate a PDF for your boss or auditor.
116
+ - ✅ **Attack simulation** – tick a few findings and see a generated attack script.
117
+ - ✅ **100% offline capable** – works in air‑gapped environments where security matters most.
118
+ - ✅ **Interactive wizard** – one command to get everything running.
119
+ - ✅ **Community rules marketplace** – pull curated detection rules from the community.
120
+
121
+ ---
122
+
123
+ ## 📍 Where to Run It in Your Network
124
+
125
+ Pipeline Sentinel is designed to be **flexible** — you decide where it fits best:
126
+
127
+ | Deployment | Description |
128
+ | :--- | :--- |
129
+ | 🖥️ **Local Developer Machine** | Run the CLI and dashboard right on your laptop. Perfect for individual pentesters or developers who want instant feedback. |
130
+ | 🔧 **CI/CD Runner** | Use the GitHub Action or call `devsecops-radar` directly in your Jenkins/GitLab CI scripts. It can fail the build if critical vulnerabilities exceed your policy (`--policy`). |
131
+ | 🏢 **Central Security Server** | Install on a dedicated server (via Docker or pip) that collects scan results from multiple teams. The dashboard becomes a shared security operations console. |
132
+ | 🌐 **Air‑Gapped Networks** | Copy the Docker image and sample data to an offline server. The dashboard works with zero external calls — all assets are embedded. |
133
+
134
+ <details>
135
+ <summary><b>🔍 View Typical Network Flow</b></summary>
136
+ <br>
137
+
138
+ ```text
139
+ [Trivy scan] ──┐
140
+ [Semgrep scan] ─┤
141
+ [Poutine scan] ─┼──> devsecops-radar (CLI) ──> findings.json ──> Dashboard (Flask) ──> Browser
142
+ [Zizmor scan] ─┘
143
+ [Gitleaks scan] ┘
144
+ ```
145
+ > **📌 Diagram Placeholder:** > ![Network Flow Diagram](docs/architecture-1.png)
146
+
147
+ </details>
148
+
149
+ ---
150
+
151
+ ## 📸 Dashboard Preview
152
+
153
+ *(See the animated demo at the top of this README for a live preview of the UI in action!)*
154
+
155
+ ---
156
+
157
+ ## 🚀 Quick Start
158
+
159
+ Get up and running in 3 simple steps:
160
+
161
+ ```bash
162
+ # 1. Install from PyPI
163
+ pip install devsecops-radar
164
+
165
+ # 2. Feed scanner data (sample data is included in the repo)
166
+ devsecops-radar --trivy sample_trivy.json --semgrep sample_semgrep.json
167
+
168
+ # 3. Launch the dashboard
169
+ devsecops-radar-web
170
+ ```
171
+ Open **http://localhost:8080** — your unified command center is live with sample findings.
172
+
173
+ > [!TIP]
174
+ > 🧙 **Want a fully guided setup?** Run the interactive wizard:
175
+ > ```bash
176
+ > devsecops-radar --wizard
177
+ > ```
178
+
179
+ ---
180
+
181
+ ## 📦 Installation
182
+
183
+ <details>
184
+ <summary><b>View All Installation Options (PyPI, Docker, Source, One-Command)</b></summary>
185
+ <br>
186
+
187
+ ### Option 1 — PyPI (Recommended)
188
+ ```bash
189
+ pip install devsecops-radar
190
+ ```
191
+
192
+ ### Option 2 — From Source
193
+ ```bash
194
+ git clone [https://github.com/Mehrdoost/devsecops-radar.git](https://github.com/Mehrdoost/devsecops-radar.git)
195
+ cd devsecops-radar
196
+ pip install -e ".[dev]"
197
+ ```
198
+
199
+ ### Option 3 — Docker
200
+ ```bash
201
+ docker pull ghcr.io/mehrdoost/devsecops-radar:latest
202
+ docker run -p 8080:8080 ghcr.io/mehrdoost/devsecops-radar:latest
203
+ ```
204
+ **Mount your own findings file:**
205
+ ```bash
206
+ docker run -p 8080:8080 -v $(pwd)/findings.json:/data/findings.json ghcr.io/mehrdoost/devsecops-radar:latest
207
+ ```
208
+ **Or use Docker Compose:**
209
+ ```bash
210
+ docker compose up
211
+ ```
212
+
213
+ ### 🧙 One‑Command Install (curl)
214
+ ```bash
215
+ curl -fsSL [https://raw.githubusercontent.com/Mehrdoost/devsecops-radar/main/install.sh](https://raw.githubusercontent.com/Mehrdoost/devsecops-radar/main/install.sh) | bash
216
+ ```
217
+ *This script installs Python dependencies, Ollama, pulls the AI model, and starts the wizard.*
218
+
219
+ </details>
220
+
221
+ ---
222
+
223
+ ## 📋 Prerequisites
224
+
225
+ > [!IMPORTANT]
226
+ > Pipeline Sentinel relies on external security tools to produce the JSON reports it consumes. You must install these tools separately according to your needs.
227
+
228
+ - **Required for offline scanning:** Trivy, Semgrep, Poutine, Zizmor, Gitleaks.
229
+ - **Optional:** Ollama (AI analysis), Docker (Sandboxing), OPA (Rego policy).
230
+
231
+ > 📖 **See `PREREQUISITES.md` for full installation details of these tools.**
232
+
233
+ ---
234
+
235
+ ## 🧭 How to Use (Step‑by‑Step)
236
+
237
+ <details open>
238
+ <summary><b>1. Run Your Security Scanners</b></summary>
239
+ <br>
240
+
241
+ Generate JSON output from your tools:
242
+ ```bash
243
+ trivy image --format json -o trivy.json nginx:latest
244
+ semgrep --config=auto --json --output semgrep.json .
245
+ poutine scan ./repo --format json --output poutine.json
246
+ zizmor scan ./repo --output zizmor.json --format json
247
+ gitleaks detect --source . --report-format json --report-path gitleaks.json
248
+ ```
249
+ </details>
250
+
251
+ <details open>
252
+ <summary><b>2. Merge Findings with the CLI</b></summary>
253
+ <br>
254
+
255
+ ```bash
256
+ devsecops-radar --trivy trivy.json --semgrep semgrep.json --poutine poutine.json --zizmor zizmor.json --gitleaks gitleaks.json
257
+ ```
258
+ *This produces a single `findings.json` with all findings merged and normalised.*
259
+ </details>
260
+
261
+ <details open>
262
+ <summary><b>3. View the Dashboard</b></summary>
263
+ <br>
264
+
265
+ ```bash
266
+ devsecops-radar-web
267
+ ```
268
+ **The dashboard shows:**
269
+ * **Severity Breakdown** – Doughnut chart with total count
270
+ * **Trend Over Time** – Line chart from scan history
271
+ * **Pipeline Security** – Poutine + Zizmor statistics card
272
+ * **Attack Path Graph** – Interactive D3.js graph (click nodes for details)
273
+ * **Executive Summary** – Risk score and AI‑generated summary
274
+ * **Findings Table** – Searchable, filterable, paginated, with checkboxes for simulation
275
+ </details>
276
+
277
+ <details>
278
+ <summary><b>4. Enable AI Analysis (Optional)</b></summary>
279
+ <br>
280
+
281
+ ```bash
282
+ ollama pull llama3.2:latest
283
+ devsecops-radar --trivy trivy.json --analyze
284
+ devsecops-radar-web
285
+ ```
286
+ The LLM generates `findings_ai_summary.json` containing: `executive_summary`, `risk_score`, `attack_paths` (with MITRE ATT&CK), `top_remediations`, and `false_positives_likely`.
287
+ </details>
288
+
289
+ <details>
290
+ <summary><b>5. Auto‑Remediation (with Human Review)</b></summary>
291
+ <br>
292
+
293
+ ```bash
294
+ # Apply fixes automatically
295
+ devsecops-radar --trivy trivy.json --analyze --fix
296
+
297
+ # Interactive step‑by‑step review
298
+ devsecops-radar --trivy trivy.json --analyze --fix --review
299
+ ```
300
+ > [!NOTE]
301
+ > *All modified files are backed up to `~/.devsecops-radar/backups/`. The tool creates a new git branch `auto-fix` and pushes it for review.*
302
+ </details>
303
+
304
+ <details>
305
+ <summary><b>6. Policy Enforcement</b></summary>
306
+ <br>
307
+
308
+ Create a `policy.json` file:
309
+ ```json
310
+ {
311
+ "max_critical": 5,
312
+ "on_violation": "fail"
313
+ }
314
+ ```
315
+ ```bash
316
+ devsecops-radar --trivy trivy.json --policy policy.json
317
+ ```
318
+ *If critical findings exceed 5, the command exits with code 1. You can also use OPA Rego policies (`--rego-policy`).*
319
+ </details>
320
+
321
+ <details>
322
+ <summary><b>7. Generate Compliance & Standard Reports</b></summary>
323
+ <br>
324
+
325
+ ```bash
326
+ # PDF report with compliance mapping
327
+ devsecops-radar --trivy trivy.json --analyze --compliance CIS --report cis-report.pdf
328
+
329
+ # Export as SARIF for GitHub Code Scanning
330
+ devsecops-radar --trivy trivy.json --export-sarif report.sarif
331
+
332
+ # Export as CycloneDX SBOM
333
+ devsecops-radar --trivy trivy.json --export-cyclonedx report.cdx.json
334
+ ```
335
+ </details>
336
+
337
+ <details>
338
+ <summary><b>8. Security Badge for Your Project</b></summary>
339
+ <br>
340
+
341
+ Embed a dynamic security badge in your README:
342
+ ```markdown
343
+ [![Security Status](https://your-server/badge/1.svg)](https://github.com/Mehrdoost/devsecops-radar)
344
+ ```
345
+ </details>
346
+
347
+ <details>
348
+ <summary><b>9. Jira / Asana Integration (New!)</b></summary>
349
+ <br>
350
+
351
+ Set environment variables to create issues automatically:
352
+ ```bash
353
+ export JIRA_URL="[https://your-domain.atlassian.net](https://your-domain.atlassian.net)"
354
+ export JIRA_TOKEN="your-api-token"
355
+ devsecops-radar --trivy trivy.json --analyze --notify-jira
356
+
357
+ export ASANA_TOKEN="your-asana-token"
358
+ export ASANA_WORKSPACE="your-workspace-gid"
359
+ devsecops-radar --trivy trivy.json --analyze --notify-asana
360
+ ```
361
+ </details>
362
+
363
+ ---
364
+
365
+ ## 📋 Complete Command Reference
366
+
367
+ <details open>
368
+ <summary><b>Click to Expand Command Categories</b></summary>
369
+ <br>
370
+
371
+ ### 🔎 Scanners & Inputs
372
+ | Flag | Description | Example |
373
+ | :--- | :--- | :--- |
374
+ | `--trivy` | Trivy JSON file or image name | `--trivy` <kbd>results.json</kbd> or <kbd>nginx:latest</kbd> |
375
+ | `--semgrep` | Semgrep JSON file or directory | `--semgrep` <kbd>results.json</kbd> or <kbd>./src</kbd> |
376
+ | `--poutine` | Poutine JSON file or repo path | `--poutine` <kbd>results.json</kbd> or <kbd>./repo</kbd> |
377
+ | `--zizmor` | Zizmor JSON file or repo path | `--zizmor` <kbd>results.json</kbd> or <kbd>./repo</kbd> |
378
+ | `--gitleaks`| Gitleaks JSON file or repo path | `--gitleaks` <kbd>results.json</kbd> or <kbd>./repo</kbd> |
379
+ | `--rules` | Directory with custom JSON rules | `--rules` <kbd>~/my-rules/</kbd> |
380
+ | `--topology`| Path to topology JSON file | `--topology` <kbd>topology.json</kbd> |
381
+
382
+ ### 🧠 AI, Policies & Remediation
383
+ | Flag | Description | Example |
384
+ | :--- | :--- | :--- |
385
+ | `--analyze` | Enable async LLM analysis (Ollama required) | `--analyze` |
386
+ | `--llm-backend`| `ollama` (default) or `litellm` | `--llm-backend` <kbd>litellm</kbd> |
387
+ | `--llm-model` | Model name | `--llm-model` <kbd>gpt-4o-mini</kbd> |
388
+ | `--fix` | Auto‑apply AI‑suggested fixes (with backup) | `--fix` |
389
+ | `--review` | Interactive step‑by‑step remediation | `--review` |
390
+ | `--policy` | Policy JSON file for gating | `--policy` <kbd>policy.json</kbd> |
391
+ | `--rego-policy`| OPA Rego policy file | `--rego-policy` <kbd>policy.rego</kbd> |
392
+
393
+ ### 📊 Reports & Exports
394
+ | Flag | Description | Example |
395
+ | :--- | :--- | :--- |
396
+ | `--output` | Output JSON file (default: findings.json) | `--output` <kbd>merged.json</kbd> |
397
+ | `--report` | Generate PDF/JSON/HTML report | `--report` <kbd>report.pdf</kbd> |
398
+ | `--export-sarif`| Export findings as SARIF | `--export-sarif` <kbd>report.sarif</kbd> |
399
+ | `--export-cyclonedx`| Export findings as CycloneDX | `--export-cyclonedx` <kbd>report.cdx</kbd> |
400
+ | `--compliance`| Framework: `CIS`, `PCI-DSS`, `ISO27001` | `--compliance` <kbd>CIS</kbd> |
401
+
402
+ ### ⚙️ Integrations & Setup
403
+ | Flag | Description | Example |
404
+ | :--- | :--- | :--- |
405
+ | `--notify-jira` | Create Jira issues for criticals | `--notify-jira` |
406
+ | `--notify-asana`| Create Asana tasks for criticals | `--notify-asana` |
407
+ | `--wizard` | Interactive first‑time setup wizard | `--wizard` |
408
+ | `--update-rules`| Download/update community rules | `--update-rules` |
409
+
410
+ <br>
411
+
412
+ > [!TIP]
413
+ > ### `devsecops-radar-web` — Web Server Options
414
+ > ```bash
415
+ > devsecops-radar-web # Launch on http://localhost:8080
416
+ > FINDINGS_FILE=my.json devsecops-radar-web # Use a custom findings file
417
+ > PIPELINE_API_KEY=secret devsecops-radar-web # Enable API authentication
418
+ > ```
419
+
420
+ </details>
421
+
422
+ ---
423
+
424
+ ## ✨ Core Capabilities
425
+
426
+ <details open>
427
+ <summary><b>Explore the Engine Powering Pipeline Sentinel</b></summary>
428
+ <br>
429
+
430
+ * **🔌 Multi‑Scanner Plugin Architecture:** Built‑in support for Trivy (`--trivy`), Semgrep (`--semgrep`), Poutine (`--poutine`), Zizmor (`--zizmor`), and Gitleaks (`--gitleaks`).
431
+ * **🧩 Hybrid RuleFusion Engine:** Load custom JSON rules locally or pull community‑curated rules from a configurable Git repository (`--update-rules`).
432
+ * **🧠 LLM‑Powered Analysis:** Async, enriched context (NIST NVD/GitHub links), structured JSON with MITRE ATT&CK, risk scores, and step‑by‑step remediation. Supports Ollama and LiteLLM.
433
+ * **🕸️ Multi‑Step Attack Path Visualization:** Interactive D3.js force graph that chains findings into realistic attack scenarios based on your network topology.
434
+ * **🛡️ Policy‑as‑Code (JSON & Rego):** Define simple security gates or write complex rules in Rego for OPA to fail pipelines safely.
435
+ * **🛠️ Auto‑Remediation:** AI‑suggested fixes applied automatically (`--fix`) or reviewed (`--review`). Every file is backed up safely in a new Git branch.
436
+ * **📊 Compliance & Reports:** Professional reports in PDF, JSON, HTML (`--report`), plus SARIF and CycloneDX exports.
437
+ * **📈 Scan History & Trends:** SQLAlchemy‑backed database with fast pagination and historical trend comparisons.
438
+ * **🧪 SBOM & Dependency Confusion:** Generate CycloneDX SBOMs, apply VEX files, and detect impersonation risks.
439
+ * **🔍 RAG‑Powered Security Search:** Ask natural language questions about your scan history.
440
+ * **📉 Dynamic Risk Scoring:** Context-aware scoring based on asset exposure, exploit availability, and threat intelligence.
441
+ * **🔒 Privacy & Offline‑First:** 100% embedded assets. LLM analysis runs locally via Ollama. No data leaves your network.
442
+
443
+ </details>
444
+
445
+ ---
446
+
447
+ ## 🌍 Community Rules & Online Updates
448
+
449
+ Pipeline Sentinel features a community‑driven rule marketplace housed in a separate repository: `devsecops-radar-rules`.
450
+
451
+ **How It Works:**
452
+ The repository contains curated JSON rule files for all supported scanners. You can pull the latest rules with a single command:
453
+ ```bash
454
+ devsecops-radar --update-rules
455
+ ```
456
+ Rules are stored locally in `~/.devsecops-radar/community-rules/`. To use them alongside your scanner results:
457
+ ```bash
458
+ devsecops-radar --trivy scan.json --rules ~/.devsecops-radar/community-rules/
459
+ ```
460
+ > [!NOTE]
461
+ > *(You can even point to your own private repository via `COMMUNITY_RULES_REPO`!)*
462
+
463
+ ---
464
+
465
+ ## ⚔️ Attack Simulation & What‑If Analysis
466
+
467
+ **Interactive attack simulation directly from the dashboard:**
468
+ 1. Tick the checkboxes next to the findings you want to investigate.
469
+ 2. Click **“⚡ Simulate Selected”**.
470
+ 3. A modal displays a generated attack script (`bash`), attack chain description, and (if Docker is available) the sandbox output.
471
+
472
+ *(You can also click any node in the Attack Path Graph and press **“Simulate this attack”**)*.
473
+
474
+ ---
475
+
476
+ <details>
477
+ <summary><b>🔐 Security Hardening (v0.4.1)</b></summary>
478
+ <br>
479
+
480
+ Pipeline Sentinel now includes several important security improvements:
481
+ * **Command injection prevention** – all scanner inputs and community repo URLs are strictly validated.
482
+ * **Password hashing** – API keys are stored using Werkzeug’s secure hashing (no plaintext).
483
+ * **Safe git staging** – only the files that were actually modified are committed, preventing accidental exposure of `.env` or other secrets.
484
+ * **Consistent DB session management** – all database operations use the same context manager, preventing resource leaks.
485
+ * **Specific exception handling** – bare `except` clauses have been replaced with targeted exceptions, improving debuggability.
486
+ * **Removal of duplicated parsing code** – the deprecated `parser.py` module has been deleted.
487
+ </details>
488
+
489
+ <details>
490
+ <summary><b>🏗️ Architecture</b></summary>
491
+ <br>
492
+
493
+ ```text
494
+ devsecops_radar/
495
+ ├── cli/ # CLI entry point – plugin discovery, policy, remediation
496
+ ├── core/ # RuleFusion engine, DB (SQLAlchemy), async LLM analysers
497
+ ├── scanners/ # Pluggable scanner classes (extend ScannerPlugin)
498
+ ├── plugins/ # ScannerPlugin abstract base class & entry points
499
+ └── web/ # Flask dashboard (modular Blueprints, WCAG 2.1 AA)
500
+ ├── dashboard/ # Main dashboard routes & embedded HTML
501
+ ├── attack_paths/
502
+ ├── topology/
503
+ ├── summary/
504
+ └── sentry/ # Live webhook agent for CI/CD
505
+ ```
506
+ > **📌 Diagram Placeholder:**
507
+ > ![Network Flow Diagram](docs/architecture-2.png)
508
+ </details>
509
+
510
+ <details>
511
+ <summary><b>🗺️ Roadmap</b></summary>
512
+ <br>
513
+
514
+ | Phase | Feature | Status |
515
+ | :--- | :--- | :--- |
516
+ | ✅ **Phase 1** | Multi‑scanner engine (Trivy, Semgrep, Poutine, Zizmor), LLM analysis, GH Actions | Done |
517
+ | ✅ **Phase 2** | Attack‑path visualization, Policy‑as‑Code, Auto‑remediation, Compliance reports | Done |
518
+ | ✅ **Phase 3** | Web dashboard Blueprint, ORM pagination, SBOM, Dynamic Risk Scoring, Gitleaks | Done |
519
+ | ✅ **Phase 4** | Advanced attack simulation, VEX filtering, Async LLM, SARIF/CycloneDX | Done |
520
+ | 🔲 **Phase 5** | eBPF runtime security agent | Planned |
521
+ | 🔲 **Phase 5** | Rule marketplace with YAML | Planned |
522
+ | 🔲 **Phase 5** | Pull Request assistant (GitHub App) | Planned |
523
+
524
+ > See the [open issues](https://github.com/Mehrdoost/devsecops-radar/issues) for a full list of proposed features.
525
+ </details>
526
+
527
+ <details>
528
+ <summary><b>🧪 Testing & CI</b></summary>
529
+ <br>
530
+
531
+ Pipeline Sentinel is thoroughly tested to ensure reliability for production use.
532
+ * **Unit & Integration Tests:** 23+ tests covering scanners, rule engine, database, analyzer, API, and CLI.
533
+ * **CI Pipeline:** Every push and pull request triggers automated testing (`pytest` with coverage) and linting (`ruff`, `mypy`) via GitHub Actions.
534
+
535
+ Run tests locally:
536
+ ```bash
537
+ pip install -e ".[dev]"
538
+ pip install pytest pytest-flask ruff
539
+ pytest tests/ -v --cov=devsecops_radar --cov-report=term-missing
540
+ ruff check .
541
+ mypy .
542
+ ```
543
+ </details>
544
+
545
+ ---
546
+
547
+ ## 🤝 Community & Support
548
+
549
+ <details>
550
+ <summary><b>Contributing, Security Policy, & Code of Conduct</b></summary>
551
+ <br>
552
+
553
+ * **Security Policy:** We take security seriously. If you discover a vulnerability, please report it privately. See our full Security Policy for details.
554
+ * **Contributing:** We welcome contributions of all kinds! Please read our Contributing Guide. For adding new rules, see the Community Rules section.
555
+ * **Code of Conduct:** This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
556
+ </details>
557
+
558
+ ---
559
+
560
+ ## 👨‍💻 Author
561
+
562
+ **ReverseForge** — ( Mehrdoost And Mi0r4 )
563
+
564
+ [![GitHub](https://img.shields.io/badge/GitHub-ReverseForge-181717?style=for-the-badge&logo=github)](https://github.com/ReverseForge)
565
+ [![GitHub](https://img.shields.io/badge/GitHub-Mehrdoost-181717?style=for-the-badge&logo=github)](https://github.com/Mehrdoost)
566
+ [![GitHub](https://img.shields.io/badge/GitHub-miora--sora-181717?style=for-the-badge&logo=github)](https://github.com/miora-sora)
567
+
568
+ ---
569
+
570
+ ## 📜 License
571
+
572
+ MIT — see [LICENSE](LICENSE).
573
+
574
+ <div align="center">
575
+ <br>
576
+
577
+ ⭐ **If this project helps your team ship safer software, drop a star — it makes a real difference.**
578
+
579
+ </div>