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