# danoszz/penthera architecture

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

- Interactive diagram: https://gitdiagram.com/danoszz/penthera
- Repository: https://github.com/danoszz/penthera

## Overview

Penthera is an authorized security scanner for live URLs, source repositories, and macOS machines, exposed through a CLI and guided terminal flow. A scan runs the selected domain checks, combines findings, compares an optional baseline, and emits terminal, Markdown, JSON, and SARIF results. The README also documents compliance readiness, incident drafts, questionnaires, supply-chain checks, and remediation guidance. Some feature modules are unsampled; those branches are included where documented, while uncertain implementation links are omitted.

Main entry points: [`src/cli/run-scan.js`](https://github.com/danoszz/penthera/blob/main/src/cli/run-scan.js) (Scan orchestrator), [`src/scan-url.js`](https://github.com/danoszz/penthera/blob/main/src/scan-url.js) (URL scanner), [`src/report/markdown.js`](https://github.com/danoszz/penthera/blob/main/src/report/markdown.js) (Markdown reports), [`src/scan-repo.js`](https://github.com/danoszz/penthera/blob/main/src/scan-repo.js) (Repository scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and orchestration"]
  node_cli["CLI commands<br/>[cli.js]"]
  node_onboarding["Guided onboarding<br/>[onboarding.js]"]
  node_runner["Scan orchestrator<br/>[run-scan.js]"]
end

subgraph group_scanning["Target scanning"]
  node_urlscan["URL scanner<br/>[scan-url.js]"]
  node_reposcan["Repository scanner<br/>[scan-repo.js]"]
  node_machine["Machine audit<br/>[machine.js]"]
  node_blackbox["Black-box probes"]
  node_clientauth["Client-auth probe<br/>[client-auth.js]"]
  node_oauth["OAuth probe<br/>[oauth.js]"]
  node_injections["Injection probes<br/>[injections.js]"]
  node_templates["Scan templates<br/>[templates.js]"]
  node_frameworks["Framework discovery<br/>[frameworks.js]"]
  node_sbom["SBOM generation<br/>[sbom.js]"]
end

subgraph group_analysis["Security analysis"]
  node_http["HTTP utilities<br/>[http.js]"]
  node_auditloop["Audit history<br/>[audit-loop.js]"]
  node_wstg["OWASP mapping<br/>[owasp-wstg.js]"]
  node_plugins["Probe plugins<br/>[plugins.js]"]
end

subgraph group_compliance["Compliance and fixes"]
  node_compliance["Compliance coverage<br/>[index.js]"]
  node_selfassessment["Self-assessment<br/>[self-assessment.js]"]
  node_complianceextras["Compliance documents"]
  node_remediation["Remediation plans<br/>[index.js]"]
end

subgraph group_results["Findings and reports"]
  node_merge["Finding merger<br/>[merge-results.js]"]
  node_reporter["Terminal and exports<br/>[reporter.js]"]
  node_markdown["Markdown reports<br/>[markdown.js]"]
  node_findings["Security findings"]
end

node_user(("User or agent"))

node_user -->|"requests scan"| node_cli
node_user -->|"starts guided scan"| node_onboarding
node_cli -->|"runs scan"| node_runner
node_onboarding -->|"runs scan"| node_runner
node_runner -->|"scans URL"| node_urlscan
node_runner -->|"scans repository"| node_reposcan
node_runner -->|"audits machine"| node_machine
node_urlscan -->|"runs probes"| node_blackbox
node_urlscan -->|"probes auth"| node_clientauth
node_urlscan -->|"runs probes"| node_injections
node_urlscan -->|"uses templates"| node_templates
node_clientauth -->|"fetches scripts"| node_http
node_oauth -->|"probes endpoints"| node_http
node_reposcan -->|"discovers frameworks"| node_frameworks
node_reposcan -.->|"generates SBOM"| node_sbom
node_runner -->|"merges results"| node_merge
node_merge -->|"produces findings"| node_findings
node_runner -->|"compares history"| node_auditloop
node_runner -->|"loads probes"| node_plugins
node_runner -->|"builds coverage"| node_compliance
node_compliance -->|"uses assessment"| node_selfassessment
node_runner -->|"generates documents"| node_complianceextras
node_runner -->|"builds action plan"| node_remediation
node_runner -->|"prints and exports"| node_reporter
node_runner -->|"writes report"| node_markdown
node_markdown -->|"formats coverage"| node_wstg
node_markdown -->|"formats coverage"| node_compliance
node_markdown -->|"formats fixes"| node_remediation
node_reporter -->|"tags findings"| node_wstg

click node_cli "https://github.com/danoszz/penthera/blob/main/src/cli.js"
click node_onboarding "https://github.com/danoszz/penthera/blob/main/src/cli/onboarding.js"
click node_runner "https://github.com/danoszz/penthera/blob/main/src/cli/run-scan.js"
click node_urlscan "https://github.com/danoszz/penthera/blob/main/src/scan-url.js"
click node_reposcan "https://github.com/danoszz/penthera/blob/main/src/scan-repo.js"
click node_machine "https://github.com/danoszz/penthera/blob/main/lib/machine.js"
click node_blackbox "https://github.com/danoszz/penthera/tree/main/lib/blackbox"
click node_clientauth "https://github.com/danoszz/penthera/blob/main/lib/blackbox/client-auth.js"
click node_oauth "https://github.com/danoszz/penthera/blob/main/lib/blackbox/oauth.js"
click node_injections "https://github.com/danoszz/penthera/blob/main/lib/injections.js"
click node_templates "https://github.com/danoszz/penthera/blob/main/lib/templates.js"
click node_frameworks "https://github.com/danoszz/penthera/blob/main/lib/whitebox/frameworks.js"
click node_sbom "https://github.com/danoszz/penthera/blob/main/lib/whitebox/sbom.js"
click node_http "https://github.com/danoszz/penthera/blob/main/src/utils/http.js"
click node_auditloop "https://github.com/danoszz/penthera/blob/main/lib/audit-loop.js"
click node_wstg "https://github.com/danoszz/penthera/blob/main/lib/owasp-wstg.js"
click node_plugins "https://github.com/danoszz/penthera/blob/main/lib/plugins.js"
click node_compliance "https://github.com/danoszz/penthera/blob/main/lib/compliance/index.js"
click node_selfassessment "https://github.com/danoszz/penthera/blob/main/lib/compliance/self-assessment.js"
click node_complianceextras "https://github.com/danoszz/penthera/tree/main/lib/compliance"
click node_remediation "https://github.com/danoszz/penthera/blob/main/lib/remediation/index.js"
click node_merge "https://github.com/danoszz/penthera/blob/main/src/cli/merge-results.js"
click node_reporter "https://github.com/danoszz/penthera/blob/main/src/reporter.js"
click node_markdown "https://github.com/danoszz/penthera/blob/main/src/report/markdown.js"

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_cli,node_onboarding,node_runner,node_user toneBlue
class node_urlscan,node_reposcan,node_machine,node_blackbox,node_clientauth,node_oauth,node_injections,node_templates,node_frameworks,node_sbom toneAmber
class node_http,node_auditloop,node_wstg,node_plugins toneMint
class node_compliance,node_selfassessment,node_complianceextras,node_remediation toneRose
class node_merge,node_reporter,node_markdown,node_findings toneIndigo
```

## Components

### CLI and orchestration

- [CLI commands](https://github.com/danoszz/penthera/blob/main/src/cli.js): `src/cli.js`
- [Guided onboarding](https://github.com/danoszz/penthera/blob/main/src/cli/onboarding.js): `src/cli/onboarding.js`
- [Scan orchestrator](https://github.com/danoszz/penthera/blob/main/src/cli/run-scan.js): `src/cli/run-scan.js`

### Target scanning

- [URL scanner](https://github.com/danoszz/penthera/blob/main/src/scan-url.js): `src/scan-url.js`
- [Repository scanner](https://github.com/danoszz/penthera/blob/main/src/scan-repo.js): `src/scan-repo.js`
- [Machine audit](https://github.com/danoszz/penthera/blob/main/lib/machine.js): `lib/machine.js`
- [Black-box probes](https://github.com/danoszz/penthera/tree/main/lib/blackbox): `lib/blackbox`
- [Client-auth probe](https://github.com/danoszz/penthera/blob/main/lib/blackbox/client-auth.js): `lib/blackbox/client-auth.js`
- [OAuth probe](https://github.com/danoszz/penthera/blob/main/lib/blackbox/oauth.js): `lib/blackbox/oauth.js`
- [Injection probes](https://github.com/danoszz/penthera/blob/main/lib/injections.js): `lib/injections.js`
- [Scan templates](https://github.com/danoszz/penthera/blob/main/lib/templates.js): `lib/templates.js`
- [Framework discovery](https://github.com/danoszz/penthera/blob/main/lib/whitebox/frameworks.js): `lib/whitebox/frameworks.js`
- [SBOM generation](https://github.com/danoszz/penthera/blob/main/lib/whitebox/sbom.js): `lib/whitebox/sbom.js`

### Security analysis

- [HTTP utilities](https://github.com/danoszz/penthera/blob/main/src/utils/http.js): `src/utils/http.js`
- [Audit history](https://github.com/danoszz/penthera/blob/main/lib/audit-loop.js): `lib/audit-loop.js`
- [OWASP mapping](https://github.com/danoszz/penthera/blob/main/lib/owasp-wstg.js): `lib/owasp-wstg.js`
- [Probe plugins](https://github.com/danoszz/penthera/blob/main/lib/plugins.js): `lib/plugins.js`

### Compliance and fixes

- [Compliance coverage](https://github.com/danoszz/penthera/blob/main/lib/compliance/index.js): `lib/compliance/index.js`
- [Self-assessment](https://github.com/danoszz/penthera/blob/main/lib/compliance/self-assessment.js): `lib/compliance/self-assessment.js`
- [Compliance documents](https://github.com/danoszz/penthera/tree/main/lib/compliance): `lib/compliance`
- [Remediation plans](https://github.com/danoszz/penthera/blob/main/lib/remediation/index.js): `lib/remediation/index.js`

### Findings and reports

- [Finding merger](https://github.com/danoszz/penthera/blob/main/src/cli/merge-results.js): `src/cli/merge-results.js`
- [Terminal and exports](https://github.com/danoszz/penthera/blob/main/src/reporter.js): `src/reporter.js`
- [Markdown reports](https://github.com/danoszz/penthera/blob/main/src/report/markdown.js): `src/report/markdown.js`
- **Security findings**

### Other components

- **User or agent**

## Connections

- User or agent → CLI commands: requests scan (evidence: `README.md`)
- User or agent → Guided onboarding: starts guided scan (evidence: `README.md`)
- CLI commands → Scan orchestrator: runs scan (evidence: `src/cli.js`)
- Guided onboarding → Scan orchestrator: runs scan (evidence: `src/cli/onboarding.js`)
- Scan orchestrator → URL scanner: scans URL (evidence: `src/cli/run-scan.js`)
- Scan orchestrator → Repository scanner: scans repository (evidence: `src/cli/run-scan.js`)
- Scan orchestrator → Machine audit: audits machine (evidence: `src/cli/run-scan.js`)
- URL scanner → Black-box probes: runs probes (evidence: `src/scan-url.js`)
- URL scanner → Client-auth probe: probes auth (evidence: `src/scan-url.js`)
- URL scanner → Injection probes: runs probes (evidence: `src/scan-url.js`)
- URL scanner → Scan templates: uses templates (evidence: `src/scan-url.js`)
- Client-auth probe → HTTP utilities: fetches scripts (evidence: `lib/blackbox/client-auth.js`)
- OAuth probe → HTTP utilities: probes endpoints (evidence: `lib/blackbox/oauth.js`)
- Repository scanner → Framework discovery: discovers frameworks (evidence: `src/scan-repo.js`)
- Repository scanner → SBOM generation: generates SBOM
- Scan orchestrator → Finding merger: merges results (evidence: `src/cli/run-scan.js`)
- Finding merger → Security findings: produces findings
- Scan orchestrator → Audit history: compares history
- Scan orchestrator → Probe plugins: loads probes
- Scan orchestrator → Compliance coverage: builds coverage
- Compliance coverage → Self-assessment: uses assessment (evidence: `lib/compliance/readiness.js`)
- Scan orchestrator → Compliance documents: generates documents
- Scan orchestrator → Remediation plans: builds action plan (evidence: `src/cli/run-scan.js`)
- Scan orchestrator → Terminal and exports: prints and exports (evidence: `src/cli/run-scan.js`)
- Scan orchestrator → Markdown reports: writes report (evidence: `src/cli/run-scan.js`)
- Markdown reports → OWASP mapping: formats coverage (evidence: `src/report/markdown.js`)
- Markdown reports → Compliance coverage: formats coverage (evidence: `src/report/markdown.js`)
- Markdown reports → Remediation plans: formats fixes (evidence: `src/report/markdown.js`)
- Terminal and exports → OWASP mapping: tags findings (evidence: `src/reporter.js`)
