Skip to content

Commit c03633b

Browse files
duriantacoclaude
andauthored
fix(go): drop the keyword-only hardcoded-secret rule (#1007)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 377ce4d commit c03633b

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

‎skylos/engines/go/internal/analyzer/analyzer.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,6 @@ func (a *Analyzer) checkHardcodedSecret(lit *ast.BasicLit, path string) {
344344
return
345345
}
346346
}
347-
348-
if strings.Contains(valLower, "password") || strings.Contains(valLower, "secret") ||
349-
strings.Contains(valLower, "apikey") || strings.Contains(valLower, "api_key") {
350-
a.addFinding(lit, path, "SKY-S101", "HIGH", "Potential Hardcoded Secret",
351-
"String appears to contain sensitive data. Use environment variables instead.")
352-
}
353347
}
354348

355349
func (a *Analyzer) getFuncInfo(expr ast.Expr) (pkg, funcName string) {

‎skylos/engines/go/internal/analyzer/analyzer_symlink_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func TestAnalyzeDirSkipsSymlinkedGoFilesOutsideRoot(t *testing.T) {
1313
insideFile := filepath.Join(root, "secret.go")
1414
if err := os.WriteFile(insideFile, []byte(`package main
1515
16-
const token = "password marker for local fixture"
16+
const token = "sk-local-fixture-marker-0001"
1717
1818
func main() { println(token) }
1919
`), 0o600); err != nil {
@@ -23,7 +23,7 @@ func main() { println(token) }
2323
outsideFile := filepath.Join(outside, "secret.go")
2424
if err := os.WriteFile(outsideFile, []byte(`package main
2525
26-
const token = "password=supersecretvalue"
26+
const token = "sk-outside-fixture-marker-0002"
2727
2828
func main() { println(token) }
2929
`), 0o600); err != nil {

0 commit comments

Comments
 (0)