C#: Collapse all the specific code for summary, source and sink models into a single file.

This commit is contained in:
Michael Nebel
2022-03-23 16:06:54 +01:00
parent 852d8a2770
commit 43c9f9d7bb
4 changed files with 23 additions and 32 deletions

View File

@@ -3,9 +3,7 @@
* and sink models of the Standard or a 3rd party library.
*/
private import CaptureSummaryModelsSpecific
private import CaptureSinkModelsSpecific
private import CaptureSourceModelsSpecific
private import CaptureModelsSpecific
private import ModelGeneratorUtils
/**

View File

@@ -1,8 +1,29 @@
/**
* Provides predicates related to capturing summary models of the Standard or a 3rd party library.
*/
import csharp
import semmle.code.csharp.dataflow.TaintTracking
import semmle.code.csharp.dataflow.ExternalFlow
import semmle.code.csharp.dataflow.TaintTracking
import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
import semmle.code.csharp.dataflow.internal.DataFlowPrivate
import ModelGeneratorUtils
/**
* Gets the enclosing callable of `ret`.
*/
Callable returnNodeEnclosingCallable(ReturnNodeExt ret) { result = getNodeEnclosingCallable(ret) }
/**
* Holds if `node` is an own instance access.
*/
predicate isOwnInstanceAccessNode(ReturnNode node) { node.asExpr() instanceof ThisAccess }
/**
* Gets the CSV string representation of the qualifier.
*/
string qualifierString() { result = "Argument[Qualifier]" }
class PropagateToSinkConfigurationSpecific extends TaintTracking::Configuration {
PropagateToSinkConfigurationSpecific() { this = "parameters or fields flowing into sinks" }

View File

@@ -1,4 +0,0 @@
import csharp
import semmle.code.csharp.dataflow.TaintTracking
import semmle.code.csharp.dataflow.ExternalFlow
import semmle.code.csharp.dataflow.internal.DataFlowImplCommon

View File

@@ -1,24 +0,0 @@
/**
* Provides predicates related to capturing summary models of the Standard or a 3rd party library.
*/
import csharp
import semmle.code.csharp.dataflow.TaintTracking
import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
import semmle.code.csharp.dataflow.internal.DataFlowPrivate
import ModelGeneratorUtils
/**
* Gets the enclosing callable of `ret`.
*/
Callable returnNodeEnclosingCallable(ReturnNodeExt ret) { result = getNodeEnclosingCallable(ret) }
/**
* Holds if `node` is an own instance access.
*/
predicate isOwnInstanceAccessNode(ReturnNode node) { node.asExpr() instanceof ThisAccess }
/**
* Gets the CSV string representation of the qualifier.
*/
string qualifierString() { result = "Argument[Qualifier]" }