issue 77 pt3 final lints
This commit is contained in:
parent
5c6d8b4904
commit
ea74764c12
|
|
@ -448,7 +448,10 @@ func (a *ComposeAnalyzer) checkEnvironment(
|
|||
|
||||
if rules.IsSensitiveEnvName(varName) && varValue != "" {
|
||||
if !isVariableReference(varValue) {
|
||||
loc := &finding.Location{Path: a.path, Line: itemNode.Line}
|
||||
loc := &finding.Location{
|
||||
Path: a.path,
|
||||
Line: itemNode.Line,
|
||||
}
|
||||
f := finding.New("CIS-4.10", "Service '"+serviceName+"' has sensitive variable '"+varName+"' with hardcoded value", finding.SeverityHigh, target).
|
||||
WithDescription("Hardcoding secrets in compose files exposes them in version control.").
|
||||
WithCategory(string(CategoryCompose)).
|
||||
|
|
|
|||
|
|
@ -632,8 +632,11 @@ func TestComposeAnalyzer_AllFiles(t *testing.T) {
|
|||
"Should have CRITICAL findings",
|
||||
)
|
||||
} else {
|
||||
assert.False(t, findings.HasSeverityAtOrAbove(finding.SeverityCritical),
|
||||
"Should NOT have CRITICAL findings")
|
||||
assert.False(
|
||||
t,
|
||||
findings.HasSeverityAtOrAbove(finding.SeverityCritical),
|
||||
"Should NOT have CRITICAL findings",
|
||||
)
|
||||
}
|
||||
|
||||
if tc.wantHigh {
|
||||
|
|
|
|||
Loading…
Reference in New Issue