format

package
v1.202.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 0 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactLocation

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

ArtifactLocation describing the path of the artifact

type DefaultConfiguration

type DefaultConfiguration struct {
	Properties DefaultProperties `json:"properties"`
	Level      string            `json:"level,omitempty"` //This exists in the template, but not sure how it is populated. TODO.
}

DefaultConfiguration

type DefaultProperties

type DefaultProperties struct {
	DefaultSeverity string `json:"DefaultSeverity"`
}

DefaultProperties

type Driver

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

Driver meta information for the scan and tool context

type Help

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

Help provides additional guidance to resolve the finding

type Location

type Location struct {
	PhysicalLocation ArtifactLocation  `json:"physicalLocation,omitempty"`
	Region           Region            `json:"region,omitempty"`
	LogicalLocations []LogicalLocation `json:"logicalLocations,omitempty"`
}

Location of the finding

type LogicalLocation

type LogicalLocation struct {
	FullyQualifiedName string `json:"fullyQualifiedName"`
}

LogicalLocation of the finding

type Message

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

Message to detail the finding

type Region

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

Region where the finding was detected

type Relationships

type Relationships struct {
	Target Target   `json:"target"`
	Kinds  []string `json:"kinds"`
}

Relationships

type Results

type Results struct {
	RuleID         string           `json:"ruleId"`
	RuleIndex      int              `json:"ruleIndex"`
	Level          string           `json:"level,omitempty"`
	Message        Message          `json:"message"`
	AnalysisTarget ArtifactLocation `json:"analysisTarget,omitempty"`
	Locations      []Location       `json:"locations"`
	/*CodeFlows        []CodeFlow        `json:"codeFlows"`
	RelatedLocations []RelatedLocation `json:"relatedLocations"`*/
	Properties SarifProperties `json:"properties"`
}

Results these structs are relevant to the Results object

type Runs

type Runs struct {
	Results []Results `json:"results"`
	Tool    Tool      `json:"tool"`
}

Runs of a Tool and related Results

type SARIF

type SARIF struct {
	Schema  string `json:"$schema" default:"https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos01/schemas/sarif-schema-2.1.0.json"`
	Version string `json:"version" default:"2.1.0"`
	Runs    []Runs `json:"runs"`
}

SARIF format related JSON structs

type SarifProperties

type SarifProperties struct {
	InstanceID        string `json:"InstanceID"`
	InstanceSeverity  string `json:"InstanceSeverity"`
	Confidence        string `json:"Confidence"`
	Audited           bool   `json:"Audited"`
	ToolSeverity      string `json:"ToolSeverity"`
	ToolSeverityIndex int    `json:"ToolSeverityIndex"`
	ToolState         string `json:"ToolState"`
	ToolStateIndex    int    `json:"ToolStateIndex"`
	ToolAuditMessage  string `json:"ToolAuditMessage"`
	UnifiedAuditState string `json:"UnifiedAuditState"`
}

SarifProperties adding additional information/context to the finding

type SarifRule

type SarifRule struct {
	ID                   string               `json:"id"`
	GUID                 string               `json:"guid"`
	Name                 string               `json:"name,omitempty"`
	ShortDescription     Message              `json:"shortDescription"`
	FullDescription      Message              `json:"fullDescription"`
	DefaultConfiguration DefaultConfiguration `json:"defaultConfiguration"`
	HelpURI              string               `json:"helpUri,omitempty"`
	Help                 Help                 `json:"help,omitempty"`
	Relationships        []Relationships      `json:"relationships,omitempty"`
	Properties           *SarifRuleProperties `json:"properties,omitempty"`
}

SarifRule related rule use to identify the finding

type SarifRuleProperties

type SarifRuleProperties struct {
	Accuracy    string   `json:"Accuracy,omitempty"`
	Impact      string   `json:"Impact,omitempty"`
	Probability string   `json:"Probability,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Precision   string   `json:"precision,omitempty"`
}

SarifRuleProperties

type SupportedTaxonomies

type SupportedTaxonomies struct {
	Name  string `json:"name"`
	Index int    `json:"index"`
	GUID  string `json:"guid"`
}

SupportedTaxonomies

type Target

type Target struct {
	ID            string        `json:"id"`
	ToolComponent ToolComponent `json:"toolComponent"`
}

Target

type Tool

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

Tool these structs are relevant to the Tool object

type ToolComponent

type ToolComponent struct {
	Name string `json:"name"`
	GUID string `json:"guid"`
}

ToolComponent

Jump to

Keyboard shortcuts

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