issue 77 pt3 final lints

This commit is contained in:
CarterPerez-dev 2026-02-18 20:21:59 -05:00
parent 5c6d8b4904
commit ea74764c12
2 changed files with 9 additions and 3 deletions

View File

@ -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)).

View File

@ -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 {