devsecops-radar 0.3.9__tar.gz → 0.4.0__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 (62) hide show
  1. {devsecops_radar-0.3.9/devsecops_radar.egg-info → devsecops_radar-0.4.0}/PKG-INFO +132 -65
  2. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/README.md +125 -63
  3. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/cli/scanner.py +23 -4
  4. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/analyzer.py +44 -17
  5. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/attack_simulation.py +3 -2
  6. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/auth.py +7 -4
  7. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/database.py +10 -10
  8. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/models.py +7 -7
  9. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/parser.py +5 -5
  10. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/rag.py +6 -4
  11. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/remediation.py +31 -9
  12. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/reporting.py +34 -19
  13. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/rule_fusion.py +44 -20
  14. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/sbom.py +18 -5
  15. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/settings.py +2 -1
  16. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/valuation.py +18 -3
  17. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/plugins/__init__.py +5 -4
  18. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/adapter.py +6 -5
  19. devsecops_radar-0.4.0/devsecops_radar/scanners/base.py +12 -0
  20. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/gitleaks.py +8 -5
  21. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/poutine.py +8 -5
  22. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/semgrep.py +8 -5
  23. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/trivy.py +8 -5
  24. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/scanners/zizmor.py +8 -5
  25. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/app.py +8 -6
  26. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/attack_paths/routes.py +3 -2
  27. devsecops_radar-0.4.0/devsecops_radar/web/dashboard/routes.py +664 -0
  28. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/sentry/routes.py +2 -2
  29. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/summary/routes.py +3 -2
  30. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/topology/routes.py +3 -2
  31. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0/devsecops_radar.egg-info}/PKG-INFO +132 -65
  32. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar.egg-info/SOURCES.txt +0 -1
  33. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar.egg-info/requires.txt +6 -0
  34. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/pyproject.toml +28 -2
  35. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_analyzer.py +20 -4
  36. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_api.py +5 -2
  37. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_cli.py +4 -2
  38. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_database.py +5 -7
  39. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_rule_fusion.py +4 -2
  40. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/tests/test_scanners.py +52 -9
  41. devsecops_radar-0.3.9/MANIFEST.in +0 -2
  42. devsecops_radar-0.3.9/devsecops_radar/scanners/base.py +0 -11
  43. devsecops_radar-0.3.9/devsecops_radar/web/dashboard/routes.py +0 -467
  44. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/LICENSE +0 -0
  45. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/__init__.py +0 -0
  46. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/cli/__init__.py +0 -0
  47. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/core/__init__.py +0 -0
  48. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/__init__.py +0 -0
  49. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/attack_paths/__init__.py +0 -0
  50. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/dashboard/__init__.py +0 -0
  51. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/static/css/bootstrap.min.css +0 -0
  52. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/static/css/style.css +0 -0
  53. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/static/js/bootstrap.bundle.min.js +0 -0
  54. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/static/js/chart.umd.min.js +0 -0
  55. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/static/js/dashboard.js +0 -0
  56. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/summary/__init__.py +0 -0
  57. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/templates/index.html +0 -0
  58. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar/web/topology/__init__.py +0 -0
  59. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar.egg-info/dependency_links.txt +0 -0
  60. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar.egg-info/entry_points.txt +0 -0
  61. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/devsecops_radar.egg-info/top_level.txt +0 -0
  62. {devsecops_radar-0.3.9 → devsecops_radar-0.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devsecops-radar
3
- Version: 0.3.9
3
+ Version: 0.4.0
4
4
  Summary: Unified CI/CD Security Dashboard — Pipeline Sentinel
5
5
  Author-email: Mehrdoost <70381337+Mehrdoost@users.noreply.github.com>
6
6
  License-Expression: MIT
@@ -23,8 +23,13 @@ Requires-Dist: litellm>=1.50
23
23
  Requires-Dist: sqlalchemy>=2.0
24
24
  Requires-Dist: pydantic>=2.0
25
25
  Requires-Dist: pyjwt>=2.8
26
- Requires-Dist: pytest>=8.0
27
- Requires-Dist: pytest-flask>=1.3
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=8.0; extra == "dev"
28
+ Requires-Dist: pytest-flask>=1.3; extra == "dev"
29
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.3.0; extra == "dev"
31
+ Requires-Dist: mypy>=1.9; extra == "dev"
32
+ Requires-Dist: pre-commit>=3.5; extra == "dev"
28
33
  Dynamic: license-file
29
34
 
30
35
  <div align="center">
@@ -37,6 +42,7 @@ Dynamic: license-file
37
42
  [![License](https://img.shields.io/github/license/Mehrdoost/devsecops-radar?style=flat-square)](LICENSE)
38
43
  [![GitHub release](https://img.shields.io/github/v/release/Mehrdoost/devsecops-radar?include_prereleases&style=flat-square)](https://github.com/Mehrdoost/devsecops-radar/releases)
39
44
  [![CI](https://img.shields.io/github/actions/workflow/status/Mehrdoost/devsecops-radar/ci.yml?branch=main&style=flat-square)](https://github.com/Mehrdoost/devsecops-radar/actions)
45
+ [![codecov](https://codecov.io/gh/Mehrdoost/devsecops-radar/branch/main/graph/badge.svg?token=TOKEN)](https://codecov.io/gh/Mehrdoost/devsecops-radar)
40
46
  [![Stars](https://img.shields.io/github/stars/Mehrdoost/devsecops-radar?style=flat-square)](https://github.com/Mehrdoost/devsecops-radar/stargazers)
41
47
 
42
48
  </div>
@@ -58,12 +64,15 @@ Dynamic: license-file
58
64
  9. [Complete Command Reference](#-complete-command-reference)
59
65
  10. [Core Capabilities](#-core-capabilities)
60
66
  11. [Community Rules & Online Updates](#-community-rules--online-updates)
61
- 12. [Architecture](#️-architecture)
62
- 13. [Roadmap](#️-roadmap)
63
- 14. [Testing & CI](#-testing--ci)
64
- 15. [Contributing](#-contributing)
65
- 16. [Author](#-author)
66
- 17. [License](#-license)
67
+ 12. [Attack Simulation & What‑If Analysis](#-attack-simulation--what-if-analysis)
68
+ 13. [Architecture](#-architecture)
69
+ 14. [Roadmap](#-roadmap)
70
+ 15. [Testing & CI](#-testing--ci)
71
+ 16. [Security Policy](#-security-policy)
72
+ 17. [Contributing](#-contributing)
73
+ 18. [Code of Conduct](#-code-of-conduct)
74
+ 19. [Author](#-author)
75
+ 20. [License](#-license)
67
76
 
68
77
  ---
69
78
 
@@ -71,9 +80,9 @@ Dynamic: license-file
71
80
 
72
81
  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.
73
82
 
74
- **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). Instead of digging through multiple JSON files, you get a **beautiful, dark‑mode 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.
83
+ **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). 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.
75
84
 
76
- Think of it as a **security camera system for your entire CI/CD pipeline** — it watches everything, alerts you, and even suggests fixes, all without needing internet access if you want.
85
+ 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.
77
86
 
78
87
  ---
79
88
 
@@ -84,11 +93,13 @@ In 2026, **supply chain attacks** have become the #1 threat. Tools like Trivy th
84
93
  Pipeline Sentinel gives you:
85
94
  * **One screen for all scanners** – stop juggling log files.
86
95
  * **AI that understands attack chains** – “A leaked secret + an old library = a disaster.”
87
- * **Automatic fixes** – with a single flag, it patches files and opens a pull request.
96
+ * **Automatic fixes** – with a single flag, it patches files and opens a pull request (with **backup**).
88
97
  * **Human review mode** – inspect each fix before applying.
89
98
  * **Compliance reports** – generate a PDF for your boss or auditor.
99
+ * **Attack simulation** – tick a few findings and see a generated attack script.
90
100
  * **100% offline capable** – works in air‑gapped environments where security matters most.
91
101
  * **Interactive wizard** – one command to get everything running.
102
+ * **Community rules marketplace** – pull curated detection rules from the community.
92
103
 
93
104
  ---
94
105
 
@@ -113,8 +124,8 @@ Pipeline Sentinel is designed to be **flexible** — you decide where it fits be
113
124
  [Gitleaks scan] ┘
114
125
  ```
115
126
 
116
- > **📌 Diagram Placeholder:** Add your network flow diagram here as `docs/network_flow.png`.
117
- > `![Network Flow Diagram](docs/network_flow.png)`
127
+ > **📌 Diagram Placeholder:**
128
+ ![Network Flow Diagram](docs/network_flow.png)
118
129
 
119
130
  ---
120
131
 
@@ -122,7 +133,7 @@ Pipeline Sentinel is designed to be **flexible** — you decide where it fits be
122
133
 
123
134
  ![Pipeline Sentinel Dashboard](docs/Demo.gif)
124
135
 
125
- *(Severity doughnut, trend line chart, attack‑path graph (clickable nodes), topology view, executive summary — all fully offline.)*
136
+ *Severity doughnut, trend line chart, attack‑path graph (clickable nodes), topology view, executive summary, and attack simulation panel — all fully offline.*
126
137
 
127
138
  ---
128
139
 
@@ -139,7 +150,7 @@ devsecops-radar --trivy sample_trivy.json --semgrep sample_semgrep.json
139
150
  devsecops-radar-web
140
151
  ```
141
152
 
142
- Open http://localhost:8080 — your unified dashboard is live with sample findings.
153
+ Open http://localhost:8080 — your unified command center is live with sample findings.
143
154
 
144
155
  🧙 **Want a fully guided setup? Run the wizard:**
145
156
  ```bash
@@ -159,8 +170,10 @@ Pipeline Sentinel relies on external security tools to produce the JSON reports
159
170
  * Zizmor (installation)
160
171
  * Gitleaks (installation)
161
172
 
162
- **Optional (for AI analysis):**
163
- * Ollama (installation)
173
+ **Optional:**
174
+ * Ollama – for AI‑powered analysis (installation)
175
+ * Docker – for attack sandboxing and container scanning
176
+ * OPA – for advanced Rego policy evaluation
164
177
 
165
178
  > 📖 **See `PREREQUISITES.md` for more details.**
166
179
 
@@ -177,7 +190,7 @@ pip install devsecops-radar
177
190
  ```bash
178
191
  git clone [https://github.com/Mehrdoost/devsecops-radar.git](https://github.com/Mehrdoost/devsecops-radar.git)
179
192
  cd devsecops-radar
180
- pip install -e .
193
+ pip install -e ".[dev]"
181
194
  ```
182
195
 
183
196
  ### Option 3 — Docker
@@ -221,7 +234,7 @@ gitleaks detect --source . --report-format json --report-path gitleaks.json
221
234
  ```bash
222
235
  devsecops-radar --trivy trivy.json --semgrep semgrep.json --poutine poutine.json --zizmor zizmor.json --gitleaks gitleaks.json
223
236
  ```
224
- *This produces a single `findings.json` with all findings merged and normalised.*
237
+ *This produces a single findings.json with all findings merged and normalised.*
225
238
 
226
239
  ### 3. View the Dashboard
227
240
  ```bash
@@ -233,7 +246,7 @@ The dashboard shows:
233
246
  * **Pipeline Security** – Poutine + Zizmor statistics card
234
247
  * **Attack Path Graph** – Interactive D3.js graph (click nodes for details)
235
248
  * **Executive Summary** – Risk score and AI‑generated summary
236
- * **Findings Table** – Searchable, filterable, paginated
249
+ * **Findings Table** – Searchable, filterable, paginated, with checkboxes for simulation
237
250
 
238
251
  ### 4. Enable AI Analysis (Optional)
239
252
  ```bash
@@ -255,22 +268,23 @@ devsecops-radar --trivy trivy.json --analyze --fix
255
268
  # Review each fix before applying
256
269
  devsecops-radar --trivy trivy.json --analyze --fix --review
257
270
  ```
258
- *The tool creates a new git branch `auto-fix` and pushes it for review.*
271
+ *All modified files are backed up to `~/.devsecops-radar/backups/` before any change. The tool creates a new git branch `auto-fix` and pushes it for review.*
259
272
 
260
273
  ### 6. Policy Enforcement
261
274
  Create a `policy.json` file:
262
275
  ```json
263
- {
264
- "max_critical": 5,
265
- "on_violation": "fail"
266
- }
276
+ {"max_critical": 5, "on_violation": "fail"}
267
277
  ```
268
-
269
278
  ```bash
270
279
  devsecops-radar --trivy trivy.json --policy policy.json
271
280
  ```
272
281
  *If critical findings exceed 5, the command exits with code 1 — perfect for CI/CD gates.*
273
282
 
283
+ **You can also use OPA Rego policies:**
284
+ ```bash
285
+ devsecops-radar --trivy trivy.json --rego-policy policy.rego
286
+ ```
287
+
274
288
  ### 7. Generate Compliance Reports
275
289
  ```bash
276
290
  devsecops-radar --trivy trivy.json --analyze --compliance CIS --report cis-report.pdf
@@ -278,7 +292,7 @@ devsecops-radar --trivy trivy.json --analyze --compliance CIS --report cis-repor
278
292
  A PDF report is created with an executive summary, risk score, findings table, and compliance mapping. Sensitive data can be redacted automatically.
279
293
 
280
294
  ### 8. Security Badge for Your Project
281
- After running a scan, you can embed a dynamic security badge in your `README`:
295
+ After running a scan, you can embed a dynamic security badge in your README:
282
296
  ```markdown
283
297
  [![Security Status](https://your-server/badge/1.svg)](https://github.com/Mehrdoost/devsecops-radar)
284
298
  ```
@@ -299,10 +313,11 @@ The badge color changes based on the number of critical findings (green/yellow/r
299
313
  | `--gitleaks` | Gitleaks JSON file or repo path | `--gitleaks results.json` or `--gitleaks ./repo` |
300
314
  | `--rules` | Directory with custom JSON rule files | `--rules ~/my-security-rules/` |
301
315
  | `--policy` | Policy JSON file for gating | `--policy policy.json` |
316
+ | `--rego-policy` | OPA Rego policy file | `--rego-policy policy.rego` |
302
317
  | `--analyze` | Enable LLM analysis (Ollama required) | `--analyze` |
303
318
  | `--llm-backend` | `ollama` (default) or `litellm` | `--llm-backend litellm` |
304
319
  | `--llm-model` | Model name | `--llm-model gpt-4o-mini` |
305
- | `--fix` | Auto‑apply AI‑suggested fixes | `--fix` |
320
+ | `--fix` | Auto‑apply AI‑suggested fixes (with backup) | `--fix` |
306
321
  | `--review` | Review each AI fix before applying | `--review` |
307
322
  | `--topology` | Path to topology JSON file | `--topology topology.json` |
308
323
  | `--compliance` | Framework: `CIS`, `PCI-DSS`, `ISO27001` | `--compliance CIS` |
@@ -313,11 +328,37 @@ The badge color changes based on the number of critical findings (green/yellow/r
313
328
  ### `devsecops-radar-web` — Web Server
314
329
 
315
330
  ```bash
316
- devsecops-radar-web # Launch on http://localhost:8080
317
- FINDINGS_FILE=my.json devsecops-radar-web # Use a custom findings file
331
+ devsecops-radar-web # Launch on http://localhost:8080
332
+ FINDINGS_FILE=my.json devsecops-radar-web # Use a custom findings file
318
333
  PIPELINE_API_KEY=secret devsecops-radar-web # Enable API authentication
319
334
  ```
320
335
 
336
+ ### Usage Examples
337
+
338
+ ```bash
339
+ # Merge multiple scanner outputs
340
+ devsecops-radar --trivy trivy_scan.json --semgrep semgrep_scan.json
341
+
342
+ # Scan directly (if tools are installed)
343
+ devsecops-radar --trivy nginx:latest --semgrep ./src --poutine ./repo
344
+
345
+ # Merge built‑in scanners with custom rules
346
+ devsecops-radar --trivy trivy_scan.json --rules ~/my-security-rules/
347
+
348
+ # Enable AI analysis (Ollama must be running)
349
+ ollama pull llama3.2:latest
350
+ devsecops-radar --trivy trivy_scan.json --semgrep semgrep_scan.json --analyze
351
+
352
+ # Use OpenAI via LiteLLM
353
+ export OPENAI_API_KEY=sk-...
354
+ devsecops-radar --trivy trivy_scan.json --analyze --llm-backend litellm --llm-model gpt-4o-mini
355
+
356
+ # Build scan history and view trends
357
+ devsecops-radar --trivy sample_trivy.json --semgrep sample_semgrep.json
358
+ devsecops-radar --trivy sample_trivy.json --poutine sample_poutine.json
359
+ devsecops-radar-web # Trend chart now shows multiple data points
360
+ ```
361
+
321
362
  ---
322
363
 
323
364
  ## ✨ Core Capabilities
@@ -337,7 +378,7 @@ Built‑in support for five scanners with a real plugin system. Third‑party sc
337
378
  * **Offline** – Load custom JSON rules from any local directory (`--rules ~/my-rules/`)
338
379
  * **Online** – Pull community‑curated rules from a configurable Git repository (`--update-rules`)
339
380
  * Auto‑detects Trivy, Semgrep, Poutine, Zizmor, and plain‑list formats
340
- * Policy evaluation built directly into the engine
381
+ * Policy evaluation built directly into the engine (JSON and OPA Rego)
341
382
  * Community rules repo: `devsecops-radar-rules` (configurable via `COMMUNITY_RULES_REPO`)
342
383
 
343
384
  ### 🧠 LLM‑Powered Analysis
@@ -348,20 +389,13 @@ Built‑in support for five scanners with a real plugin system. Third‑party sc
348
389
  * Ollama (local, offline) and LiteLLM (OpenAI, Anthropic, etc.) support
349
390
 
350
391
  ### 🕸️ Multi‑Step Attack Path Visualization
351
- Interactive D3.js force graph that chains findings into realistic attack scenarios. Click any node to see detailed finding information. Accepts a topology file to map findings onto your actual infrastructure, showing lateral movement across servers and subnets.
392
+ Interactive D3.js force graph that chains findings into realistic attack scenarios. Click any node to see detailed finding information or to trigger a simulation. Accepts a topology file to map findings onto your actual infrastructure, showing lateral movement across servers and subnets.
352
393
 
353
- ### 🛡️ Policy‑as‑Code
354
- Define security gates as simple JSON:
355
- ```json
356
- {
357
- "max_critical": 5,
358
- "on_violation": "fail"
359
- }
360
- ```
361
- *If critical findings exceed the threshold, the CLI exits with code 1 — perfect for failing CI/CD pipelines.*
394
+ ### 🛡️ Policy‑as‑Code (JSON & Rego)
395
+ Define simple security gates with a JSON file, or write complex rules in Rego for OPA. Fail the pipeline when policies are violated.
362
396
 
363
- ### 🛠️ Auto‑Remediation with Human‑in‑the‑Loop
364
- AI‑suggested fixes can be applied automatically (`--fix`) or reviewed one‑by‑one (`--review`). The tool creates a new git branch and pushes it for review. A `fix.sh` script is also generated for manual commands.
397
+ ### 🛠️ Auto‑Remediation with Backup & Human‑in‑the‑Loop
398
+ AI‑suggested fixes are applied automatically (`--fix`) or reviewed one‑by‑one (`--review`). Every modified file is backed up to `~/.devsecops-radar/backups/` before any change. A new git branch is pushed for review.
365
399
 
366
400
  ### 📊 Compliance & Executive Reports (with Redaction)
367
401
  Generate professional PDF reports (`--report report.pdf`) with:
@@ -375,16 +409,17 @@ SQLAlchemy‑backed database with server‑side pagination (`/api/findings?page=
375
409
 
376
410
  ### 🧪 SBOM & Dependency Confusion Detection
377
411
  * Generate a CycloneDX SBOM from your project using `syft`
412
+ * Apply VEX (Vulnerability Exploitability eXchange) files to filter false positives
378
413
  * Detect dependency confusion risks in `package.json` and `requirements.txt` — internal packages that could be impersonated by public registries
379
414
 
380
415
  ### 🔍 RAG‑Powered Security Search
381
416
  Ask natural language questions about your scan history: *“When was the last Log4j vulnerability found?”* The built‑in RAG endpoint (`/api/rag?q=...`) searches stored findings and returns matches.
382
417
 
383
- ### ⚔️ Attack Simulation (Sandbox)
384
- Generate a simple proof‑of‑concept script for any finding and execute it inside a disposable Docker container to demonstrate the risk without harming your system.
385
-
386
418
  ### 📉 Dynamic Risk Scoring
387
- Beyond CVSS, each finding gets a dynamic risk score based on asset exposure (from topology) and exploit availability — helping teams prioritise what to fix first.
419
+ Beyond CVSS, each finding gets a dynamic risk score based on:
420
+ * Asset exposure (from topology)
421
+ * Exploit availability
422
+ * Active threat intelligence feeds
388
423
 
389
424
  ### 🧙 Interactive Wizard
390
425
  A `--wizard` flag walks new users through installing dependencies, pulling AI models, and running their first scan — all in one go.
@@ -402,9 +437,8 @@ A `--wizard` flag walks new users through installing dependencies, pulling AI mo
402
437
  Pipeline Sentinel features a community‑driven rule marketplace housed in a separate repository: `devsecops-radar-rules`.
403
438
 
404
439
  ### How It Works
405
- The repository contains curated JSON rule files for all supported scanners (Trivy, Semgrep, Poutine, Zizmor, Gitleaks) and generic compliance checks. Anyone can contribute by submitting a Pull Request with new or improved rules.
440
+ The repository contains curated JSON rule files for all supported scanners (Trivy, Semgrep, Poutine, Zizmor, Gitleaks) and generic compliance checks. Anyone can contribute by submitting a Pull Request with new or improved rules. Users can pull the latest rules with a single command:
406
441
 
407
- Users can pull the latest rules with a single command:
408
442
  ```bash
409
443
  devsecops-radar --update-rules
410
444
  ```
@@ -421,6 +455,20 @@ You can even point to your own fork or a private repository by setting the `COMM
421
455
 
422
456
  ---
423
457
 
458
+ ## ⚔️ Attack Simulation & What‑If Analysis
459
+
460
+ **New in v0.4.0:** Interactive attack simulation directly from the dashboard.
461
+ 1. Tick the checkboxes next to the findings you want to investigate.
462
+ 2. Click **“⚡ Simulate Selected”**.
463
+ 3. A modal will display a generated attack script (`bash`), a description of the attack chain, and — if Docker is available — the output of running the script in a sandbox container.
464
+
465
+ You can also click any node in the Attack Path Graph and press **“Simulate this attack”** for the same functionality. This feature helps security teams:
466
+ * Understand how multiple vulnerabilities can be chained.
467
+ * Generate proof‑of‑concept scripts for stakeholders.
468
+ * Test mitigations without risking production systems.
469
+
470
+ ---
471
+
424
472
  ## 🏗️ Architecture
425
473
 
426
474
  ```text
@@ -438,7 +486,7 @@ devsecops_radar/
438
486
  ```
439
487
 
440
488
  > **📌 Diagram Placeholder:**
441
- ![Architecture Diagram](docs/architecture.png)
489
+ ![Network Flow Diagram](docs/network_flow.png)
442
490
 
443
491
  ---
444
492
 
@@ -453,7 +501,7 @@ devsecops_radar/
453
501
  | ✅ **Phase 1** | Docker image (multi‑stage, non‑root) | Done |
454
502
  | ✅ **Phase 2** | Attack‑path visualization with MITRE ATT&CK & topology | Done |
455
503
  | ✅ **Phase 2** | Policy‑as‑Code engine (`--policy`) | Done |
456
- | ✅ **Phase 2** | Auto‑remediation engine (`--fix`) | Done |
504
+ | ✅ **Phase 2** | Auto‑remediation engine (`--fix`) with backup | Done |
457
505
  | ✅ **Phase 2** | Compliance reports (PDF) with redaction | Done |
458
506
  | ✅ **Phase 2** | Hybrid RuleFusion engine (local + community rules) | Done |
459
507
  | ✅ **Phase 3** | Web dashboard Blueprint refactor (modular Flask) | Done |
@@ -461,38 +509,56 @@ devsecops_radar/
461
509
  | ✅ **Phase 3** | SQLAlchemy ORM with pagination | Done |
462
510
  | ✅ **Phase 3** | SBOM & Dependency Confusion Detection | Done |
463
511
  | ✅ **Phase 3** | RAG‑powered security search | Done |
464
- | ✅ **Phase 3** | Attack Simulation (sandbox) | Done |
465
512
  | ✅ **Phase 3** | Dynamic Risk Scoring | Done |
466
513
  | ✅ **Phase 3** | Interactive wizard (`--wizard`) | Done |
467
514
  | ✅ **Phase 3** | Human review mode (`--review`) | Done |
468
515
  | ✅ **Phase 3** | Gitleaks secret scanner | Done |
469
516
  | ✅ **Phase 3** | Security badge endpoint | Done |
470
517
  | ✅ **Phase 3** | Full test suite & CI pipeline | Done |
471
- | 🔲 **Phase 4** | Jira / Slack integration | Planned |
472
- | 🔲 **Phase 4** | SARIF & CycloneDX support | Planned |
473
- | 🔲 **Phase 4** | Pull Request assistant (GitHub App) | Planned |
518
+ | **Phase 4** | Advanced attack simulation (What‑If) | Done |
519
+ | **Phase 4** | VEX filtering & OPA Rego policies | Done |
520
+ | 🔲 **Phase 5** | Jira / Slack integration | Planned |
521
+ | 🔲 **Phase 5** | SARIF & CycloneDX support | Planned |
522
+ | 🔲 **Phase 5** | Pull Request assistant (GitHub App) | Planned |
523
+ | 🔲 **Phase 5** | eBPF runtime security agent | Planned |
524
+
525
+ > See the [open issues](https://github.com/Mehrdoost/devsecops-radar/issues) for a full list of proposed features.
474
526
 
475
527
  ---
476
528
 
477
529
  ## 🧪 Testing & CI
478
530
 
479
531
  Pipeline Sentinel is thoroughly tested to ensure reliability for production use.
480
- * **Unit & Integration Tests:** 23 tests covering scanners, rule engine, database, analyzer, API, and CLI.
481
- * **CI Pipeline:** Every push and pull request triggers automated testing (pytest) and linting (ruff) via GitHub Actions.
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
+ * **Code Coverage:** We track coverage with Codecov (see badge above).
482
535
 
483
536
  You can run the tests locally:
484
537
  ```bash
485
- pip install -e .
538
+ pip install -e ".[dev]"
486
539
  pip install pytest pytest-flask ruff
487
- pytest tests/ -v
540
+ pytest tests/ -v --cov=devsecops_radar --cov-report=term-missing
488
541
  ruff check .
542
+ mypy .
489
543
  ```
490
544
 
491
545
  ---
492
546
 
547
+ ## 🔒 Security Policy
548
+
549
+ We take security seriously. If you discover a vulnerability, please report it privately. See our full Security Policy for details on reporting, supported versions, and disclosure procedures.
550
+
551
+ ---
552
+
493
553
  ## 🤝 Contributing
494
554
 
495
- We welcome contributions of all kinds! Please read our `CONTRIBUTING.md` for detailed guidelines on how to set up the project, add new scanners, or submit rule changes. For contributing community rules, see the Community Rules section above.
555
+ We welcome contributions of all kinds! Please read our Contributing Guide for detailed guidelines on how to set up the project, add new scanners, or submit rule changes. For contributing community rules, see the Community Rules section above. We also have Issue Templates and a Pull Request Template to make the process smooth for everyone.
556
+
557
+ ---
558
+
559
+ ## 💬 Code of Conduct
560
+
561
+ This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers.
496
562
 
497
563
  ---
498
564
 
@@ -500,10 +566,9 @@ We welcome contributions of all kinds! Please read our `CONTRIBUTING.md` for det
500
566
 
501
567
  **ReverseForge** — ( Mehrdoost And Mi0r4 )
502
568
 
503
- [cite_start][![GitHub](https://img.shields.io/badge/GitHub-Mehrdoost-181717?logo=github)](https://github.com/ReverseForge)
504
- [cite_start][![GitHub](https://img.shields.io/badge/GitHub-Mehrdoost-181717?logo=github)](https://github.com/Mehrdoost)
505
- [cite_start][![GitHub](https://img.shields.io/badge/GitHub-Mehrdoost-181717?logo=github)](https://github.com/miora-sora)
506
-
569
+ [![GitHub](https://img.shields.io/badge/GitHub-ReverseForge-181717?logo=github)](https://github.com/ReverseForge)
570
+ [![GitHub](https://img.shields.io/badge/GitHub-Mehrdoost-181717?logo=github)](https://github.com/Mehrdoost)
571
+ [![GitHub](https://img.shields.io/badge/GitHub-miora-soraزمس?logo=github)](https://github.com/miora-sora)
507
572
 
508
573
  ---
509
574
 
@@ -514,3 +579,5 @@ MIT — see [LICENSE](LICENSE).
514
579
  <div align="center">
515
580
  ⭐ If this project helps your team ship safer software, drop a star — it makes a real difference.
516
581
  </div>
582
+
583
+ ```