trigger_scan_local
Zip and upload a local directory to create a Checkmarx One scan, returning a scan ID for status polling. Use it to compare local results with pipeline scans via matching filters and resolutions.
Instructions
Scan a local directory by zipping and uploading it. Returns the created scan ID for status polling. By default the zip holds the same files as a cx scan create pipeline scan, so results can be compared. Local build output and caches (e.g. dist/, .angular/) are included like cx does; add them to excludePatterns if the pipeline scans a clean checkout. Use a separate branch label (e.g. '-mcp') so manual scans don't mix into the real branch history. With scaResolution 'local', dependencies are resolved locally as cx --sca-resolver does, and with containersResolution 'local', container images are resolved locally as cx does, so the scan stores the same SCA packages and container findings as the pipeline scan. Pass gitRef to scan a commit as a CI checkout sees it, plus extraPaths for CI build output. The result lists warnings when the scan can't match a cx pipeline scan.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"directory": "<directory>"
},
"name": "trigger_scan_local"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | Branch name label for the scan (defaults to 'local-scan') | |
| gitRef | No | Scan this commit, branch or tag of the git repository that contains directory, instead of the working tree: tracked files only, with no .git, ignored or untracked files, as a CI checkout sees it. Your index and working tree are not changed. Submodules are not included. | |
| zipMode | No | Which files go into the zip. 'cx' (default): the file types the cx CLI uploads, skipping node_modules, .git, .vs, .vscode and .idea. 'all': every file type, skipping build output, dependency and tool folders (dist, build, vendor, iac, .angular and similar). | cx |
| directory | Yes | Absolute path to local directory to scan | |
| projectId | No | Project UUID (uses CHECKMARX_PROJECT_ID if not provided) | |
| scaFilter | No | SCA file filter, same as cx --sca-filter | |
| scanTypes | No | Scanner engines to run (defaults to sast, sca, kics). Use 'containers' to scan the images in Dockerfiles, Docker Compose files and Helm charts for CVEs. | |
| extraPaths | No | Files or folders, relative to directory, copied from the working tree on top of the gitRef checkout: the CI build output the pipeline scans, e.g. ['dist', 'iac/generated']. They go through the same zip filters as the rest. Needs gitRef. | |
| kicsFilter | No | KICS (IaC) file filter, same as cx --iac-security-filter | |
| presetName | No | SAST preset name, same as cx --sast-preset-name | |
| sastFilter | No | SAST file filter, same as cx --sast-filter (e.g. '!*.spec.ts,!test') | |
| incremental | No | Run an incremental SAST scan, same as cx --sast-incremental | |
| scaResolution | No | Where SCA dependencies are resolved. 'local': run SCA Resolver on the directory and upload its result, as cx --sca-resolver does. It runs as CHECKMARX_SCA_RESOLVER says, or in Docker when that is not set. 'cloud': Checkmarx resolves the uploaded lock files, dev dependencies included. Defaults to 'local' when CHECKMARX_SCA_RESOLVER is set and sca is requested, else 'cloud'. | |
| containerImages | No | Images to analyse in addition to the ones found in the files, the same as cx --container-images (e.g. the image the pipeline builds and ships, ['registry.example.com/app:1.2.3']). Needs 'containers' in scanTypes and containersResolution 'local'. | |
| excludePatterns | No | Additional glob patterns to exclude from zip (node_modules, .git already excluded) | |
| scaResolverParams | No | SCA Resolver arguments, the same string as cx --sca-resolver-params (e.g. "--ignore-dev-dependencies --extract-archives zip,ear,war"). Only for scaResolution 'local'. | |
| containersResolution | No | Where container images are resolved. 'local': find the images in Dockerfiles, Docker Compose files and Helm charts, analyse them and containerImages with the containers resolver, and upload the result, as cx does when the tenant flag CONTAINER_ENGINE_CLI_ENABLED is on. It runs as CHECKMARX_CONTAINERS_RESOLVER says, or in Docker when that is not set; images are read from the local Docker daemon first, so pull or build private images locally. 'cloud': Checkmarx resolves the images named in the uploaded files. Defaults to 'local' when containers is requested, the flag is on, and CHECKMARX_CONTAINERS_RESOLVER is set or containerImages is given; else 'cloud'. |