# radar-asm/radar-worker architecture

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

- Interactive diagram: https://gitdiagram.com/radar-asm/radar-worker
- Repository: https://github.com/radar-asm/radar-worker

## Overview

RADAR is a Bun CLI for authorized external asset reconnaissance. A target enters through the scan entry point; the orchestrator streams discovered subdomains through DNS/enrichment and, unless OSINT-only mode is enabled, service fingerprinting, then publishes scan events to a webhook. SQLite persistence is also present, though the README says webhook delivery is the primary way to consume results. The graph reflects documented capabilities and shown call sites; some probe internals and repository wiring are unsampled, so uncertain links are omitted.

Main entry points: [`src/app/orchestrator/orchestrator.ts`](https://github.com/radar-asm/radar-worker/blob/master/src/app/orchestrator/orchestrator.ts) (Scan orchestrator), [`src/app/use-cases/index.ts`](https://github.com/radar-asm/radar-worker/blob/master/src/app/use-cases/index.ts) (Scan entry), [`src/app/phase2Dns/domain/infraResolver.useCase.ts`](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/domain/infraResolver.useCase.ts) (DNS enrichment), [`src/app/phase3Surface/serverFingerPrintingProbe.ts`](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/serverFingerPrintingProbe.ts) (Fingerprinting probe)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan control"]
  node_entry["Scan entry<br/>[index.ts]"]
  node_orchestrator["Scan orchestrator<br/>[orchestrator.ts]"]
  node_phase_mapper["Event payload mapping"]
end

subgraph group_recon["Subdomain discovery"]
  node_subdomains["Subdomain discovery"]
  node_recon_probes["Discovery probes<br/>[recon.probes.ts]"]
  node_phase1_repo["Discovery repository"]
end

subgraph group_dns["DNS enrichment"]
  node_dns_usecase["DNS enrichment"]
  node_dns_probes["Enrichment probes<br/>[infraProbes.ts]"]
  node_dns_tools["DNS and HTTP adapters"]
  node_cdn["CDN classification<br/>[cdnDetector.ts]"]
  node_phase2_repo["Enrichment repository"]
end

subgraph group_surface["Service profiling"]
  node_surface_usecase["Fingerprinting stage"]
  node_surface_probe["Fingerprinting probe"]
  node_surface_tools["Nmap and web probes"]
  node_surface_mappers["Probe result mappers"]
  node_phase3_repo["Fingerprint repository"]
end

subgraph group_delivery["Results and storage"]
  node_events["Event publisher<br/>[events.adapter.ts]"]
  node_db[("SQLite repository<br/>[repository.ts]")]
end

node_operator(("Scan operator"))
node_webhook["Webhook receiver"]

node_operator -->|"starts scan"| node_entry
node_entry -->|"starts"| node_orchestrator
node_orchestrator -->|"streams names"| node_subdomains
node_subdomains -->|"runs discovery"| node_recon_probes
node_orchestrator -->|"enriches hosts"| node_dns_usecase
node_dns_usecase -->|"requests probes"| node_dns_probes
node_dns_probes -->|"queries services"| node_dns_tools
node_dns_usecase -->|"classifies CDN"| node_cdn
node_orchestrator -->|"runs profiling"| node_surface_usecase
node_surface_usecase -->|"invokes probe"| node_surface_probe
node_surface_probe -->|"runs scans"| node_surface_tools
node_surface_probe -->|"parses results"| node_surface_mappers
node_entry -->|"configures publisher"| node_events
node_orchestrator -->|"publishes events"| node_events
node_events -->|"posts results"| node_webhook
node_orchestrator -->|"normalizes payloads"| node_phase_mapper
node_phase1_repo -->|"persists discovery"| node_db
node_phase2_repo -->|"persists enrichment"| node_db
node_phase3_repo -->|"persists profiling"| node_db

click node_entry "https://github.com/radar-asm/radar-worker/blob/master/src/app/use-cases/index.ts"
click node_orchestrator "https://github.com/radar-asm/radar-worker/blob/master/src/app/orchestrator/orchestrator.ts"
click node_subdomains "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/domain/subdomain.useCase.ts"
click node_recon_probes "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/infra/recon.probes.ts"
click node_dns_usecase "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/domain/infraResolver.useCase.ts"
click node_dns_probes "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/infraProbes.ts"
click node_dns_tools "https://github.com/radar-asm/radar-worker/tree/master/src/app/phase2Dns/infra/adapters"
click node_cdn "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/utils/cdnDetector.ts"
click node_surface_usecase "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/domain/serverFingerprinting.useCase.ts"
click node_surface_probe "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/serverFingerPrintingProbe.ts"
click node_surface_tools "https://github.com/radar-asm/radar-worker/tree/master/src/app/phase3Surface/infra/adapters"
click node_surface_mappers "https://github.com/radar-asm/radar-worker/tree/master/src/app/phase3Surface/infra/mappers"
click node_events "https://github.com/radar-asm/radar-worker/blob/master/src/app/events/events.adapter.ts"
click node_phase_mapper "https://github.com/radar-asm/radar-worker/blob/master/src/app/orchestrator/orchestrator.mapper.ts"
click node_phase1_repo "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/domain/phase1.repository.ts"
click node_phase2_repo "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/domain/phase2.repository.ts"
click node_phase3_repo "https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/domain/phase3.repository.ts"
click node_db "https://github.com/radar-asm/radar-worker/blob/master/src/infra/db/repository.ts"

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_entry,node_orchestrator,node_phase_mapper toneBlue
class node_subdomains,node_recon_probes,node_phase1_repo toneAmber
class node_dns_usecase,node_dns_probes,node_dns_tools,node_cdn,node_phase2_repo,node_webhook toneMint
class node_surface_usecase,node_surface_probe,node_surface_tools,node_surface_mappers,node_phase3_repo toneRose
class node_events,node_db,node_operator toneIndigo
```

## Components

### Scan control

- [Scan entry](https://github.com/radar-asm/radar-worker/blob/master/src/app/use-cases/index.ts): `src/app/use-cases/index.ts`
- [Scan orchestrator](https://github.com/radar-asm/radar-worker/blob/master/src/app/orchestrator/orchestrator.ts): `src/app/orchestrator/orchestrator.ts`
- [Event payload mapping](https://github.com/radar-asm/radar-worker/blob/master/src/app/orchestrator/orchestrator.mapper.ts): `src/app/orchestrator/orchestrator.mapper.ts`

### Subdomain discovery

- [Subdomain discovery](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/domain/subdomain.useCase.ts): `src/app/phase1Recon/domain/subdomain.useCase.ts`
- [Discovery probes](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/infra/recon.probes.ts): `src/app/phase1Recon/infra/recon.probes.ts`
- [Discovery repository](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase1Recon/domain/phase1.repository.ts): `src/app/phase1Recon/domain/phase1.repository.ts`

### DNS enrichment

- [DNS enrichment](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/domain/infraResolver.useCase.ts): `src/app/phase2Dns/domain/infraResolver.useCase.ts`
- [Enrichment probes](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/infraProbes.ts): `src/app/phase2Dns/infraProbes.ts`
- [DNS and HTTP adapters](https://github.com/radar-asm/radar-worker/tree/master/src/app/phase2Dns/infra/adapters): `src/app/phase2Dns/infra/adapters`
- [CDN classification](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/utils/cdnDetector.ts): `src/app/phase2Dns/utils/cdnDetector.ts`
- [Enrichment repository](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase2Dns/domain/phase2.repository.ts): `src/app/phase2Dns/domain/phase2.repository.ts`

### Service profiling

- [Fingerprinting stage](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/domain/serverFingerprinting.useCase.ts): `src/app/phase3Surface/domain/serverFingerprinting.useCase.ts`
- [Fingerprinting probe](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/serverFingerPrintingProbe.ts): `src/app/phase3Surface/serverFingerPrintingProbe.ts`
- [Nmap and web probes](https://github.com/radar-asm/radar-worker/tree/master/src/app/phase3Surface/infra/adapters): `src/app/phase3Surface/infra/adapters`
- [Probe result mappers](https://github.com/radar-asm/radar-worker/tree/master/src/app/phase3Surface/infra/mappers): `src/app/phase3Surface/infra/mappers`
- [Fingerprint repository](https://github.com/radar-asm/radar-worker/blob/master/src/app/phase3Surface/domain/phase3.repository.ts): `src/app/phase3Surface/domain/phase3.repository.ts`

### Results and storage

- [Event publisher](https://github.com/radar-asm/radar-worker/blob/master/src/app/events/events.adapter.ts): `src/app/events/events.adapter.ts`
- [SQLite repository](https://github.com/radar-asm/radar-worker/blob/master/src/infra/db/repository.ts): `src/infra/db/repository.ts`

### Other components

- **Scan operator**
- **Webhook receiver**

## Connections

- Scan operator → Scan entry: starts scan
- Scan entry → Scan orchestrator: starts (evidence: `src/app/use-cases/index.ts`)
- Scan orchestrator → Subdomain discovery: streams names (evidence: `src/app/orchestrator/orchestrator.ts`)
- Subdomain discovery → Discovery probes: runs discovery (evidence: `src/app/phase1Recon/domain/subdomain.useCase.ts`)
- Scan orchestrator → DNS enrichment: enriches hosts (evidence: `src/app/orchestrator/orchestrator.ts`)
- DNS enrichment → Enrichment probes: requests probes (evidence: `src/app/phase2Dns/domain/infraResolver.useCase.ts`)
- Enrichment probes → DNS and HTTP adapters: queries services (evidence: `src/app/phase2Dns/infraProbes.ts`)
- DNS enrichment → CDN classification: classifies CDN (evidence: `src/app/phase2Dns/domain/infraResolver.useCase.ts`)
- Scan orchestrator → Fingerprinting stage: runs profiling (evidence: `src/app/orchestrator/orchestrator.ts`)
- Fingerprinting stage → Fingerprinting probe: invokes probe (evidence: `src/app/phase3Surface/domain/serverFingerprinting.useCase.ts`)
- Fingerprinting probe → Nmap and web probes: runs scans (evidence: `src/app/phase3Surface/serverFingerPrintingProbe.ts`)
- Fingerprinting probe → Probe result mappers: parses results (evidence: `src/app/phase3Surface/serverFingerPrintingProbe.ts`)
- Scan entry → Event publisher: configures publisher (evidence: `src/app/use-cases/index.ts`)
- Scan orchestrator → Event publisher: publishes events
- Event publisher → Webhook receiver: posts results
- Scan orchestrator → Event payload mapping: normalizes payloads (evidence: `src/app/orchestrator/orchestrator.ts`)
- Discovery repository → SQLite repository: persists discovery (evidence: `src/app/phase1Recon/domain/phase1.repository.ts`)
- Enrichment repository → SQLite repository: persists enrichment (evidence: `src/app/phase2Dns/domain/phase2.repository.ts`)
- Fingerprint repository → SQLite repository: persists profiling (evidence: `src/app/phase3Surface/domain/phase3.repository.ts`)
