Skip to content

Commit

Permalink
Add missing Detection Date to report
Browse files Browse the repository at this point in the history
  • Loading branch information
margaritalm authored and pedrompflopes committed Dec 21, 2023
1 parent 46ae291 commit adb4742
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
21 changes: 12 additions & 9 deletions internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -1270,15 +1270,18 @@ func parseGlSastVulnerability(result *wrappers.ScanResult, glSast *wrappers.GlSa
message := fmt.Sprintf("%s@%s:%s", queryName, fileName, lineNumber)

glSast.Vulnerabilities = append(glSast.Vulnerabilities, wrappers.GlVulnerabilities{
ID: ID,
Category: category,
Name: queryName,
Message: message,
Description: result.Description,
CVE: ID,
Severity: cases.Title(language.English).String(result.Severity),
Confidence: cases.Title(language.English).String(result.Severity),
Solution: "",
ID: ID,
Category: category,
Name: queryName,
Message: message,
Description: result.Description,
CVE: ID,
Severity: cases.Title(language.English).String(result.Severity),
Confidence: cases.Title(language.English).String(result.Severity),
DetectionDate: result.FirstFoundAt,
VulnerabilityStatus: result.Status,
VulnerabilityState: result.State,
Solution: "",

Scanner: wrappers.GlScanner{
ID: category,
Expand Down
34 changes: 19 additions & 15 deletions internal/wrappers/results-gl-sast.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@ type GlSastResultsCollection struct {
Vulnerabilities []GlVulnerabilities `json:"vulnerabilities"`
}
type GlVulnerabilities struct {
ID string `json:"id"`
Category string `json:"category"`
Name string `json:"name"`
Message string `json:"message"`
Description string `json:"description"`
CVE string `json:"cve"`
Severity string `json:"severity"`
Confidence string `json:"confidence"`
Solution string `json:"solution"`
Scanner GlScanner `json:"scanner"`
Identifiers []Identifier `json:"identifiers"`
Links []string `json:"links"`
Tracking Tracking `json:"tracking"`
Flags []Flag `json:"flags"`
Location Location `json:"location"`
ID string `json:"id"`
Category string `json:"category"`
Name string `json:"name"`
Message string `json:"message"`
Description string `json:"description"`
CVE string `json:"cve"`
Severity string `json:"severity"`
Confidence string `json:"confidence"`
Solution string `json:"solution"`
Scanner GlScanner `json:"scanner"`
Identifiers []Identifier `json:"identifiers"`
Links []string `json:"links"`
Tracking Tracking `json:"tracking"`
Flags []Flag `json:"flags"`
Location Location `json:"location"`
DetectionDate string `json:"detectionDate"`
VulnerabilityStatus string `json:"status"`
VulnerabilityState string `json:"state"`
}

type Identifier struct {
Type string `json:"type"`
Name string `json:"name"`
Expand Down

0 comments on commit adb4742

Please sign in to comment.