semgrepShared

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSemgrepTextShort

func ParseSemgrepTextShort(filePath string, maxLength int) (string, bool, error)

Types

type Finding

type Finding struct {
	FilePath    string
	VulnDetails []VulnDetail
}

type Invocation

type Invocation struct {
	ExecutionSuccessful        bool           `json:"executionSuccessful"`
	ToolExecutionNotifications []Notification `json:"toolExecutionNotifications"`
}

type Notification

type Notification struct {
	Descriptor struct {
		ID string `json:"id"`
	} `json:"descriptor"`
	Level   string `json:"level"`
	Message struct {
		Text string `json:"text"`
	} `json:"message"`
}

type Result

type Result struct {
	RuleID  string `json:"ruleId"`
	Message struct {
		Text string `json:"text"`
	} `json:"message"`
	Locations []struct {
		PhysicalLocation struct {
			ArtifactLocation struct {
				URI       string `json:"uri"`
				URIBaseID string `json:"uriBaseId"`
			} `json:"artifactLocation"`
			Region struct {
				StartLine   int `json:"startLine"`
				StartColumn int `json:"startColumn"`
				EndLine     int `json:"endLine"`
				EndColumn   int `json:"endColumn"`
			} `json:"region"`
		} `json:"physicalLocation"`
	} `json:"locations"`
	Suppressions []struct {
		Kind   string `json:"kind"`
		Status string `json:"status,omitempty"`
		GUID   string `json:"guid,omitempty"`
	} `json:"suppressions,omitempty"`
}

type Rule

type Rule struct {
	DefaultConfiguration struct {
		Level string `json:"level"`
	} `json:"defaultConfiguration"`
	FullDescription struct {
		Text string `json:"text"`
	} `json:"fullDescription"`
	Help             string         `json:"help"`
	ID               string         `json:"id"`
	Name             string         `json:"name"`
	Properties       RuleProperties `json:"properties"`
	ShortDescription struct {
		Text string `json:"text"`
	} `json:"shortDescription"`
}

type RuleProperties

type RuleProperties struct {
	Precision        string   `json:"precision"`
	Tags             []string `json:"tags"`
	SecuritySeverity string   `json:"security-severity"`
}

type Run

type Run struct {
	Invocations []Invocation `json:"invocations"`
	Results     []Result     `json:"results"`
	Tool        struct {
		Driver struct {
			Name            string `json:"name"`
			SemanticVersion string `json:"semanticVersion"`
			Rules           []Rule `json:"rules"`
		} `json:"driver"`
	} `json:"tool"`
}

type SemgrepReportSarif

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

type SemgrepReportText

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

type VulnDetail

type VulnDetail struct {
	RuleName     string
	Description  string
	DetailsURL   string
	Autofix      string
	CodeSnippets []string
}

Jump to

Keyboard shortcuts

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