Skip to content

Commit 80526e5

Browse files
committed
Go: Adds sources and sinks to go/clear-text-logging
1 parent ca0a1dc commit 80526e5

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

go/ql/lib/semmle/go/frameworks/stdlib/Log.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import go
88
module Log {
99
private class LogFunction extends Function {
1010
LogFunction() {
11-
exists(string fn | fn.matches(["Fatal%", "Panic%", "Print%"]) |
11+
exists(string fn | fn.matches(["Fatal%", "Panic%", "Print%", "Output"]) |
1212
this.hasQualifiedName("log", fn)
1313
or
1414
this.(Method).hasQualifiedName("log", "Logger", fn)

go/ql/lib/semmle/go/security/CleartextLogging.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ module CleartextLogging {
7474
)
7575
}
7676

77+
predicate isBarrierIn(DataFlow::Node node) { isSource(node) }
78+
7779
predicate isAdditionalFlowStep(DataFlow::Node src, DataFlow::Node trg) {
7880
// A taint propagating data-flow edge through structs: a tainted write taints the entire struct.
7981
exists(Write write |

go/ql/lib/semmle/go/security/SensitiveActions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module HeuristicNames {
3535
*/
3636
string maybePassword() {
3737
result = "(?is).*pass(wd|word|code|phrase)(?!.*question).*" or
38-
result = "(?is).*(auth(entication|ori[sz]ation)?|api)key.*"
38+
result = "(?is).*(auth(entication|ori[sz]ation)?|api|secret)key.*"
3939
}
4040

4141
/**
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Added more sources and sinks to the query `go/clear-text-logging`.

0 commit comments

Comments
 (0)