OWASP / OWASP/openshield

feat(graph): [3/3] path traversal, scoring, API endpoints, and tests

Open
#333 0 comments 0 reactions 1 assignee View on GitHub

@TFT444 is already working on this.

Since Sep 5, 2026.

core enhancement roadmap
Dominant language
Python
Stars
57
Forks
68
Avg merge
3d 15h
Merged PRs (30d)
17

Description

Objective

Walk the populated graph to produce one prioritised attack path per scan,
expose it via API, and prove the full pipeline with integration tests.

Depends on: #332

Scope

Path traversal (scanner/graph/path_finder.py)
  • BFS from high-risk entry points (public IPs, internet-exposed NSGs)
    to sensitive targets (storage, key vaults, databases with findings)
  • Prune edges with confidence < 0.5
  • Score by: finding severity on nodes, toxic-combination multiplier
    (public exposure + overprivileged identity + sensitive data in one path),
    path length penalty, and confidence product across edges
  • Persist top-N paths in new attack_paths table (new Alembic migration)
  • Paths are immutable; new scans produce new paths
API (api/routes/attack_graph.py)
  • GET /api/v1/scans/{scan_id}/attack-graph (nodes and edges)
  • GET /api/v1/scans/{scan_id}/attack-paths (ranked paths with evidence)
  • GET /api/v1/attack-paths/{path_id} (single path, full detail)
  • Tenant isolation enforced on all three endpoints
Docs
  • Update docs/api-reference.md with the three new endpoints
  • Update docs/architecture.md with the attack graph pipeline

Test plan

  • Toxic combination scores higher than isolated findings
  • Empty graph returns no paths (200 OK)
  • GET endpoints return correct shape
  • Integration test: scan trigger -> nodes -> edges -> path in one flow
  • Docs updated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.