report

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaskSecrets

func MaskSecrets(evidence string) string

MaskSecrets masks sensitive information in the evidence field of a finding

func SortFindingsBySeverity

func SortFindingsBySeverity(findings []rules.Finding) []rules.Finding

SortFindingsBySeverity sorts findings by severity (Critical, High, Medium, Low, Info)

Types

type Generator

type Generator struct {
	Result   ScanResult
	Format   string
	Verbose  bool
	FilePath string
}

Generator creates a formatted report from scan results

func NewGenerator

func NewGenerator(result ScanResult, format string, verbose bool, filePath string) *Generator

NewGenerator creates a new report generator

func (*Generator) Generate

func (g *Generator) Generate() error

Generate creates and outputs the report in the specified format

type ResultSummary

type ResultSummary struct {
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medium   int `json:"medium"`
	Low      int `json:"low"`
	Info     int `json:"info"`
	Total    int `json:"total"`
}

ResultSummary provides a summary of the scan findings by severity

func CalculateSummary

func CalculateSummary(findings []rules.Finding) ResultSummary

CalculateSummary computes the summary statistics for scan findings

type ScanResult

type ScanResult struct {
	Repository     string          `json:"repository"`
	ScanTime       time.Time       `json:"scanTime"`
	Duration       time.Duration   `json:"duration"`
	WorkflowsCount int             `json:"workflowsCount"`
	RulesCount     int             `json:"rulesCount"`
	Findings       []rules.Finding `json:"findings"`
	Summary        ResultSummary   `json:"summary"`
}

ScanResult represents the overall result of a security scan

Jump to

Keyboard shortcuts

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