This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +5
-10
lines changed
test/query-tests/Security/CWE-798 Expand file tree Collapse file tree 3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 44 * to gain unauthorized access.
55 * @kind problem
66 * @problem.severity warning
7- * @precision high
7+ * @precision medium
88 * @id go/hardcoded-credentials
99 * @tags security
1010 * external/cwe/cwe-259
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ module HeuristicNames {
2828 * user names or other account information.
2929 */
3030 string maybeAccountInfo ( ) {
31- result = "(?is).*acc(ou)?nt.*" or
3231 result = "(?is).*(puid|username|userid).*"
3332 }
3433
@@ -41,12 +40,6 @@ module HeuristicNames {
4140 result = "(?is).*(auth(entication|ori[sz]ation)?)key.*"
4241 }
4342
44- /**
45- * Gets a regular expression that identifies strings that may indicate the presence of
46- * a certificate.
47- */
48- string maybeCertificate ( ) { result = "(?is).*(cert)(?!.*(format|name)).*" }
49-
5043 /**
5144 * Gets a regular expression that identifies strings that may indicate the presence
5245 * of sensitive data, with `classification` describing the kind of sensitive data involved.
@@ -57,8 +50,6 @@ module HeuristicNames {
5750 result = maybeAccountInfo ( ) and classification = SensitiveExpr:: id ( )
5851 or
5952 result = maybePassword ( ) and classification = SensitiveExpr:: password ( )
60- or
61- result = maybeCertificate ( ) and classification = SensitiveExpr:: certificate ( )
6253 }
6354
6455 /**
Original file line number Diff line number Diff line change @@ -54,4 +54,8 @@ func main() {
5454 i .password = testPassword // OK
5555 secretKey = "secret" // OK
5656 i .password = "--- redacted ---" // OK
57+ certsDir := "/certs" // OK
58+ fmt .Println (certsDir )
59+ accountParameter := "ACCOUNT" // OK
60+ fmt .Println (accountParameter )
5761}
You can’t perform that action at this time.
0 commit comments