Documentation
¶
Overview ¶
Package semgrep holds all of the data structures and logic related to running semgrep commands on a codebase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dev ¶
type Dev struct { Origin string `json:"origin" yaml:"origin"` RID string `json:"r_id" yaml:"r_id"` RuleID string `json:"rule_id" yaml:"rule_id"` RVID string `json:"rv_id" yaml:"rv_id"` URL string `json:"url" yaml:"url"` VersionID string `json:"version_id" yaml:"version_id"` }
Dev holds all of the development information for a semgrep finding.
type Error ¶
type Error struct { Code int `json:"code" yaml:"code"` Level string `json:"level" yaml:"level"` Message string `json:"message" yaml:"message"` Type string `json:"type" yaml:"type"` }
Error holds the error information for a semgrep finding.
type Extra ¶
type Extra struct { EngineKind string `json:"engine_kind" yaml:"engine_kind"` Fingerprint string `json:"fingerprint" yaml:"fingerprint"` IsIgnored bool `json:"is_ignored" yaml:"is_ignored"` Lines string `json:"lines" yaml:"lines"` Message string `json:"message" yaml:"message"` Metadata Metadata `json:"metadata" yaml:"metadata"` Metavars map[string]Metavar `json:"metavars" yaml:"metavars"` Severity string `json:"severity" yaml:"severity"` ValidationState string `json:"validation_state" yaml:"validation_state"` SemgrepDev Dev `json:"semgrep.dev" yaml:"semgrep.dev"` Shortlink string `json:"shortlink" yaml:"shortlink"` Source string `json:"source" yaml:"source"` SourceRuleURL string `json:"source-rule-url" yaml:"source-rule-url"` }
Extra holds additional information for a semgrep finding.
type Metadata ¶
type Metadata struct { Category string `json:"category" yaml:"category"` Confidence string `json:"confidence" yaml:"confidence"` CWE []string `json:"cwe" yaml:"cwe"` CWE2021Top25 bool `json:"cwe2021-top25" yaml:"cwe2021-top25"` CWE2022Top25 bool `json:"cwe2022-top25" yaml:"cwe2022-top25"` Impact string `json:"impact" yaml:"impact"` License string `json:"license" yaml:"license"` Likelihood string `json:"likelihood" yaml:"likelihood"` OWASP []string `json:"owasp" yaml:"owasp"` References []string `json:"references" yaml:"references"` Subcategory []string `json:"subcategory" yaml:"subcategory"` Technology []string `json:"technology" yaml:"technology"` VulnerabilityClass []string `json:"vulnerability_class" yaml:"vulnerability_class"` }
Metadata holds the metadata for a semgrep finding.
type Metavar ¶
type Metavar struct { AbstractContent string `json:"abstract_content" yaml:"abstract_content"` End struct { Col int `json:"col" yaml:"col"` Line int `json:"line" yaml:"line"` Offset int `json:"offset" yaml:"offset"` } `json:"end" yaml:"end"` Start struct { Col int `json:"col" yaml:"col"` Line int `json:"line" yaml:"line"` Offset int `json:"offset" yaml:"offset"` } `json:"start" yaml:"start"` }
Metavar holds the meta variable information for a semgrep finding.
type Report ¶
type Report struct { Errors []Error `json:"errors" yaml:"errors"` Results []Result `json:"results" yaml:"results"` }
Report holds all of the information for a semgrep run, including all of the non-fatal errors and results.
type Result ¶
type Result struct { CheckID string `json:"check_id" yaml:"check_id"` Path string `json:"path" yaml:"path"` Start struct { Line int `json:"line" yaml:"line"` Col int `json:"col" yaml:"col"` Offset int `json:"offset" yaml:"offset"` } `json:"start" yaml:"start"` End struct { Line int `json:"line" yaml:"line"` Col int `json:"col" yaml:"col"` Offset int `json:"offset" yaml:"offset"` } `json:"end" yaml:"end"` Extra Extra `json:"extra" yaml:"extra"` }
Result holds the output result information for a given semgrep finding.
Click to show internal directories.
Click to hide internal directories.