Skip to content

Commit

Permalink
skip running dataflow passes in metadata scan (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
khemrajrathore authored Aug 21, 2024
1 parent bd297ac commit 408f617
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/main/scala/ai/privado/entrypoint/CommandParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ case class PrivadoInput(
disableReadDataflow: Boolean = false,
enableAPIDisplay: Boolean = false,
enableLambdaFlows: Boolean = false,
disableDataflowPass: Boolean = false,
enableAPIByParameter: Boolean = false,
ignoreExcludeRules: Boolean = false,
ignoreSinkSkipRules: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ abstract class BaseProcessor(
def applyOverridenPasses(cpg: Cpg): Unit = List()

def applyDataflowAndPostProcessingPasses(cpg: Cpg): Unit = {
logger.info("Applying data flow overlay")
val context = new LayerCreatorContext(cpg)
val options = new OssDataFlowOptions()
new OssDataFlow(options).run(context)
if (privadoInput.disableDataflowPass) logger.info("Skipping data flow overlay")
else {
logger.info("Applying data flow overlay")
val context = new LayerCreatorContext(cpg)
val options = new OssDataFlowOptions()
new OssDataFlow(options).run(context)
}
if (privadoInput.enableLambdaFlows)
new ExperimentalLambdaDataFlowSupportPass(cpg).createAndApply()
logger.info("=====================")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class JavascriptBaseCPGProcessor(
fileLinkingMetadata: FileLinkingMetadata = new FileLinkingMetadata()
) extends JavascriptProcessor(
ruleCache,
privadoInput,
privadoInput.copy(disableDataflowPass = true),
sourceRepoLocation,
dataFlowCache,
auditCache,
Expand Down

0 comments on commit 408f617

Please sign in to comment.