Documentation
¶
Overview ¶
Package report provides HTML report generation for pentest campaigns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SeverityOrder = []string{"critical", "high", "medium", "low", "info"}
SeverityOrder is the high→low display order for severity rows.
Functions ¶
func GenerateHTML ¶
func GenerateHTML(input ReportInput) (string, error)
GenerateHTML renders a pentest report as an HTML document.
func GeneratePDF ¶ added in v0.3.0
func GeneratePDF(input ReportInput) ([]byte, error)
GeneratePDF renders a pentest report as a PDF directly from the structured report data — pure Go, no headless browser. The layout mirrors the sections of the HTML report (engagement details, team, summary, findings).
func GenerateSummaryHTML ¶ added in v0.3.0
func GenerateSummaryHTML(in SummaryInput) (string, error)
GenerateSummaryHTML renders the executive-summary report as a self-contained HTML document (inline styles, printable). All dynamic values are escaped by html/template, so tenant-controlled strings cannot inject markup.
Types ¶
type CampaignData ¶
type CampaignData struct {
Name string
Description string
ClientName string
ClientContact string
Type string
Priority string
Status string
StartDate string
EndDate string
Methodology string
Team []TeamMemberData
}
CampaignData represents campaign data for report rendering.
type FindingData ¶
type FindingData struct {
Number string
Title string
Severity string
Status string
CVSSScore float64
CVSSVector string
CWE string
CVE string
OWASP string
Description string
Steps []string
POC string
Impact string
TechImpact string
Remediation string
References []string
Targets []string
AssignedTo string
CreatedAt time.Time
}
FindingData represents a finding for report rendering.
type ReportInput ¶
type ReportInput struct {
Campaign CampaignData
Findings []FindingData
Stats StatsData
GeneratedAt time.Time
Classification string
Watermark string
ReportType string
IncludePOC bool
IncludeEvidence bool
}
ReportInput contains all data needed to generate a report.
type StatsData ¶
type StatsData struct {
Total int64
Critical int64
High int64
Medium int64
Low int64
Info int64
Progress float64
AvgCVSS float64
MaxCVSS float64
}
StatsData represents campaign statistics for report rendering.
type SummaryInput ¶ added in v0.3.0
type SummaryInput struct {
TenantName string
GeneratedAt time.Time
Total int64
Open int64
Resolved int64
// BySeverity is keyed by lower-case severity ("critical"…"info"); missing
// keys render as 0. Ordered for display by SeverityOrder.
BySeverity map[string]int64
// NewInWindow / ResolvedInWindow describe movement over the reporting window
// (e.g. the last 7 days); WindowDays labels it. Zero values are fine.
WindowDays int
NewInWindow int64
ResolvedInWindow int64
// Risk posture (open findings) — the metrics that drive remediation
// priority. Zero values render as 0; the card always shows.
KevOpen int64 // open findings on the CISA KEV list (known exploited)
EpssHighOpen int64 // open findings with EPSS >= 10%
SLABreached int64 // open findings past their SLA deadline
}
SummaryInput is the data for a tenant-wide findings executive summary — the generic (non-pentest) report a scheduled "executive_summary" report renders. It is built from vulnerability.FindingStats by the caller (kept dependency-free here so this package has no domain import).
type TeamMemberData ¶
TeamMemberData represents a team member for report rendering.