mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
Introduce the SourceNode and ThreatModelFlowSource classes
1. Introduces the `SourceNode` class which allows dataflow nodes representing sources to indicate the threat model they are associated with. 2. Introduces the `ThreatModelFlowSource` class which represents a source node which respects the threat model configuration
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
private import semmle.code.csharp.dataflow.internal.ExternalFlow
|
||||
private import codeql.threatmodels.ThreatModels
|
||||
|
||||
/**
|
||||
* A data flow source.
|
||||
*/
|
||||
abstract class SourceNode extends DataFlow::Node {
|
||||
/**
|
||||
* Gets a string that represents the source kind with respect to threat modeling.
|
||||
*/
|
||||
abstract string getThreatModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* A class of data flow sources that respects the
|
||||
* current threat model configuration.
|
||||
*/
|
||||
class ThreatModelFlowSource extends DataFlow::Node {
|
||||
ThreatModelFlowSource() {
|
||||
exists(string kind |
|
||||
// Specific threat model.
|
||||
currentThreatModel(kind) and
|
||||
(this.(SourceNode).getThreatModel() = kind or sourceNode(this, kind))
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user