sarif

package
Version: v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnalysisTarget = "analysisTarget"
	UTF8           = "UTF-8"
	Fail           = "fail"
	Warning        = "warning"
	Error          = "error"
	Note           = "note"
	None           = "none"
)
View Source
const Schema = "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.4.json"
View Source
const Version = "2.1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Location       ArtifactLocation `json:"location"`
	Length         int              `json:"length"`
	SourceLanguage string           `json:"sourceLanguage"`
	Roles          []string         `json:"roles"`
	Encoding       string           `json:"encoding"`
}

type ArtifactChange

type ArtifactChange struct {
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	Replacements     []Replacement    `json:"replacements"`
}

type ArtifactContent

type ArtifactContent struct {
	Text string `json:"text"`
}

type ArtifactLocation

type ArtifactLocation struct {
	URI   string `json:"uri,omitempty"`
	Index int    `json:"index,omitempty"`
}

type Fix

type Fix struct {
	Description     Message          `json:"description"`
	ArtifactChanges []ArtifactChange `json:"artifactChanges"`
}

type Hash

type Hash struct {
	Sha256 string `json:"sha-256"`
}

type Invocation

type Invocation struct {
	CommandLine         string           `json:"commandLine"`
	Arguments           []string         `json:"arguments,omitempty"`
	WorkingDirectory    ArtifactLocation `json:"workingDirectory"`
	ExecutionSuccessful bool             `json:"executionSuccessful"`
}

type Location

type Location struct {
	ID               int              `json:"id,omitempty"`
	Message          *Message         `json:"message,omitempty"`
	PhysicalLocation PhysicalLocation `json:"physicalLocation"`
}

type Log

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

type Message

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

type PhysicalLocation

type PhysicalLocation struct {
	ArtifactLocation ArtifactLocation `json:"artifactLocation"`
	Region           Region           `json:"region"`
}

type Region

type Region struct {
	StartLine   int `json:"startLine"`
	StartColumn int `json:"startColumn"`
	EndLine     int `json:"endLine,omitempty"`
	EndColumn   int `json:"endColumn,omitempty"`
}

type Replacement

type Replacement struct {
	DeletedRegion   Region          `json:"deletedRegion"`
	InsertedContent ArtifactContent `json:"insertedContent"`
}

type ReportingConfiguration

type ReportingConfiguration struct {
	Enabled    bool                   `json:"bool"`
	Level      string                 `json:"level"`
	Parameters map[string]interface{} `json:"parameters"`
}

type ReportingDescriptor

type ReportingDescriptor struct {
	ID               string  `json:"id"`
	ShortDescription Message `json:"shortDescription"`
	// FullDescription  Message `json:"fullDescription"`
	Help    Message `json:"help"`
	HelpURI string  `json:"helpUri,omitempty"`
}

type Result

type Result struct {
	RuleID string `json:"ruleId"`
	// RuleIndex        int        `json:"ruleIndex"`
	Kind             string        `json:"kind"`
	Level            string        `json:"level"`
	Message          Message       `json:"message"`
	Locations        []Location    `json:"locations,omitempty"`
	RelatedLocations []Location    `json:"relatedLocations,omitempty"`
	Fixes            []Fix         `json:"fixes,omitempty"`
	Suppressions     []Suppression `json:"suppressions"`
}

type Run

type Run struct {
	Tool        Tool         `json:"tool"`
	Results     []Result     `json:"results,omitempty"`
	Invocations []Invocation `json:"invocations,omitempty"`
	Artifacts   []Artifact   `json:"artifacts,omitempty"`
}

type Suppression

type Suppression struct {
	Kind          string `json:"kind"`
	Justification string `json:"justification"`
}

type Tool

type Tool struct {
	Driver ToolComponent `json:"driver"`
}

type ToolComponent

type ToolComponent struct {
	Name            string                `json:"name"`
	Version         string                `json:"version"`
	SemanticVersion string                `json:"semanticVersion"`
	InformationURI  string                `json:"informationUri"`
	Rules           []ReportingDescriptor `json:"rules,omitempty"`
}

Source Files

Jump to

Keyboard shortcuts

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