sarif

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	*sarif.Report
	// contains filtered or unexported fields
}

func ReadReport

func ReadReport(inputPath string, logger hclog.Logger, sourceFolder string) (*Report, error)

func (Report) CollectSeverityInfo

func (r Report) CollectSeverityInfo() map[string]int

function that collects information about amount of low, mediumn and high severity issues returns a map with this information, and a total amount of issues

func (Report) EnrichResultsCodeFlowProperty

func (r Report) EnrichResultsCodeFlowProperty(locationWebURLCallback func(artifactLocation *sarif.Location) string)

EnrichResultsCodeFlowProperty function enriches code flow location properties with source code and URI values

func (Report) EnrichResultsLevelProperty

func (r Report) EnrichResultsLevelProperty()

EnrichResultsLevelProperty function to enrich results properties with level taken from corersponding rules propertiues "problem.severity" field

func (Report) EnrichResultsLocationProperty

func (r Report) EnrichResultsLocationProperty(location *sarif.Location) error

EnrichResultsLocationProperty function enriches sarif location properties with source code and URI values

func (Report) EnrichResultsLocationURIProperty added in v0.3.0

func (r Report) EnrichResultsLocationURIProperty(locationWebURLCallback func(artifactLocation *sarif.Location) string)

func (Report) EnrichResultsTitleProperty

func (r Report) EnrichResultsTitleProperty()

EnrichResultsTitleProperty function enriches sarif results properties with title and description values

func (Report) ExtractToolNameAndVersion

func (r Report) ExtractToolNameAndVersion() (*ToolMetadata, error)

ExtractToolNameAndVersion function extracts tool name and version from a sarif report

func (Report) RemoveDataflowDuplicates

func (r Report) RemoveDataflowDuplicates()

remove codeflow duplicates each codeflow may have multiple threatflows. These threatflows may be equal for different codeflows. This function removes duplicates from codeflows if the codeflow is empty, it is removed

func (Report) SortResultsByLevel

func (r Report) SortResultsByLevel()

SortResultsByLevel function sorts sarif results by level

type ToolMetadata

type ToolMetadata struct {
	Name    string
	Version *string
}

Jump to

Keyboard shortcuts

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