-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add severity computation details (#1195)
* feat: add severity computation details * ci: update tests * fix: update tests and always include bool * fixup: update severity default to avoid empty values * feat: add severity weighting to saas * fix: clean up stale snapshots * feat: rename to SeverityMeta and add raw fields --------- Co-authored-by: elsapet <elizabeth@bearer.sh>
- Loading branch information
1 parent
f13e708
commit d723dbb
Showing
10 changed files
with
163 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 53 additions & 6 deletions
59
pkg/report/output/security/.snapshots/TestCalculateSeverity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,54 @@ | ||
([]string) (len=5) { | ||
(string) (len=8) "critical", | ||
(string) (len=4) "high", | ||
(string) (len=6) "medium", | ||
(string) (len=7) "warning", | ||
(string) (len=7) "warning" | ||
([]types.SeverityMeta) (len=5) { | ||
(types.SeverityMeta) { | ||
RuleSeverity: (string) (len=3) "low", | ||
SensitiveDataCategories: ([]string) (len=2) { | ||
(string) (len=3) "PHI", | ||
(string) (len=13) "Personal Data" | ||
}, | ||
HasLocalDataTypes: (*bool)(true), | ||
SensitiveDataCategoryWeighting: (int) 3, | ||
RuleSeverityWeighting: (int) 2, | ||
FinalWeighting: (int) 8, | ||
DisplaySeverity: (string) (len=8) "critical" | ||
}, | ||
(types.SeverityMeta) { | ||
RuleSeverity: (string) (len=3) "low", | ||
SensitiveDataCategories: ([]string) (len=1) { | ||
(string) (len=25) "Personal Data (Sensitive)" | ||
}, | ||
HasLocalDataTypes: (*bool)(false), | ||
SensitiveDataCategoryWeighting: (int) 3, | ||
RuleSeverityWeighting: (int) 2, | ||
FinalWeighting: (int) 5, | ||
DisplaySeverity: (string) (len=4) "high" | ||
}, | ||
(types.SeverityMeta) { | ||
RuleSeverity: (string) (len=3) "low", | ||
SensitiveDataCategories: ([]string) (len=1) { | ||
(string) (len=13) "Personal Data" | ||
}, | ||
HasLocalDataTypes: (*bool)(false), | ||
SensitiveDataCategoryWeighting: (int) 2, | ||
RuleSeverityWeighting: (int) 2, | ||
FinalWeighting: (int) 4, | ||
DisplaySeverity: (string) (len=6) "medium" | ||
}, | ||
(types.SeverityMeta) { | ||
RuleSeverity: (string) (len=7) "warning", | ||
SensitiveDataCategories: ([]string) <nil>, | ||
HasLocalDataTypes: (*bool)(<nil>), | ||
SensitiveDataCategoryWeighting: (int) 0, | ||
RuleSeverityWeighting: (int) 0, | ||
FinalWeighting: (int) 0, | ||
DisplaySeverity: (string) (len=7) "warning" | ||
}, | ||
(types.SeverityMeta) { | ||
RuleSeverity: (string) (len=7) "warning", | ||
SensitiveDataCategories: ([]string) <nil>, | ||
HasLocalDataTypes: (*bool)(<nil>), | ||
SensitiveDataCategoryWeighting: (int) 0, | ||
RuleSeverityWeighting: (int) 0, | ||
FinalWeighting: (int) 0, | ||
DisplaySeverity: (string) (len=7) "warning" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters