Skip to content

Commit ea74764

Browse files
issue 77 pt3 final lints
1 parent 5c6d8b4 commit ea74764

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

PROJECTS/intermediate/docker-security-audit/internal/analyzer/compose.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,10 @@ func (a *ComposeAnalyzer) checkEnvironment(
448448

449449
if rules.IsSensitiveEnvName(varName) && varValue != "" {
450450
if !isVariableReference(varValue) {
451-
loc := &finding.Location{Path: a.path, Line: itemNode.Line}
451+
loc := &finding.Location{
452+
Path: a.path,
453+
Line: itemNode.Line,
454+
}
452455
f := finding.New("CIS-4.10", "Service '"+serviceName+"' has sensitive variable '"+varName+"' with hardcoded value", finding.SeverityHigh, target).
453456
WithDescription("Hardcoding secrets in compose files exposes them in version control.").
454457
WithCategory(string(CategoryCompose)).

PROJECTS/intermediate/docker-security-audit/tests/integration/compose_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,11 @@ func TestComposeAnalyzer_AllFiles(t *testing.T) {
632632
"Should have CRITICAL findings",
633633
)
634634
} else {
635-
assert.False(t, findings.HasSeverityAtOrAbove(finding.SeverityCritical),
636-
"Should NOT have CRITICAL findings")
635+
assert.False(
636+
t,
637+
findings.HasSeverityAtOrAbove(finding.SeverityCritical),
638+
"Should NOT have CRITICAL findings",
639+
)
637640
}
638641

639642
if tc.wantHigh {

0 commit comments

Comments
 (0)