@@ -9,6 +9,12 @@ private import semmle.python.dataflow.new.DataFlow
9
9
private import semmle.python.Frameworks
10
10
private import semmle.python.Concepts
11
11
private import semmle.python.security.SensitiveData as OldSensitiveData
12
+ private import semmle.python.security.internal.SensitiveDataHeuristics as SensitiveDataHeuristics
13
+
14
+ // We export these explicitly, so we don't also export the `HeuristicNames` module.
15
+ class SensitiveDataClassification = SensitiveDataHeuristics:: SensitiveDataClassification ;
16
+
17
+ module SensitiveDataClassification = SensitiveDataHeuristics:: SensitiveDataClassification;
12
18
13
19
/**
14
20
* A data flow source of sensitive data, such as secrets, certificates, or passwords.
@@ -22,13 +28,9 @@ class SensitiveDataSource extends DataFlow::Node {
22
28
SensitiveDataSource ( ) { this = range }
23
29
24
30
/**
25
- * INTERNAL: Do not use.
26
- *
27
- * This will be rewritten to have better types soon, and therefore should only be used internally until then.
28
- *
29
31
* Gets the classification of the sensitive data.
30
32
*/
31
- string getClassification ( ) { result = range .getClassification ( ) }
33
+ SensitiveDataClassification getClassification ( ) { result = range .getClassification ( ) }
32
34
}
33
35
34
36
/** Provides a class for modeling new sources of sensitive data, such as secrets, certificates, or passwords. */
@@ -41,22 +43,19 @@ module SensitiveDataSource {
41
43
*/
42
44
abstract class Range extends DataFlow:: Node {
43
45
/**
44
- * INTERNAL: Do not use.
45
- *
46
- * This will be rewritten to have better types soon, and therefore should only be used internally until then.
47
- *
48
46
* Gets the classification of the sensitive data.
49
47
*/
50
- abstract string getClassification ( ) ;
48
+ abstract SensitiveDataClassification getClassification ( ) ;
51
49
}
52
50
}
53
51
52
+ // TODO: rewrite this to not rely on the old points-to implementation
54
53
private class PortOfOldModeling extends SensitiveDataSource:: Range {
55
54
OldSensitiveData:: SensitiveData:: Source oldSensitiveSource ;
56
55
57
56
PortOfOldModeling ( ) { this .asCfgNode ( ) = oldSensitiveSource }
58
57
59
- override string getClassification ( ) {
58
+ override SensitiveDataClassification getClassification ( ) {
60
59
exists ( OldSensitiveData:: SensitiveData classification |
61
60
oldSensitiveSource .isSourceOf ( classification )
62
61
|
0 commit comments