mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Merge pull request #184 from max/cleartext-logging-constant
Teach `CleartextLogging` not to flag constant sources.
This commit is contained in:
@@ -12,6 +12,11 @@ module CleartextLogging {
|
||||
* A data-flow source for clear-text logging of sensitive information.
|
||||
*/
|
||||
abstract class Source extends DataFlow::Node {
|
||||
Source() {
|
||||
// hard-coded strings are uninteresting
|
||||
not exists(getStringValue())
|
||||
}
|
||||
|
||||
/** Gets a string that describes the type of this data-flow source. */
|
||||
abstract string describe();
|
||||
}
|
||||
|
||||
@@ -126,3 +126,9 @@ func test() {
|
||||
log.Println(config.x) // NOT OK
|
||||
log.Println(config.y) // NOT OK
|
||||
}
|
||||
|
||||
const password = "horsebatterystaplecorrect"
|
||||
|
||||
func test2() {
|
||||
log.Println(password) // OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user