This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree 3 files changed +5
-10
lines changed
test/query-tests/Security/CWE-798
3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 4
4
* to gain unauthorized access.
5
5
* @kind problem
6
6
* @problem.severity warning
7
- * @precision high
7
+ * @precision medium
8
8
* @id go/hardcoded-credentials
9
9
* @tags security
10
10
* external/cwe/cwe-259
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ module HeuristicNames {
28
28
* user names or other account information.
29
29
*/
30
30
string maybeAccountInfo ( ) {
31
- result = "(?is).*acc(ou)?nt.*" or
32
31
result = "(?is).*(puid|username|userid).*"
33
32
}
34
33
@@ -41,12 +40,6 @@ module HeuristicNames {
41
40
result = "(?is).*(auth(entication|ori[sz]ation)?)key.*"
42
41
}
43
42
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
-
50
43
/**
51
44
* Gets a regular expression that identifies strings that may indicate the presence
52
45
* of sensitive data, with `classification` describing the kind of sensitive data involved.
@@ -57,8 +50,6 @@ module HeuristicNames {
57
50
result = maybeAccountInfo ( ) and classification = SensitiveExpr:: id ( )
58
51
or
59
52
result = maybePassword ( ) and classification = SensitiveExpr:: password ( )
60
- or
61
- result = maybeCertificate ( ) and classification = SensitiveExpr:: certificate ( )
62
53
}
63
54
64
55
/**
Original file line number Diff line number Diff line change @@ -54,4 +54,8 @@ func main() {
54
54
i .password = testPassword // OK
55
55
secretKey = "secret" // OK
56
56
i .password = "--- redacted ---" // OK
57
+ certsDir := "/certs" // OK
58
+ fmt .Println (certsDir )
59
+ accountParameter := "ACCOUNT" // OK
60
+ fmt .Println (accountParameter )
57
61
}
You can’t perform that action at this time.
0 commit comments