Java: 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:14:38 +01:00
parent 43c9f9d7bb
commit 3d2ce57c9e
4 changed files with 29 additions and 38 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,35 @@
/**
* Provides predicates related to capturing summary models of the Standard or a 3rd party library.
*/
import java
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.dataflow.ExternalFlow
import semmle.code.java.dataflow.TaintTracking
import semmle.code.java.dataflow.internal.DataFlowImplCommon
import semmle.code.java.dataflow.internal.DataFlowNodes
import semmle.code.java.dataflow.internal.DataFlowPrivate
import semmle.code.java.dataflow.InstanceAccess
import ModelGeneratorUtils
/**
* Gets the enclosing callable of `ret`.
*/
Callable returnNodeEnclosingCallable(ReturnNodeExt ret) {
result = getNodeEnclosingCallable(ret).asCallable()
}
/**
* Holds if `node` is an own instance access.
*/
predicate isOwnInstanceAccessNode(ReturnNode node) {
node.asExpr().(ThisAccess).isOwnInstanceAccess()
}
/**
* Gets the CSV string representation of the qualifier.
*/
string qualifierString() { result = "Argument[-1]" }
class PropagateToSinkConfigurationSpecific extends TaintTracking::Configuration {
PropagateToSinkConfigurationSpecific() { this = "parameters or fields flowing into sinks" }

View File

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

View File

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