sarif

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 0 Imported by: 5 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"`
	URIBaseID string `json:"uriBaseId"`
}

type Category

type Category string
const (
	WontFix         Category = "wont-fix"
	NotVulnerable   Category = "not-vulnerable"
	TemporaryIgnore Category = "temporary-ignore"
)

type CodeFlow

type CodeFlow struct {
	ThreadFlows []ThreadFlow `json:"threadFlows"`
}

type DefaultConfiguration

type DefaultConfiguration struct {
	Level string `json:"level"`
}

type Driver

type Driver struct {
	Name            string `json:"name"`
	SemanticVersion string `json:"semanticVersion"`
	Version         string `json:"version"`
	Rules           []Rule `json:"rules"`
}

type ExampleCommitFix

type ExampleCommitFix struct {
	CommitURL string `json:"commitURL"`
	Lines     []struct {
		Line       string `json:"line"`
		LineNumber int    `json:"lineNumber"`
		LineChange string `json:"lineChange"`
	} `json:"lines"`
}

type Fingerprints

type Fingerprints struct {
	Num0 string `json:"0"`
	Num1 string `json:"1"`
}

type Help

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

type IgnoredBy

type IgnoredBy struct {
	Name  string  `json:"name"`
	Email *string `json:"email"`
}

type Location

type Location struct {
	ID               int              `json:"id"`
	PhysicalLocation PhysicalLocation `json:"physicalLocation"`
}

type PhysicalLocation

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

type Result

type Result struct {
	RuleID       string           `json:"ruleId"`
	RuleIndex    int              `json:"ruleIndex"`
	Level        string           `json:"level"`
	Message      ResultMessage    `json:"message"`
	Locations    []Location       `json:"locations"`
	Fingerprints Fingerprints     `json:"fingerprints"`
	CodeFlows    []CodeFlow       `json:"codeFlows"`
	Properties   ResultProperties `json:"properties"`
	Suppressions []Suppression    `json:"suppressions"`
}

type ResultMessage

type ResultMessage struct {
	Text      string   `json:"text"`
	Markdown  string   `json:"markdown"`
	Arguments []string `json:"arguments"`
}

type ResultProperties

type ResultProperties struct {
	PriorityScore        int `json:"priorityScore"`
	PriorityScoreFactors []struct {
		Label bool   `json:"label"`
		Type  string `json:"type"`
	} `json:"priorityScoreFactors"`
	IsAutofixable bool `json:"isAutofixable"`
}

type Rule

type Rule struct {
	ID                   string               `json:"id"`
	Name                 string               `json:"name"`
	ShortDescription     ShortDescription     `json:"shortDescription"`
	DefaultConfiguration DefaultConfiguration `json:"defaultConfiguration"`
	Help                 Help                 `json:"help"`
	Properties           RuleProperties       `json:"properties"`
}

type RuleProperties

type RuleProperties struct {
	Tags                      []string           `json:"tags"`
	Categories                []string           `json:"categories"`
	ExampleCommitFixes        []ExampleCommitFix `json:"exampleCommitFixes"`
	ExampleCommitDescriptions []string           `json:"exampleCommitDescriptions"`
	Precision                 string             `json:"precision"`
	RepoDatasetSize           int                `json:"repoDatasetSize"`
	Cwe                       []string           `json:"cwe"`
}

type Run

type Run struct {
	Tool       Tool          `json:"tool"`
	Results    []Result      `json:"results"`
	Properties RunProperties `json:"properties"`
}

type RunProperties

type RunProperties struct {
	Coverage []struct {
		Files       int    `json:"files"`
		IsSupported bool   `json:"isSupported"`
		Lang        string `json:"lang"`
		Type        string `json:"type"`
	} `json:"coverage"`
}

type SarifCoverage added in v1.6.1

type SarifCoverage struct {
	Files       int    `json:"files"`
	IsSupported bool   `json:"isSupported"`
	Lang        string `json:"lang"`
}

type SarifDocument added in v1.4.1

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

SarifDocument matches the spec in https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json

type SarifResponse

type SarifResponse struct {
	Type     string  `json:"type"`
	Progress float64 `json:"progress"`
	Status   string  `json:"status"`
	Timing   struct {
		FetchingCode int `json:"fetchingCode"`
		Queue        int `json:"queue"`
		Analysis     int `json:"analysis"`
	} `json:"timing"`
	Coverage []SarifCoverage `json:"coverage"`
	Sarif    SarifDocument   `json:"sarif"`
}

type ShortDescription

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

type Suppression

type Suppression struct {
	Justification string                `json:"justification"`
	Properties    SuppressionProperties `json:"properties"`
}

type SuppressionProperties

type SuppressionProperties struct {
	Category   Category  `json:"category"`
	Expiration *string   `json:"expiration"`
	IgnoredOn  string    `json:"ignoredOn"` // https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790703
	IgnoredBy  IgnoredBy `json:"ignoredBy"`
}

type ThreadFlow

type ThreadFlow struct {
	Locations []ThreadFlowLocation `json:"locations"`
}

type ThreadFlowLocation

type ThreadFlowLocation struct {
	Location Location `json:"location"`
}

type Tool

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

Jump to

Keyboard shortcuts

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