Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 2a0642b

Browse files
committed
Insecure-TLS: remove is-test-file filter
1 parent 5c8534f commit 2a0642b

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

ql/src/experimental/CWE-327/InsecureTLS.ql

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ import go
1414
import DataFlow::PathGraph
1515
import semmle.go.security.InsecureFeatureFlag::InsecureFeatureFlag
1616

17-
/**
18-
* Check whether the file where the node is located is a test file.
19-
*/
20-
predicate isTestFile(DataFlow::Node node) {
21-
// Exclude results in test files:
22-
exists(File file | file = node.getRoot().getFile() |
23-
file instanceof TestFile or file.getPackageName() = "tests"
24-
)
25-
}
26-
2717
/**
2818
* Holds if it is insecure to assign TLS version `val` named `named` to `tls.Config` field `fieldName`
2919
*/
@@ -252,7 +242,5 @@ where
252242
not exists(FuncDef fn | fn = sink.getNode().asInstruction().getRoot() |
253243
isFeatureFlagName(fn.getEnclosingFunction*().getName()) or
254244
isLegacyFlagName(fn.getEnclosingFunction*().getName())
255-
) and
256-
// Exclude results in test code:
257-
not isTestFile(sink.getNode())
245+
)
258246
select sink.getNode(), source, sink, message

0 commit comments

Comments
 (0)