report

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package report generates HTML and JSON reports from Suri scan results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDiffHTML

func RenderDiffHTML(ctx context.Context, st *store.Store, baselineID, currentID, suriVersion string, w io.Writer) error

RenderDiffHTML writes a self-contained HTML diff report comparing two scans.

func RenderDiffJSON

func RenderDiffJSON(ctx context.Context, st *store.Store, baselineID, currentID string, w io.Writer) error

RenderDiffJSON writes a JSON diff report comparing two scans.

func RenderHTML

func RenderHTML(ctx context.Context, st *store.Store, scanID, suriVersion string, w io.Writer) error

RenderHTML writes a self-contained HTML report for scanID to w.

func RenderJSON

func RenderJSON(ctx context.Context, st *store.Store, scanID string, w io.Writer) error

RenderJSON writes a JSON report for scanID to w.

Types

type JSONDiffMeta

type JSONDiffMeta struct {
	BaselineID string `json:"baseline_id"`
	CurrentID  string `json:"current_id"`
}

JSONDiffMeta identifies the two scans being compared.

type JSONDiffReport

type JSONDiffReport struct {
	DiffMetadata JSONDiffMeta  `json:"diff_metadata"`
	New          []JSONFinding `json:"new"`
	Persistent   []JSONFinding `json:"persistent"`
	Resolved     []JSONFinding `json:"resolved"`
	GeneratedAt  string        `json:"generated_at"`
}

JSONDiffReport is the top-level structure for a JSON diff report.

type JSONEvidence

type JSONEvidence struct {
	ResponseStatus int    `json:"response_status,omitempty"`
	ResponseTimeMs int64  `json:"response_time_ms,omitempty"`
	RequestBytes   string `json:"request_bytes,omitempty"`
	ResponseBytes  string `json:"response_bytes,omitempty"`
}

JSONEvidence holds raw HTTP evidence with bytes base64-encoded.

type JSONFinding

type JSONFinding struct {
	ID           int64         `json:"id"`
	CheckID      string        `json:"check_id"`
	Severity     string        `json:"severity"`
	Title        string        `json:"title"`
	Description  string        `json:"description,omitempty"`
	URL          string        `json:"url"`
	Parameter    string        `json:"parameter,omitempty"`
	CWE          string        `json:"cwe,omitempty"`
	OWASP        string        `json:"owasp,omitempty"`
	Confidence   string        `json:"confidence"`
	IdentityHash string        `json:"identity_hash"`
	Evidence     *JSONEvidence `json:"evidence,omitempty"`
}

JSONFinding is a single finding in a JSON report.

type JSONReport

type JSONReport struct {
	ScanMetadata JSONScanMeta  `json:"scan_metadata"`
	Findings     []JSONFinding `json:"findings"`
	Summary      JSONSummary   `json:"summary"`
	GeneratedAt  string        `json:"generated_at"`
}

JSONReport is the top-level structure for a JSON scan report.

type JSONScanMeta

type JSONScanMeta struct {
	ID             string   `json:"id"`
	StartTime      string   `json:"start_time"`
	EndTime        string   `json:"end_time,omitempty"`
	EngagementName string   `json:"engagement_name"`
	SuriVersion    string   `json:"suri_version"`
	SeedURLs       []string `json:"seed_urls"`
	ExitStatus     *int     `json:"exit_status,omitempty"`
	ScopeFilePath  string   `json:"scope_file_path"`
}

JSONScanMeta holds the scan metadata block in a JSON report.

type JSONSummary

type JSONSummary struct {
	BySeverity map[string]int `json:"by_severity"`
	ByCheckID  map[string]int `json:"by_check_id"`
	Total      int            `json:"total"`
}

JSONSummary provides totals grouped by severity and check ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL