# cymriccc/sec-scan architecture

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

- Interactive diagram: https://gitdiagram.com/cymriccc/sec-scan
- Repository: https://github.com/cymriccc/sec-scan

## Overview

sec-scan is a CLI web-application security auditor. Its main workflow accepts one URL or a file of targets, runs HTTP header, TLS, CORS, technology-disclosure, sensitive-path, and cookie checks, then evaluates posture and emits terminal or exported reports; batch scans use a worker pool. The README also documents interactive HTML, Markdown, JSON, and risk-threshold gating. Edges follow the entrypoint and batch-worker calls shown in excerpts; scanner modules not excerpted are included as documented capabilities, with their internal implementation links omitted where unverified.

Main entry points: [`cmd/sec-scan/main.go`](https://github.com/cymriccc/sec-scan/blob/main/cmd/sec-scan/main.go) (CLI workflow), [`internal/scanner/concurrent.go`](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/concurrent.go) (Batch workers), [`internal/scanner/risk.go`](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/risk.go) (Risk assessment), [`internal/report/html.go`](https://github.com/cymriccc/sec-scan/blob/main/internal/report/html.go) (HTML dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_entry["CLI workflow<br/>[main.go]"]
  node_batch["Batch workers<br/>[concurrent.go]"]
end

subgraph group_audits["Target audits"]
  node_headers["Header audit<br/>[headers.go]"]
  node_tls["TLS audit<br/>[tls.go]"]
  node_cors["CORS audit<br/>[cors.go]"]
  node_disclosure["Tech disclosure<br/>[info.go]"]
  node_endpoints["Endpoint probes<br/>[probes.go]"]
  node_cookies["Cookie audit<br/>[cookies.go]"]
end

subgraph group_assessment["Assessment"]
  node_risk["Risk assessment<br/>[risk.go]"]
  node_remediation["Header remediation<br/>[remediation.go]"]
end

subgraph group_reports["Reports"]
  node_terminal["Terminal renderer<br/>[printer.go]"]
  node_json["JSON export<br/>[output.go]"]
  node_html["HTML dashboard<br/>[html.go]"]
  node_markdown["Markdown report<br/>[md.go]"]
end

node_operator(("Operator"))

node_operator -->|"invokes"| node_entry
node_entry -->|"dispatches batch"| node_batch
node_entry -->|"runs audit"| node_headers
node_entry -->|"runs audit"| node_tls
node_entry -->|"runs audit"| node_cors
node_entry -->|"runs audit"| node_disclosure
node_entry -->|"runs probes"| node_endpoints
node_entry -->|"runs audit"| node_cookies
node_batch -->|"runs audit"| node_headers
node_batch -->|"runs audit"| node_tls
node_batch -->|"runs audit"| node_cors
node_batch -->|"runs audit"| node_disclosure
node_batch -->|"runs probes"| node_endpoints
node_batch -->|"runs audit"| node_cookies
node_entry -->|"evaluates findings"| node_risk
node_entry -->|"prints results"| node_terminal
node_entry -->|"exports results"| node_json
node_entry -->|"exports results"| node_html
node_entry -->|"exports results"| node_markdown
node_html -->|"evaluates findings"| node_risk
node_markdown -->|"evaluates findings"| node_risk

click node_entry "https://github.com/cymriccc/sec-scan/blob/main/cmd/sec-scan/main.go"
click node_batch "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/concurrent.go"
click node_headers "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/headers.go"
click node_tls "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/tls.go"
click node_cors "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/cors.go"
click node_disclosure "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/info.go"
click node_endpoints "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/probes.go"
click node_cookies "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/cookies.go"
click node_risk "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/risk.go"
click node_remediation "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/remediation.go"
click node_terminal "https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/printer.go"
click node_json "https://github.com/cymriccc/sec-scan/blob/main/internal/report/output.go"
click node_html "https://github.com/cymriccc/sec-scan/blob/main/internal/report/html.go"
click node_markdown "https://github.com/cymriccc/sec-scan/blob/main/internal/report/md.go"

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_batch toneBlue
class node_headers,node_tls,node_cors,node_disclosure,node_endpoints,node_cookies toneAmber
class node_risk,node_remediation toneMint
class node_terminal,node_json,node_html,node_markdown toneRose
class node_operator toneIndigo
```

## Components

### CLI workflow

- [CLI workflow](https://github.com/cymriccc/sec-scan/blob/main/cmd/sec-scan/main.go): `cmd/sec-scan/main.go`
- [Batch workers](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/concurrent.go): `internal/scanner/concurrent.go`

### Target audits

- [Header audit](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/headers.go): `internal/scanner/headers.go`
- [TLS audit](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/tls.go): `internal/scanner/tls.go`
- [CORS audit](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/cors.go): `internal/scanner/cors.go`
- [Tech disclosure](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/info.go): `internal/scanner/info.go`
- [Endpoint probes](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/probes.go): `internal/scanner/probes.go`
- [Cookie audit](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/cookies.go): `internal/scanner/cookies.go`

### Assessment

- [Risk assessment](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/risk.go): `internal/scanner/risk.go`
- [Header remediation](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/remediation.go): `internal/scanner/remediation.go`

### Reports

- [Terminal renderer](https://github.com/cymriccc/sec-scan/blob/main/internal/scanner/printer.go): `internal/scanner/printer.go`
- [JSON export](https://github.com/cymriccc/sec-scan/blob/main/internal/report/output.go): `internal/report/output.go`
- [HTML dashboard](https://github.com/cymriccc/sec-scan/blob/main/internal/report/html.go): `internal/report/html.go`
- [Markdown report](https://github.com/cymriccc/sec-scan/blob/main/internal/report/md.go): `internal/report/md.go`

### Other components

- **Operator**

## Connections

- Operator → CLI workflow: invokes (evidence: `README.md`)
- CLI workflow → Batch workers: dispatches batch (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Header audit: runs audit (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → TLS audit: runs audit (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → CORS audit: runs audit (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Tech disclosure: runs audit (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Endpoint probes: runs probes (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Cookie audit: runs audit (evidence: `cmd/sec-scan/main.go`)
- Batch workers → Header audit: runs audit (evidence: `internal/scanner/concurrent.go`)
- Batch workers → TLS audit: runs audit (evidence: `internal/scanner/concurrent.go`)
- Batch workers → CORS audit: runs audit (evidence: `internal/scanner/concurrent.go`)
- Batch workers → Tech disclosure: runs audit (evidence: `internal/scanner/concurrent.go`)
- Batch workers → Endpoint probes: runs probes (evidence: `internal/scanner/concurrent.go`)
- Batch workers → Cookie audit: runs audit (evidence: `internal/scanner/concurrent.go`)
- CLI workflow → Risk assessment: evaluates findings (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Terminal renderer: prints results (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → JSON export: exports results (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → HTML dashboard: exports results (evidence: `cmd/sec-scan/main.go`)
- CLI workflow → Markdown report: exports results (evidence: `cmd/sec-scan/main.go`)
- HTML dashboard → Risk assessment: evaluates findings (evidence: `internal/report/html.go`)
- Markdown report → Risk assessment: evaluates findings (evidence: `internal/report/md.go`)
