@@ -224,3 +224,79 @@ class AuthorizationCall extends SensitiveAction, DataFlow::CallNode {
224
224
)
225
225
}
226
226
}
227
+
228
+ /**
229
+ * A data flow source of sensitive data, such as secrets, certificates, or passwords.
230
+ *
231
+ * Extend this class to refine existing API models. If you want to model new APIs,
232
+ * extend `SensitiveDataSource::Range` instead.
233
+ */
234
+ class SensitiveDataSource extends DataFlow:: Node instanceof SensitiveDataSource:: Range {
235
+ /**
236
+ * Gets the classification of the sensitive data.
237
+ */
238
+ SensitiveDataClassification getClassification ( ) { result = super .getClassification ( ) }
239
+ }
240
+
241
+ /** Provides a class for modeling new sources of sensitive data, such as secrets, certificates, or passwords. */
242
+ module SensitiveDataSource {
243
+ /**
244
+ * A data flow source of sensitive data, such as secrets, certificates, or passwords.
245
+ *
246
+ * Extend this class to model new APIs. If you want to refine existing API models,
247
+ * extend `SensitiveDataSource` instead.
248
+ */
249
+ abstract class Range extends DataFlow:: Node {
250
+ /**
251
+ * Gets the classification of the sensitive data.
252
+ */
253
+ abstract SensitiveDataClassification getClassification ( ) ;
254
+ }
255
+ }
256
+
257
+ /**
258
+ * A call to a method that may return sensitive data.
259
+ */
260
+ class SensitiveMethodCall extends SensitiveDataSource:: Range , DataFlow:: CallNode instanceof SensitiveNode
261
+ {
262
+ SensitiveDataMethodName methodName ;
263
+
264
+ SensitiveMethodCall ( ) { methodName = this .getMethodName ( ) }
265
+
266
+ override SensitiveDataClassification getClassification ( ) {
267
+ result = methodName .getClassification ( )
268
+ }
269
+ }
270
+
271
+ /**
272
+ * An assignment to a variable that may contain sensitive data.
273
+ */
274
+ class SensitiveVariableAssignment extends SensitiveDataSource:: Range instanceof BasicSensitiveWrite {
275
+ override SensitiveDataClassification getClassification ( ) {
276
+ result = BasicSensitiveWrite .super .getClassification ( )
277
+ }
278
+ }
279
+
280
+ /**
281
+ * A read from a hash value that may return sensitive data.
282
+ */
283
+ class SensitiveHashValueAccess extends SensitiveDataSource:: Range instanceof BasicSensitiveVariableAccess
284
+ {
285
+ SensitiveHashValueAccess ( ) {
286
+ this .asExpr ( ) instanceof CfgNodes:: ExprNodes:: ElementReferenceCfgNode
287
+ }
288
+
289
+ override SensitiveDataClassification getClassification ( ) {
290
+ result = BasicSensitiveVariableAccess .super .getClassification ( )
291
+ }
292
+ }
293
+
294
+ /**
295
+ * A parameter node that may contain sensitive data.
296
+ */
297
+ class SensitiveParameter extends SensitiveDataSource:: Range , DataFlow:: ParameterNode instanceof SensitiveNode
298
+ {
299
+ override SensitiveDataClassification getClassification ( ) {
300
+ result = SensitiveNode .super .getClassification ( )
301
+ }
302
+ }
0 commit comments