# jain2975/cyberpulse architecture

> Architecture diagram of the GitHub repository jain2975/cyberpulse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jain2975/cyberpulse
- Repository: https://github.com/jain2975/cyberpulse

## Overview

CyberPulse automates a sandboxed penetration-test and remediation cycle. Its CLI orchestrator runs reconnaissance, optional static and dynamic scans, exploit attempts, validation, patching, and re-exploitation; findings and reports are persisted under state/. The local dashboard offers a browser interface to launch and monitor the same pipeline. The graph retains documented scanner and re-scan capabilities, while unsampled implementation details are represented only where the README or excerpts support them.

Main entry points: [`main.py`](https://github.com/jain2975/cyberpulse/blob/main/main.py) (CLI Orchestrator), [`agents/exploit_agent.py`](https://github.com/jain2975/cyberpulse/blob/main/agents/exploit_agent.py) (Exploit Agent), [`gui/app.py`](https://github.com/jain2975/cyberpulse/blob/main/gui/app.py) (Web Dashboard), [`vulnapp/app.py`](https://github.com/jain2975/cyberpulse/blob/main/vulnapp/app.py) (Vulnerable Target)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_orchestrator["CLI Orchestrator<br/>[main.py]"]
  node_agent_base["Agent Runtime<br/>[base_agent.py]"]
  node_state[("Run State")]
  node_reports["Final Report<br/>[final_report.md]"]
end

subgraph group_assessment["Security Assessment"]
  node_recon["Recon Agent<br/>[recon_agent.py]"]
  node_sast["SAST Agent<br/>[sast_agent.py]"]
  node_dast["DAST Agent<br/>[dast_agent.py]"]
  node_exploit["Exploit Agent<br/>[exploit_agent.py]"]
  node_validator["Validator Agent<br/>[validator_agent.py]"]
  node_target["Vulnerable Target<br/>[app.py]"]
end

subgraph group_remediation["Remediation"]
  node_patcher["Patching Agent<br/>[patching_agent.py]"]
  node_patched_target["Patched Target<br/>[app.py]"]
end

subgraph group_interface["User Interface"]
  node_dashboard["Web Dashboard<br/>[app.py]"]
  node_dashboard_views["Dashboard Views"]
end

node_operator(("Security Operator"))
node_semgrep["Semgrep"]
node_zap["OWASP ZAP"]
node_browser(("Dashboard User"))

node_operator -->|"runs pipeline"| node_orchestrator
node_orchestrator -->|"runs recon"| node_recon
node_orchestrator -.->|"runs optional scan"| node_sast
node_orchestrator -->|"runs exploits"| node_exploit
node_orchestrator -->|"runs validation"| node_validator
node_orchestrator -.->|"runs optional scan"| node_dast
node_orchestrator -->|"runs patching"| node_patcher
node_orchestrator -->|"re-runs attacks"| node_exploit
node_recon -->|"probes"| node_target
node_exploit -->|"attacks"| node_target
node_validator -->|"re-verifies"| node_target
node_sast -->|"scans source"| node_semgrep
node_dast -->|"scans running app"| node_zap
node_patcher -->|"writes fixes"| node_patched_target
node_exploit -->|"tests remediation"| node_patched_target
node_agent_base -->|"persists results"| node_state
node_browser -->|"uses dashboard"| node_dashboard
node_dashboard -->|"starts subprocess"| node_orchestrator
node_dashboard -->|"renders views"| node_dashboard_views
node_orchestrator -->|"summarizes run"| node_reports

click node_orchestrator "https://github.com/jain2975/cyberpulse/blob/main/main.py"
click node_agent_base "https://github.com/jain2975/cyberpulse/blob/main/agents/base_agent.py"
click node_state "https://github.com/jain2975/cyberpulse/tree/main/state"
click node_recon "https://github.com/jain2975/cyberpulse/blob/main/agents/recon_agent.py"
click node_sast "https://github.com/jain2975/cyberpulse/blob/main/agents/sast_agent.py"
click node_dast "https://github.com/jain2975/cyberpulse/blob/main/agents/dast_agent.py"
click node_exploit "https://github.com/jain2975/cyberpulse/blob/main/agents/exploit_agent.py"
click node_validator "https://github.com/jain2975/cyberpulse/blob/main/agents/validator_agent.py"
click node_target "https://github.com/jain2975/cyberpulse/blob/main/vulnapp/app.py"
click node_patcher "https://github.com/jain2975/cyberpulse/blob/main/agents/patching_agent.py"
click node_patched_target "https://github.com/jain2975/cyberpulse/blob/main/vulnapp_patched/app.py"
click node_dashboard "https://github.com/jain2975/cyberpulse/blob/main/gui/app.py"
click node_dashboard_views "https://github.com/jain2975/cyberpulse/tree/main/gui/templates"
click node_reports "https://github.com/jain2975/cyberpulse/blob/main/state/final_report.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_orchestrator,node_agent_base,node_state,node_reports,node_browser toneBlue
class node_recon,node_sast,node_dast,node_exploit,node_validator,node_target toneAmber
class node_patcher,node_patched_target toneMint
class node_dashboard,node_dashboard_views toneRose
class node_operator,node_semgrep,node_zap toneIndigo
```

## Components

### Orchestration

- [CLI Orchestrator](https://github.com/jain2975/cyberpulse/blob/main/main.py): `main.py`
- [Agent Runtime](https://github.com/jain2975/cyberpulse/blob/main/agents/base_agent.py): `agents/base_agent.py`
- [Run State](https://github.com/jain2975/cyberpulse/tree/main/state): `state`
- [Final Report](https://github.com/jain2975/cyberpulse/blob/main/state/final_report.md): `state/final_report.md`

### Security Assessment

- [Recon Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/recon_agent.py): `agents/recon_agent.py`
- [SAST Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/sast_agent.py): `agents/sast_agent.py`
- [DAST Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/dast_agent.py): `agents/dast_agent.py`
- [Exploit Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/exploit_agent.py): `agents/exploit_agent.py`
- [Validator Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/validator_agent.py): `agents/validator_agent.py`
- [Vulnerable Target](https://github.com/jain2975/cyberpulse/blob/main/vulnapp/app.py): `vulnapp/app.py`

### Remediation

- [Patching Agent](https://github.com/jain2975/cyberpulse/blob/main/agents/patching_agent.py): `agents/patching_agent.py`
- [Patched Target](https://github.com/jain2975/cyberpulse/blob/main/vulnapp_patched/app.py): `vulnapp_patched/app.py`

### User Interface

- [Web Dashboard](https://github.com/jain2975/cyberpulse/blob/main/gui/app.py): `gui/app.py`
- [Dashboard Views](https://github.com/jain2975/cyberpulse/tree/main/gui/templates): `gui/templates`

### Other components

- **Security Operator**
- **Semgrep**
- **OWASP ZAP**
- **Dashboard User**

## Connections

- Security Operator → CLI Orchestrator: runs pipeline (evidence: `README.md`)
- CLI Orchestrator → Recon Agent: runs recon (evidence: `main.py`)
- CLI Orchestrator → SAST Agent: runs optional scan (evidence: `main.py`)
- CLI Orchestrator → Exploit Agent: runs exploits (evidence: `README.md`)
- CLI Orchestrator → Validator Agent: runs validation (evidence: `README.md`)
- CLI Orchestrator → DAST Agent: runs optional scan (evidence: `main.py`)
- CLI Orchestrator → Patching Agent: runs patching (evidence: `README.md`)
- CLI Orchestrator → Exploit Agent: re-runs attacks (evidence: `README.md`)
- Recon Agent → Vulnerable Target: probes (evidence: `agents/recon_agent.py`)
- Exploit Agent → Vulnerable Target: attacks (evidence: `agents/exploit_agent.py`)
- Validator Agent → Vulnerable Target: re-verifies (evidence: `agents/validator_agent.py`)
- SAST Agent → Semgrep: scans source (evidence: `README.md`)
- DAST Agent → OWASP ZAP: scans running app (evidence: `README.md`)
- Patching Agent → Patched Target: writes fixes (evidence: `agents/patching_agent.py`)
- Exploit Agent → Patched Target: tests remediation (evidence: `README.md`)
- Agent Runtime → Run State: persists results (evidence: `agents/base_agent.py`)
- Dashboard User → Web Dashboard: uses dashboard (evidence: `README.md`)
- Web Dashboard → CLI Orchestrator: starts subprocess (evidence: `gui/app.py`)
- Web Dashboard → Dashboard Views: renders views (evidence: `gui/app.py`)
- CLI Orchestrator → Final Report: summarizes run (evidence: `README.md`)
