Checkmarx/ast-azure-plugin

How to exclude node_modules and other directories from the scan?

Closed this issue · 3 comments

Describe the bug

I have a react project, and I would like to exclude node_modules and other specific directories

The Azure Pipeline task is below

- task: Checkmarx AST@2
  displayName: 'Checkmarx AST'
  condition: and(always(), eq('${{ parameters.ShouldRunCheckMarx }}', true))
  continueOnError: true
  inputs:
    CheckmarxService: 'CheckMarx-Connection'
    projectName: $(Build.Repository.Name)
    branchName: $(Build.SourceBranchName)
    tenantName: ${{ parameters.tenantName }}
    additionalParams: |
      --file-filter '!node_modules'

This is not working.

Internal Jira issue: AST-32984

@ausshadu thanks for the bug report, we will get back to you asap. This should indeed work.

FYI @pedrompflopes

Hi @jbrotsos
This is working now. I looked at pipeline configurations and found a small typo. Apologies for the confusion.
I had written

--file-filter: '!node_modules'

Instead of

--file-filter '!node_modules'

Now this is scanning excluding the node_modules directory.