feat: add attack path correlation and visualization engine#146
feat: add attack path correlation and visualization engine#146KolaSailaja wants to merge 1 commit into
Conversation
|
Correct PR TemplatePlease copy and paste the raw template below into your PR description and fill it out: > **Before opening:** make sure there is an issue tracking this work, and link it below. PRs without a linked issue may be closed without review.
## Linked issue
Closes #
## What this PR does
## Type of change
- [ ] Bug fix
- [ ] New feature
- [ ] ML model / training pipeline
- [ ] Refactor (no behaviour change)
- [ ] Documentation
- [ ] Tests only
## ML tier (if applicable)
- [ ] Tier 1 — Triage
- [ ] Tier 2 — Predictive
- [ ] Tier 3 — Autonomous
- [ ] Not ML-related
## Stack affected
- [ ] Backend
- [ ] Frontend
- [ ] Both
---
## Changes
### Backend
-
### Frontend
-
### New dependencies
-
### Database / schema changes
-
---
## Testing
**How did you test this?**
**Checklist**
- [ ] Tested locally end-to-end (upload ZIP or GitHub URL → scan → findings returned correctly)
- [ ] New ML model falls back gracefully when model file is absent
- [ ] No new `console.error` or unhandled Python exceptions introduced
- [ ] Added or updated tests where applicable
- [ ] `requirements.txt` / `package.json` updated if new dependencies added
- [ ] New model files (`.pkl`, `.pt`, etc.) are gitignored, not committed
---
## Anything reviewers should focus on
## Screenshots (if UI changed)
|
|
Hi @ionfwsrijan, I’ve completed the implementation for Issue #145 (Attack Path Correlation & Visualization). Completed
Verification
I’ve pushed the changes and opened a PR for review. Looking forward to your feedback. Thank you! |
|
@KolaSailaja Fix failing checks |
|
Ok I will verify and confirm you proper execution without failing checks |
arpit2006
left a comment
There was a problem hiding this comment.
@KolaSailaja!
Thanks for the contribution. After reviewing the implementation, I found several critical issues that prevent the feature from functioning as described in the PR. While the backend attack-path engine provides a reasonable foundation, the API integration, frontend implementation, dependency management, and evidence-pack integration are currently incomplete or broken.
🔴 Critical Issues
1. Missing Frontend Page (attack-paths.tsx)
The router imports:
import { AttackPathsPage } from "./pages/attack-paths";However, attack-paths.tsx is not present in the repository.
The current pages/ directory contains:
dashboard.tsx
findings.tsx
fix.tsx
leaderboard.tsx
org-findings.tsx
root.tsx
scan-progress.tsx
verify.tsx
As a result, the frontend portion of the feature is missing entirely.
2. Router Compilation Issues
routes.ts currently contains multiple problems:
import { AttackPathsPage } from "./pages/attack-paths";- The imported file does not exist.
Additionally:
{ path: "org-findings/:orgJobId", Component: OrgFindings }OrgFindings is referenced but never imported.
This results in a router compilation failure.
3. Attack Path API Endpoint Not Implemented
The PR description states that an attack-path API endpoint was added.
However, main.py contains no references to:
attack_paths
/attack-paths
The engine exists as an internal module but is never exposed through an HTTP route.
The test suite currently assumes:
GET /attack-paths/{job_id}exists, but no such endpoint is registered.
Please add and wire the API endpoint before merge.
4. Missing Dependency
graph_builder.py imports:
import networkxbut requirements.txt does not include:
networkx
A clean installation will fail at runtime.
Please add the dependency and update any relevant installation documentation.
5. Corrupted Code in evidence_pack.py
The attack-path generation block appears to have been inserted as a single escaped string containing literal \n characters rather than executable Python code.
As written, the file is not valid Python and will fail during evidence pack generation.
Please restore the block as actual Python code and verify runtime execution.
🟡 Additional Issues
6. Severity Scoring Bug
Current implementation:
_SEVERITY_SCORE.get(step.label.upper(), 30)step.label contains finding titles/descriptions (e.g. "Hardcoded AWS Key"), not severity levels.
As a result, severity lookups fail and always fall back to:
30making severity-based scoring effectively non-functional.
7. Test Does Not Match Implementation
The test asserts:
graph.has_edge("f1", "f2")However, the graph builder introduces intermediate category nodes:
f1 → secret_intermediate → f2
The asserted edge does not exist under the current implementation.
Please align either the graph model or the test expectations.
8. Correlation Coverage Is Extremely Limited
_CORRELATION_MAP currently covers only:
- secret
- dependency
- privilege_escalation
Many categories used throughout the codebase and test fixtures such as:
- cloud-access
- vulnerability
- sast
do not participate in graph construction.
This significantly limits attack-path generation and causes many findings to produce no meaningful paths.
9. Documentation Not Updated
The evidence pack introduces new artifacts, but REPORT.md has not been updated to document them:
attack-paths.jsonattack-path-summary.txtattack-graph-report.json
Please update documentation accordingly.
10. Navigation Integration Missing
The PR description mentions a new Attack Paths page, but navigation components do not expose it.
Neither:
header.tsx
mobile-nav.tsx
contains any reference to the route.
Users currently have no discoverable way to access the feature.
Summary
The attack-path engine itself is a reasonable starting point, but several key pieces are missing or broken:
Blocking Issues
- Missing frontend page
- Broken router imports
- Missing API endpoint
- Missing
networkxdependency - Invalid evidence pack integration
Additional Issues
- Broken severity scoring
- Test/implementation mismatch
- Limited correlation coverage
- Missing documentation updates
- Missing navigation integration
Because the feature is not currently accessible end-to-end and contains multiple runtime failures, this PR is not yet in a mergeable state. Please address the above issues and resubmit for review.
Linked issue
Closes #145
What this PR does
Implements Attack Path Correlation & Visualization for Security Findings.
This feature correlates findings from multiple scanners, generates attack chains, calculates attack path risk scores, visualizes attack progression through an interactive graph, and includes attack path artifacts in Evidence Packs.
Type of change
ML tier (if applicable)
Stack affected
Changes
Backend
Frontend
New dependencies
Database / schema changes
Testing
How did you test this?
Checklist
Anything reviewers should focus on
Screenshots (if UI changed)
Attack Paths Graph
Empty State
Error State