Skip to content

Commit

Permalink
formatters/tfsec:bugfix - vulnerabilities were being ignored due miss…
Browse files Browse the repository at this point in the history
…ing severity

Tfsec func resposable por getting the severeties of the vulnerabilities
was in a wrong format, leading to vulnerablities without severity and
this vulnerabilities were being ignored. This pull request fixes this
error by updating the func to match the correct tfsec severities
https://github.com/aquasecurity/tfsec/blob/master/pkg/severity/severity.go.

Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
  • Loading branch information
nathanmartinszup committed Jan 19, 2022
1 parent bfb07e6 commit 5ca341e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions internal/services/formatters/hcl/tfsec/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,9 @@ func (r *tfsecResult) getFilename() string {
}

func (r *tfsecResult) getSeverity() severities.Severity {
return r.mapSeverityValues()[r.Severity]
}

func (r *tfsecResult) mapSeverityValues() map[string]severities.Severity {
return map[string]severities.Severity{
"ERROR": severities.High,
"WARNING": severities.Medium,
"": severities.Low,
if r.Severity == "" {
return severities.Unknown
}

return severities.Severity(r.Severity)
}

0 comments on commit 5ca341e

Please sign in to comment.