Skip to content

Commit 9a8bdf4

Browse files
filipi86claude
andcommitted
style: gofmt struct field alignment in rules_python.go and rules_other.go
Re-align struct literal fields flagged by gofmt after the SAST rule changes. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d55974d commit 9a8bdf4

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

internal/engine/rules_other.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func golangRules() []Rule {
6060
},
6161
{
6262
ID: "GO-007", Language: config.LangGo, Severity: config.SeverityMedium,
63-
Title: "Unsafe use of math/rand for security",
63+
Title: "Unsafe use of math/rand for security",
6464
Description: "math/rand is not cryptographically secure and must not be used to generate " +
6565
"tokens, keys, salts, nonces, or other security-sensitive values.",
6666
// Only fire when a security-sensitive identifier appears on the same
@@ -202,7 +202,7 @@ func kotlinRules() []Rule {
202202
// how you pin certs) and even matched imports and class names like
203203
// CustomSSLSocketFactory — ~100% false positives on any TLS code.
204204
Pattern: mustCompile(`(?i)(trustAllCerts|ALLOW_ALL_HOSTNAME_VERIFIER|NoopHostnameVerifier|HostnameVerifier\s*\{[^}]*->\s*true|fun\s+verify\b[^=\n]*=\s*true)`),
205-
OWASP: config.OWASP_A04_CryptographicFailures, CWE: "CWE-295", CVSS: 7.4,
205+
OWASP: config.OWASP_A04_CryptographicFailures, CWE: "CWE-295", CVSS: 7.4,
206206
References: []string{"https://cwe.mitre.org/data/definitions/295.html"},
207207
Remediation: "Use the default OkHttpClient which validates SSL certificates. Implement certificate pinning for sensitive apps.",
208208
},
@@ -256,7 +256,7 @@ func csharpRules() []Rule {
256256
// named BinaryFormatter (e.g. `public byte[] BinaryFormatter()` in
257257
// benchmarks), which are not uses of the dangerous type.
258258
Pattern: mustCompile(`new\s+BinaryFormatter\s*\(`),
259-
OWASP: config.OWASP_A08_SoftwareDataIntegrityFailures, CWE: "CWE-502", CVSS: 9.8,
259+
OWASP: config.OWASP_A08_SoftwareDataIntegrityFailures, CWE: "CWE-502", CVSS: 9.8,
260260
References: []string{"https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide"},
261261
Remediation: "BinaryFormatter is deprecated. Use System.Text.Json, MessagePack, or Protobuf instead.",
262262
},
@@ -432,8 +432,8 @@ func htmlRules() []Rule {
432432
Pattern: mustCompile(`(?i)<html`),
433433
RequiredPattern: mustCompile(`(?i)Content-Security-Policy`),
434434
OWASP: config.OWASP_A02_SecurityMisconfiguration, CWE: "CWE-693", CVSS: 3.1,
435-
References: []string{"https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP"},
436-
Remediation: "Add a CSP via meta tag (<meta http-equiv=\"Content-Security-Policy\" ...>) or an HTTP response header.",
435+
References: []string{"https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP"},
436+
Remediation: "Add a CSP via meta tag (<meta http-equiv=\"Content-Security-Policy\" ...>) or an HTTP response header.",
437437
},
438438
{
439439
ID: "HTML-003", Language: config.LangHTML, Severity: config.SeverityLow,
@@ -674,7 +674,7 @@ func nginxRules() []Rule {
674674
// weak when it is NOT the prefix of TLSv1.2/1.3, so it must be
675675
// followed by whitespace/semicolon/EOL (RE2 has no negative lookahead).
676676
Pattern: mustCompile(`(?i)ssl_protocols\b[^;]*(SSLv2|SSLv3|TLSv1\.0|TLSv1\.1|TLSv1(\s|;|$))`),
677-
OWASP: config.OWASP_A02_SecurityMisconfiguration, CWE: "CWE-327", CVSS: 7.4,
677+
OWASP: config.OWASP_A02_SecurityMisconfiguration, CWE: "CWE-327", CVSS: 7.4,
678678
References: []string{"https://cwe.mitre.org/data/definitions/327.html"},
679679
Remediation: "Use only modern protocols: ssl_protocols TLSv1.2 TLSv1.3;",
680680
},

internal/engine/rules_python.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func pythonRules() []Rule {
5757
AntiPattern: mustCompile(`(?i)>>>|=\s*["'][^"']*(fake|dummy|example|sample|placeholder|changeme|your[-_]|redacted|<[^>]+>|\{\{|test[-_]|foobar|\.\.\.|xxx)`),
5858
OWASP: config.OWASP_A04_CryptographicFailures,
5959
CWE: "CWE-259",
60-
CVSS: 8.0,
60+
CVSS: 8.0,
6161
References: []string{
6262
"https://owasp.org/Top10/2025/A04_2025-Cryptographic_Failures/",
6363
"https://cwe.mitre.org/data/definitions/259.html",
@@ -242,8 +242,8 @@ func pythonRules() []Rule {
242242
// `token_expiry`/`token_count`, `token` keeps a trailing word boundary
243243
// but the others do not.
244244
Pattern: mustCompile(`(?i)(logging\.|logger\.)(debug|info|warning|error|critical)\s*\(\s*(?:f["'][^"']*\{[^}]*(?:password|passwd|secret|token|api_?key)|["'][^"']*["']\s*[%,+]\s*[^)]*(?:\bpassword|\bpasswd|\bsecret|\bapi_?key|\btoken\b)|(?:password|passwd|secret|token|api_?key)\b)`),
245-
OWASP: config.OWASP_A09_SecurityLoggingAlertingFailures,
246-
CWE: "CWE-532",
245+
OWASP: config.OWASP_A09_SecurityLoggingAlertingFailures,
246+
CWE: "CWE-532",
247247
CVSS: 5.5,
248248
References: []string{
249249
"https://cwe.mitre.org/data/definitions/532.html",

0 commit comments

Comments
 (0)