sarif

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToSARIF

func ConvertToSARIF(analysis *api.SecurityAnalysis, consoleUrl string) (string, error)

ConvertToSARIF converts SecurityAnalysis to SARIF format

Types

type SarifArtifactContent

type SarifArtifactContent struct {
	Text string `json:"text,omitempty"`
}

type SarifArtifactLocation

type SarifArtifactLocation struct {
	URI       string `json:"uri"`
	URIBaseID string `json:"uriBaseId,omitempty"`
}

type SarifDriver

type SarifDriver struct {
	Name           string      `json:"name"`
	InformationUri string      `json:"informationUri,omitempty"`
	Version        string      `json:"version,omitempty"`
	Rules          []SarifRule `json:"rules,omitempty"`
}

type SarifLocation

type SarifLocation struct {
	PhysicalLocation SarifPhysicalLocation `json:"physicalLocation"`
}

type SarifLog

type SarifLog struct {
	Version string     `json:"version"`
	Schema  string     `json:"$schema"`
	Runs    []SarifRun `json:"runs"`
}

SARIF 2.1.0 structures

type SarifMessage

type SarifMessage struct {
	Text     string `json:"text"`
	Markdown string `json:"markdown,omitempty"`
}

type SarifMultiformatMessageString

type SarifMultiformatMessageString struct {
	Text     string `json:"text"`
	Markdown string `json:"markdown,omitempty"`
}

type SarifPhysicalLocation

type SarifPhysicalLocation struct {
	ArtifactLocation SarifArtifactLocation `json:"artifactLocation"`
	Region           SarifRegion           `json:"region,omitempty"`
}

type SarifRegion

type SarifRegion struct {
	StartLine   int                   `json:"startLine,omitempty"`
	StartColumn int                   `json:"startColumn,omitempty"`
	EndLine     int                   `json:"endLine,omitempty"`
	EndColumn   int                   `json:"endColumn,omitempty"`
	Snippet     *SarifArtifactContent `json:"snippet,omitempty"`
}

type SarifResult

type SarifResult struct {
	RuleID     string                        `json:"ruleId"`
	Level      string                        `json:"level,omitempty"` // "error", "warning", "note", "none"
	Message    SarifMessage                  `json:"message"`
	Help       SarifMultiformatMessageString `json:"help,omitempty"`
	HelpUri    string                        `json:"helpUri,omitempty"`
	Locations  []SarifLocation               `json:"locations,omitempty"`
	Properties map[string]any                `json:"properties,omitempty"`
}

type SarifRule

type SarifRule struct {
	ID               string                        `json:"id"`
	ShortDescription SarifMultiformatMessageString `json:"shortDescription,omitempty"`
	FullDescription  SarifMultiformatMessageString `json:"fullDescription,omitempty"`
	Help             SarifMultiformatMessageString `json:"help,omitempty"`
	Properties       map[string]any                `json:"properties,omitempty"`
}

type SarifRun

type SarifRun struct {
	Tool    SarifTool     `json:"tool"`
	Results []SarifResult `json:"results"`
}

type SarifTool

type SarifTool struct {
	Driver SarifDriver `json:"driver"`
}

Jump to

Keyboard shortcuts

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