|
2 | 2 | * Provides a taint-tracking configuration for "Clear-text logging of sensitive information". |
3 | 3 | * |
4 | 4 | * Note, for performance reasons: only import this file if |
5 | | - * `CleartextLogging::Configuration` is needed, otherwise |
| 5 | + * `CleartextLoggingFlow` is needed, otherwise |
6 | 6 | * `CleartextLoggingCustomizations` should be imported instead. |
7 | 7 | */ |
8 | 8 |
|
9 | 9 | private import codeql.ruby.AST |
10 | 10 | private import codeql.ruby.DataFlow |
11 | 11 | private import codeql.ruby.TaintTracking |
12 | 12 | import CleartextLoggingCustomizations::CleartextLogging |
13 | | -private import CleartextLoggingCustomizations::CleartextLogging as CleartextLogging |
| 13 | +private import CleartextLoggingCustomizations::CleartextLogging as CL |
14 | 14 |
|
15 | 15 | /** |
16 | 16 | * A taint-tracking configuration for detecting "Clear-text logging of sensitive information". |
| 17 | + * DEPRECATED: Use `CleartextLoggingFlow` instead |
17 | 18 | */ |
18 | | -class Configuration extends TaintTracking::Configuration { |
| 19 | +deprecated class Configuration extends TaintTracking::Configuration { |
19 | 20 | Configuration() { this = "CleartextLogging" } |
20 | 21 |
|
21 | | - override predicate isSource(DataFlow::Node source) { source instanceof CleartextLogging::Source } |
| 22 | + override predicate isSource(DataFlow::Node source) { source instanceof CL::Source } |
22 | 23 |
|
23 | | - override predicate isSink(DataFlow::Node sink) { sink instanceof CleartextLogging::Sink } |
| 24 | + override predicate isSink(DataFlow::Node sink) { sink instanceof CL::Sink } |
24 | 25 |
|
25 | 26 | override predicate isSanitizer(DataFlow::Node node) { |
26 | 27 | super.isSanitizer(node) |
27 | 28 | or |
28 | | - node instanceof CleartextLogging::Sanitizer |
| 29 | + node instanceof CL::Sanitizer |
29 | 30 | } |
30 | 31 |
|
31 | 32 | override predicate isAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { |
32 | | - CleartextLogging::isAdditionalTaintStep(nodeFrom, nodeTo) |
| 33 | + CL::isAdditionalTaintStep(nodeFrom, nodeTo) |
33 | 34 | } |
34 | 35 | } |
| 36 | + |
| 37 | +private module Config implements DataFlow::ConfigSig { |
| 38 | + predicate isSource(DataFlow::Node source) { source instanceof CL::Source } |
| 39 | + |
| 40 | + predicate isSink(DataFlow::Node sink) { sink instanceof CL::Sink } |
| 41 | + |
| 42 | + predicate isBarrier(DataFlow::Node node) { node instanceof CL::Sanitizer } |
| 43 | + |
| 44 | + predicate isAdditionalFlowStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { |
| 45 | + CL::isAdditionalTaintStep(nodeFrom, nodeTo) |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +/** |
| 50 | + * Taint-tracking for detecting "Clear-text logging of sensitive information". |
| 51 | + */ |
| 52 | +module CleartextLoggingFlow = TaintTracking::Global<Config>; |
0 commit comments