Skip to content

Engagement and Graph

sm0k3net edited this page Nov 28, 2026 · 2 revisions

Engagement and graph

An engagement is a single per-session document under $DSH_HOME/redteam/sessions/<session>.json. Phases, nodes, edges, tool runs, approvals and the audit tail all live in it, and the panel you watch is a bounded snapshot of that document. Reports are rendered from the same snapshot, which is why nothing has to be remembered or retold.

Node types

Type Records Created by
goal The outcome the engagement is meant to prove. pentest_add_goal
intent A concrete test or action under a goal, optionally carrying OWASP WSTG ids. pentest_add_intent
fact An observation derived from real tool output or an OSINT result, linked to a tool run. pentest_add_fact
finding A weakness with CVSS/CWE/OWASP/WSTG, evidence, remediation and a status. pentest_add_finding
asset A host, URL, service, account, cloud resource, data store, mobile app or LLM endpoint. pentest_add_asset

Edge kinds

Edges are created from the ids you pass, and each has a visual style in the Flow tab: spawns (dashed), yields (solid), derived_from (dotted), proves (bold) and parent (gray). The four the add_* tools create are:

Edge Between Created when
parent goal → intent pentest_add_intent receives goalId.
yields intent → fact pentest_add_fact receives intentId.
derived_from fact → asset pentest_add_asset receives factId.
proves fact → finding pentest_add_finding receives factId.

Phases and order

Nine phases in fixed order: pre-engagement, recon, enumeration, vulnerability-analysis, exploitation, privilege-escalation, lateral-movement, post-exploitation, reporting.

  • One step forward. Starting or finishing a phase may not land more than one step beyond the furthest phase reached. Skipping ahead is allowed with a reason, because an untested phase is a documented gap rather than silent progress.
  • Backwards is free. New facts that invalidate a conclusion can take the engagement back to an earlier phase at any time.
  • Moving forward closes the previous running phase as done, with an end timestamp.
  • Reasons are mandatory. skipped and blocked require a note; the reason becomes part of the report, so a gap is documented rather than hidden.
  • RoE first. Starting or finishing a phase requires an accepted Rules of Engagement.
  • Blocked is not terminal. A blocked phase stays open in the completion checklist.

Progress

Progress is the share of the nine phases that are done or skipped, with a running phase counting half, rounded to a percentage. Pre-engagement done plus recon running is 17 percent; an engagement that has only just started recon is 6 percent.

Closing an engagement

pentest_complete_engagement refuses while any non-reporting phase is neither done nor skipped with a reason. The checklist it returns also reports open phases, the number of findings (and how many are verified or exploited), the evidence count and size, the reporting phase state and whether a final report exists. On success it marks reporting done, sets the engagement completed and generates the final report set (default md, pdf, json). A report generated before that point is marked draft:true.

How a finding is proven

Goal          what the engagement is meant to establish
  └─ parent ─ Intent        a test, with WSTG ids
        └─ yields ─ Fact    one real observation + toolRunId
              ├─ derived_from ─ Asset    what was discovered
              └─ proves ───── Finding    severity, CVSS, CWE, OWASP, evidence, remediation
                                   └─ Report renders the store, not the model

A finding is only as strong as its evidence and factId: the inspector shows the exact command, exit code and output excerpt behind the fact, and the report cites the same evidence id. Severity is derived from the CVSS v3.1 base score when it is omitted; supply cvssVector so a reader can reproduce it. Statuses are unverified, verified, exploited and reported (promoted into the report); an unverified finding is allowed, and the report says so.

Worked example: a web target

Scope https://acme.example, one goal, two intents and two findings:

Goal  "Assess the Acme storefront"
├─ parent ─ Intent  "Fingerprint the storefront"        phase recon
│             wstg: WSTG-INFO-02
│   └─ yields ─ Fact  "nginx 1.24 answers on 443"        toolRun run_8k2m1q
│         └─ derived_from ─ Asset  acme.example:443  kind service  technology nginx
└─ parent ─ Intent  "Check headers, cookie flags and framing"  phase vulnerability-analysis
              wstg: WSTG-CLNT-09, WSTG-SESS-02
    ├─ yields ─ Fact  "No X-Frame-Options header on acme.example"  toolRun run_8k2n4t
    │     └─ proves ─ Finding  "Clickjacking possible"  medium  CVSS 4.3  CWE-1021  A05:2021
    └─ yields ─ Fact  "Checkout cookie lacks Secure"             toolRun run_8k2p7x
          └─ proves ─ Finding  "Session cookie without Secure"  medium  CVSS 4.3  CWE-614  A05:2021

The report groups these by asset and by OWASP category, computes WSTG coverage from the intents and findings, and appends the evidence register and the audit appendix. Every number in it comes from the store; changing a node changes the next report.

The store around the graph

store.js writes JSON atomically (temporary file plus rename), keeps a bounded audit tail in the snapshot, appends to $DSH_HOME/redteam/audit/<session>.jsonl and notifies the SSE stream. Directories are 0700 and files 0600. The snapshot carries rev, sessionId, engagement, phases, nodes, edges, toolRuns, findings, assets, approvals, toolState, wordlist/OSINT/browser/API sections, progress, report, audit, evidence and coverage — and never a secret.

Related

Clone this wiki locally