convertSecurityFindings converts security scanner findings to unified AnalysisIssue format
(result *security.ScanResult)
| 557 | |
| 558 | // convertSecurityFindings converts security scanner findings to unified AnalysisIssue format |
| 559 | func (a *SQLAnalyzer) convertSecurityFindings(result *security.ScanResult) { |
| 560 | for _, finding := range result.Findings { |
| 561 | // Map security severity to analysis severity |
| 562 | var sev IssueSeverity |
| 563 | switch finding.Severity { |
| 564 | case security.SeverityCritical: |
| 565 | sev = IssueSeverityCritical |
| 566 | case security.SeverityHigh: |
| 567 | sev = IssueSeverityHigh |
| 568 | case security.SeverityMedium: |
| 569 | sev = IssueSeverityMedium |
| 570 | case security.SeverityLow: |
| 571 | sev = IssueSeverityLow |
| 572 | default: |
| 573 | sev = IssueSeverityMedium |
| 574 | } |
| 575 | |
| 576 | // Create issue from security finding |
| 577 | issue := NewIssue(string(finding.Pattern), IssueCategorySecurity, sev). |
| 578 | WithDescription(finding.Description). |
| 579 | WithSuggestion(finding.Suggestion). |
| 580 | Build() |
| 581 | |
| 582 | // Add risk as impact if available |
| 583 | if finding.Risk != "" { |
| 584 | issue.Impact = finding.Risk |
| 585 | } |
| 586 | |
| 587 | a.Issues = append(a.Issues, issue) |
| 588 | a.adjustSecurityScore(sev) |
| 589 | } |
| 590 | } |
no test coverage detected