mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
feat(python): Add Hardcoded Credentials MaD support
This commit is contained in:
@@ -18,6 +18,7 @@ import semmle.python.dataflow.new.TaintTracking
|
||||
import semmle.python.filters.Tests
|
||||
private import semmle.python.dataflow.new.internal.DataFlowDispatch as DataFlowDispatch
|
||||
private import semmle.python.dataflow.new.internal.Builtins::Builtins as Builtins
|
||||
private import semmle.python.frameworks.data.ModelsAsData
|
||||
|
||||
bindingset[char, fraction]
|
||||
predicate fewer_characters_than(StringLiteral str, string char, float fraction) {
|
||||
@@ -80,6 +81,8 @@ class HardcodedValueSource extends DataFlow::Node {
|
||||
|
||||
class CredentialSink extends DataFlow::Node {
|
||||
CredentialSink() {
|
||||
this = ModelOutput::getASinkNode("credentials-hardcoded").asSink()
|
||||
or
|
||||
exists(string name |
|
||||
name.regexpMatch(getACredentialRegex()) and
|
||||
not name.matches("%file")
|
||||
|
||||
Reference in New Issue
Block a user