@@ -9,6 +9,12 @@ private import semmle.python.dataflow.new.DataFlow
99private import semmle.python.Frameworks
1010private import semmle.python.Concepts
1111private 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;
1218
1319/**
1420 * A data flow source of sensitive data, such as secrets, certificates, or passwords.
@@ -22,13 +28,9 @@ class SensitiveDataSource extends DataFlow::Node {
2228 SensitiveDataSource ( ) { this = range }
2329
2430 /**
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- *
2931 * Gets the classification of the sensitive data.
3032 */
31- string getClassification ( ) { result = range .getClassification ( ) }
33+ SensitiveDataClassification getClassification ( ) { result = range .getClassification ( ) }
3234}
3335
3436/** Provides a class for modeling new sources of sensitive data, such as secrets, certificates, or passwords. */
@@ -41,22 +43,19 @@ module SensitiveDataSource {
4143 */
4244 abstract class Range extends DataFlow:: Node {
4345 /**
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- *
4846 * Gets the classification of the sensitive data.
4947 */
50- abstract string getClassification ( ) ;
48+ abstract SensitiveDataClassification getClassification ( ) ;
5149 }
5250}
5351
52+ // TODO: rewrite this to not rely on the old points-to implementation
5453private class PortOfOldModeling extends SensitiveDataSource:: Range {
5554 OldSensitiveData:: SensitiveData:: Source oldSensitiveSource ;
5655
5756 PortOfOldModeling ( ) { this .asCfgNode ( ) = oldSensitiveSource }
5857
59- override string getClassification ( ) {
58+ override SensitiveDataClassification getClassification ( ) {
6059 exists ( OldSensitiveData:: SensitiveData classification |
6160 oldSensitiveSource .isSourceOf ( classification )
6261 |
0 commit comments