report

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package report renders scan results as text, JSON or SARIF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, r *Report) error

JSON writes the full report. Empty lists are written as [] rather than null.

func SARIF

func SARIF(w io.Writer, r *Report) error

SARIF writes vulnerable and unknown findings as SARIF 2.1.0, which DefectDojo and most code scanning tools import. Rule IDs are "<detector>/<kind>". Every result has a fingerprint that stays the same across runs (DefectDojo deduplicates on it) and does not depend on line numbers or wording.

func Text

func Text(w io.Writer, r *Report, o Options)

Text writes a human-readable report.

Types

type DetectorInfo

type DetectorInfo struct {
	ID         string   `json:"id"`
	Title      string   `json:"title"`
	CVEs       []string `json:"cves,omitempty"`
	Advisories []string `json:"advisories,omitempty"`
	Data       string   `json:"data,omitempty"`
}

DetectorInfo is what the report says about each detector that ran.

type Options

type Options struct {
	ShowCleared bool // list fixed and inactive findings
	ShowSkipped bool // list every file that could not be scanned
}

Options control the text report.

type Report

type Report struct {
	Tool      string           `json:"tool"`
	Version   string           `json:"version"`
	Detectors []DetectorInfo   `json:"detectors"`
	Targets   []*engine.Target `json:"targets"`
	// contains filtered or unexported fields
}

Report is the whole run.

func New

func New(tool, version string, dets []engine.Detector) *Report

New starts a report for the detectors that will run.

Jump to

Keyboard shortcuts

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