Documentation
¶
Index ¶
- func GenerateDataSourceIDForSemgrep(f *SemgrepFinding) string
- func GenerateGitHubURL(githubBaseURL, masterBranch string, f *SemgrepFinding) string
- func GeneratePutFindingRequest(projectID uint32, f *SemgrepFinding) (*finding.PutFindingRequest, error)
- func GetScoreSemgrep(serverity, likelihood, impact string) float32
- func GetSemgrepRecommend(repoName, fileName, rule, semgrepMessage, githubURL, line string) *recommend
- func NewHandler(ctx context.Context, fc finding.FindingServiceClient, ...) (*sqsHandler, error)
- type SemgrepExtra
- type SemgrepFinding
- type SemgrepLine
- type SemgrepMetadata
- type SemgrepResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDataSourceIDForSemgrep ¶ added in v0.11.0
func GenerateDataSourceIDForSemgrep(f *SemgrepFinding) string
func GenerateGitHubURL ¶ added in v0.11.0
func GenerateGitHubURL(githubBaseURL, masterBranch string, f *SemgrepFinding) string
func GeneratePutFindingRequest ¶ added in v0.11.0
func GeneratePutFindingRequest(projectID uint32, f *SemgrepFinding) (*finding.PutFindingRequest, error)
func GetScoreSemgrep ¶ added in v0.11.0
func GetSemgrepRecommend ¶ added in v0.11.0
func GetSemgrepRecommend(repoName, fileName, rule, semgrepMessage, githubURL, line string) *recommend
func NewHandler ¶
func NewHandler( ctx context.Context, fc finding.FindingServiceClient, ac alert.AlertServiceClient, cc code.CodeServiceClient, codeDataKey string, githubDefaultToken string, limitRepositorySizeKb int, l logging.Logger, ) (*sqsHandler, error)
Types ¶
type SemgrepExtra ¶ added in v0.11.0
type SemgrepExtra struct {
EngineKind string `json:"engine_kind,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
IsIgnored bool `json:"is_ignored,omitempty"`
Lines string `json:"lines,omitempty"`
Message string `json:"message,omitempty"`
Severity string `json:"severity,omitempty"`
ValidateState string `json:"validate_state,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
}
type SemgrepFinding ¶ added in v0.11.0
type SemgrepFinding struct {
Repository string `json:"repository,omitempty"`
RepoVisibility string `json:"repo_visibility,omitempty"`
GitHubURL string `json:"github_url,omitempty"`
CheckID string `json:"check_id,omitempty"`
Path string `json:"path,omitempty"`
Start *SemgrepLine `json:"start,omitempty"`
End *SemgrepLine `json:"end,omitempty"`
Extra *SemgrepExtra `json:"extra,omitempty"`
}
func ParseSemgrepResult ¶ added in v0.11.0
func ParseSemgrepResult(dir, scanResult, repository, masterBranch, githubBaseURL string) ([]*SemgrepFinding, error)
type SemgrepLine ¶ added in v0.11.0
type SemgrepMetadata ¶ added in v0.11.0
type SemgrepMetadata struct {
Likelihood string `json:"likelihood,omitempty"`
Impact string `json:"impact,omitempty"`
}
SemgrepMetadata is a struct for semgrep metadata. If `security` category, a metadata has `likelihood` and `impact` fields(required fields). refs: https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repository/#including-fields-required-by-security-category
type SemgrepResults ¶ added in v0.11.0
type SemgrepResults struct {
Results []*SemgrepFinding `json:"results,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.