Package com.tonic.analysis.cpg.taint
Class TaintPath.Builder
- java.lang.Object
-
- com.tonic.analysis.cpg.taint.TaintPath.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaintPath.BuilderaddToPath(CPGNode node)Appends one hop to the end of the path.TaintPathbuild()Creates the path from the accumulated state; the hop list is copied.TaintPath.Builderpath(List<CPGNode> path)Replaces the accumulated hops with the given sequence.TaintPath.Buildersink(TaintSink sink)Sets the sink definition the flow terminates at.TaintPath.BuildersinkNode(CPGNode node)Sets the CPG node where the taint is consumed.TaintPath.Buildersource(TaintSource source)Sets the source definition the flow originates from.TaintPath.BuildersourceNode(CPGNode node)Sets the CPG node where the taint enters.
-
-
-
Method Detail
-
source
public TaintPath.Builder source(TaintSource source)
Sets the source definition the flow originates from.- Parameters:
source- the matched taint source- Returns:
- this builder
-
sink
public TaintPath.Builder sink(TaintSink sink)
Sets the sink definition the flow terminates at.- Parameters:
sink- the matched taint sink- Returns:
- this builder
-
sourceNode
public TaintPath.Builder sourceNode(CPGNode node)
Sets the CPG node where the taint enters.- Parameters:
node- the source call site- Returns:
- this builder
-
sinkNode
public TaintPath.Builder sinkNode(CPGNode node)
Sets the CPG node where the taint is consumed.- Parameters:
node- the sink call site- Returns:
- this builder
-
addToPath
public TaintPath.Builder addToPath(CPGNode node)
Appends one hop to the end of the path.- Parameters:
node- the node traversed- Returns:
- this builder
-
path
public TaintPath.Builder path(List<CPGNode> path)
Replaces the accumulated hops with the given sequence.- Parameters:
path- the nodes traversed, in order- Returns:
- this builder
-
build
public TaintPath build()
Creates the path from the accumulated state; the hop list is copied.- Returns:
- the new path, with no sanitizers recorded yet
-
-