mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 03:55:54 +00:00
Use the CWE name as a name in the SARIF report
This commit is contained in:
parent
9399e7bed7
commit
09a2941ad4
1 changed files with 6 additions and 1 deletions
|
@ -71,9 +71,14 @@ func GenerateReport(rootPaths []string, data *gosec.ReportInfo) (*Report, error)
|
|||
|
||||
// parseSarifRule return SARIF rule field struct
|
||||
func parseSarifRule(issue *gosec.Issue) *ReportingDescriptor {
|
||||
cwe := gosec.GetCweByRule(issue.RuleID)
|
||||
name := issue.RuleID
|
||||
if cwe != nil {
|
||||
name = cwe.Name
|
||||
}
|
||||
return &ReportingDescriptor{
|
||||
ID: issue.RuleID,
|
||||
Name: issue.What,
|
||||
Name: name,
|
||||
ShortDescription: NewMultiformatMessageString(issue.What),
|
||||
FullDescription: NewMultiformatMessageString(issue.What),
|
||||
Help: NewMultiformatMessageString(fmt.Sprintf("%s\nSeverity: %s\nConfidence: %s\n",
|
||||
|
|
Loading…
Reference in a new issue