Skip to content

Commit

Permalink
start impl
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Aug 19, 2024
1 parent c200386 commit ef0a952
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 0 deletions.
33 changes: 33 additions & 0 deletions formats/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,40 @@ func (sr SummaryResults) GetTotalIssueCount() (total int) {
return
}

type IScanSummaryResult struct {
Target string `json:"target,omitempty"`
Vulnerabilities *ScanSummaryVulnerabilities `json:"vulnerabilities"`
Violations *ScanSummaryViolations `json:"violations"`
CuratedPackages *CuratedPackages `json:"curated,omitempty"`
}

type ScanSummaryVulnerabilities struct {
ScaScanResults *ScanScaResult `json:"sca,omitempty"`
IacScanResults *SummaryCount `json:"iac,omitempty"`
SecretsScanResults *SummaryCount `json:"secrets,omitempty"`
SastScanResults *SummaryCount `json:"sast,omitempty"`
}

type ScanSummaryViolations struct {
Watches []string `json:"watches,omitempty"`
Violations TwoLevelSummaryCount `json:"policy_violations,omitempty"`
}














type ScanSummaryResult struct {
IndexKeys []string `json:"index_keys,omitempty"`
Target string `json:"target,omitempty"`
Vulnerabilities *ScanVulnerabilitiesSummary `json:"vulnerabilities,omitempty"`
Violations TwoLevelSummaryCount `json:"violations,omitempty"`
Expand Down
146 changes: 146 additions & 0 deletions utils/securityJobSummary.go

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions utils/severityutils/resources/criticalSeverity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions utils/severityutils/resources/highSeverity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions utils/severityutils/resources/lowSeverity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions utils/severityutils/resources/mediumSeverity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions utils/severityutils/resources/unknownSeverity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions utils/severityutils/severity.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package severityutils

import (
_ "embed"
"strings"

"github.com/gookit/color"
Expand Down Expand Up @@ -30,6 +31,34 @@ const (
Unknown Severity = "Unknown"
)

var (
//go:embed resources/criticalSeverity.svg
CriticalIcon string
//go:embed resources/highSeverity.svg
HighIcon string
//go:embed resources/mediumSeverity.svg
MediumIcon string
//go:embed resources/lowSeverity.svg
LowIcon string
//go:embed resources/unknownSeverity.svg
UnknownIcon string
)

func GetSeverityIcon(severity Severity) string {
switch severity {
case Critical:
return CriticalIcon
case High:
return HighIcon
case Medium:
return MediumIcon
case Low:
return LowIcon
default:
return UnknownIcon
}
}

type Severity string

func (s Severity) String() string {
Expand Down

0 comments on commit ef0a952

Please sign in to comment.