Documentation
¶
Overview ¶
Package report handles all output formatting for Batesian findings.
Index ¶
- Variables
- func WriteSARIF(w io.Writer, target string, results []engine.RunResult, toolVersion string) error
- type AttackFlag
- type Format
- type MCPProbeResult
- type MCPPromptSummary
- type MCPResourceSummary
- type MCPToolSummary
- type Printer
- func (p *Printer) Banner()
- func (p *Printer) Error(msg string)
- func (p *Printer) Info(msg string)
- func (p *Printer) PrintJSON(v any) error
- func (p *Printer) PrintMCPProbeTable(r *MCPProbeResult)
- func (p *Printer) PrintProbeTable(r *ProbeResult)
- func (p *Printer) PrintScanSummary(results []engine.RunResult)
- func (p *Printer) ProbeHeader(target, protocol string)
- func (p *Printer) Success(msg string)
- func (p *Printer) Verbose(msg string)
- func (p *Printer) Warn(msg string)
- type ProbeResult
- type SkillSummary
Constants ¶
This section is empty.
Variables ¶
var ( Bold = color.New(color.Bold).SprintFunc() Green = color.New(color.FgGreen, color.Bold).SprintFunc() Yellow = color.New(color.FgYellow, color.Bold).SprintFunc() Red = color.New(color.FgRed, color.Bold).SprintFunc() Cyan = color.New(color.FgCyan).SprintFunc() Dim = color.New(color.Faint).SprintFunc() BoldRed = color.New(color.FgRed, color.Bold).SprintFunc() )
Color helpers - centralized so they can be disabled (e.g. no-color, CI).
Functions ¶
Types ¶
type AttackFlag ¶
type AttackFlag struct {
Severity string // "critical", "high", "medium", "low", "info"
RuleID string
Message string
}
AttackFlag represents a notable finding from the probe phase.
type Format ¶
type Format string
Format represents the output format for a report.
func ParseFormat ¶
ParseFormat parses a format string into a Format. Returns an error for unknown format strings rather than silently defaulting to table, so typos like --output=jsno are caught immediately.
type MCPProbeResult ¶
type MCPProbeResult struct {
ServerName string
ServerVersion string
ServerTitle string
URL string
ProtocolVersion string
Elapsed time.Duration
// Capabilities
HasTools bool
HasResources bool
HasPrompts bool
HasSampling bool
HasLogging bool
// Enumerated surface
Tools []MCPToolSummary
Resources []MCPResourceSummary
Prompts []MCPPromptSummary
// Attack surface flags
Flags []AttackFlag
}
MCPProbeResult holds the structured data from an MCP probe.
type MCPPromptSummary ¶
MCPPromptSummary is a condensed view of an MCP prompt template.
type MCPResourceSummary ¶
MCPResourceSummary is a condensed view of an MCP resource.
type MCPToolSummary ¶
MCPToolSummary is a condensed view of an MCP tool.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer writes formatted output to a writer.
func (*Printer) PrintJSON ¶
PrintJSON marshals v to indented JSON and writes it to the printer's writer.
func (*Printer) PrintMCPProbeTable ¶
func (p *Printer) PrintMCPProbeTable(r *MCPProbeResult)
PrintMCPProbeTable renders an MCP probe result to the terminal.
func (*Printer) PrintProbeTable ¶
func (p *Printer) PrintProbeTable(r *ProbeResult)
PrintProbeTable renders the probe result as a formatted table to the terminal.
func (*Printer) PrintScanSummary ¶
PrintScanSummary renders the scan results as a terminal table.
func (*Printer) ProbeHeader ¶
ProbeHeader prints the probe target header.
type ProbeResult ¶
type ProbeResult struct {
// Basic info
Name string
Description string
URL string
Version string
Provider string
// Capabilities
Streaming bool
PushNotifications bool
ExtendedCardAvailable bool
// Security
AuthRequired bool
SecuritySchemes []string
// Skills
Skills []SkillSummary
// Attack surface flags
Flags []AttackFlag
// Timing
Elapsed time.Duration
}
ProbeResult holds the structured data for a probe result display.