report

package
v0.0.0-...-a38ba0a Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package report serializes collected scan results to sarif and markdown. it's deliberately decoupled from the scan package: callers map their own results into report.Result, so report never imports a scanner type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Markdown

func Markdown(results []Result) []byte

Markdown renders results as a readable report grouped by target, then by module, with each module's finding pretty-printed as a json code block.

func SARIF

func SARIF(results []Result) ([]byte, error)

SARIF serializes results to a minimal valid sarif 2.1.0 log. Each module result becomes one sarif result tagged with its module id (the rule) and the target uri, with the raw module data inlined into the message for context.

Types

type Result

type Result struct {
	Target   string
	Module   string
	Severity string
	Data     json.RawMessage
}

Result is one module's output for one target. Data is whatever the scanner returned, carried as raw json so report stays free of scan types. Severity is the normalized rank ("critical".."info", or "" when the source carries none), passed in as a plain string so report keeps its independence from the finding package; the sarif writer maps it onto a sarif level.

Jump to

Keyboard shortcuts

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