accuknox-aspm-scanner is a unified CLI for Phase-1 ASPM scans: IaC, SAST, SCA, Secret, SBOM, Container, ML model scan, API discovery, SonarQube SAST, and DAST — in CI/CD pipelines or local developer workflows.
It can upload results to the AccuKnox ASPM Platform, but it can also run in standalone mode for restricted or on-prem environments.
- 🚀 One CLI for Phase-1 scan types: IaC, SAST, SCA, Secret (TruffleHog/Gitleaks), SBOM, Container, ML Scan, API Discovery, SonarQube SAST, and DAST
- 🔄 Supports both local tools and containerized execution
- 🔐 Optional upload to AccuKnox ASPM
- 🧰 Works in standalone and on-prem environments
- 🧵 Supports environment-variable and flag-based configuration
- 🧩 Supports pre-commit integration
Install from the GitHub release wheel:
pip install https://github.com/accuknox/aspm-scanner-cli/releases/download/v0.14.7-rc.1/accuknox_aspm_scanner-0.14.7rc1-py3-none-any.whlInstall from the release .deb package:
sudo dpkg -i accuknox-aspm-scanner_<version>.debUse standard CLI help:
accuknox-aspm-scanner --help
accuknox-aspm-scanner scan --help
accuknox-aspm-scanner scan iac --help
accuknox-aspm-scanner scan sast --help
accuknox-aspm-scanner scan secret --help
accuknox-aspm-scanner scan sca --help
accuknox-aspm-scanner scan container --help
accuknox-aspm-scanner scan ml-scan --help
accuknox-aspm-scanner scan api-discovery --help
accuknox-aspm-scanner scan dast --help
accuknox-aspm-scanner scan sq-sast --help
accuknox-aspm-scanner tool --help
accuknox-aspm-scanner pre-commit --helpIf you are running directly from local source code:
python -m aspm_cli.cli --helpAccuKnox upload variables are optional when --skip-upload is used.
ACCUKNOX_ENDPOINT: Control plane URL for result uploadACCUKNOX_LABEL: Label used to associate uploaded resultsACCUKNOX_TOKEN: Bearer token for uploadACCUKNOX_PROJECT_NAME: Project name used for SBOM uploadsACCUKNOX_PROJECT: Legacy fallback for project nameDEBUG: Set toTRUEfor verbose debug logsSOFT_FAIL: Set toTRUEto enable soft-fail by defaultKEEP_RESULTS: Set toTRUEto keep result files after scan completionSCAN_IMAGE: Override the scanner image used in container modeCODEASSURE_IMAGE: Override the AI analysis image used by SAST AI analysisACCUKNOX_ENABLE_AI_SAST: Set toTRUEto enable AI-SAST per repo (alternative to--ai-analysis)GITLEAKS_IMAGE: Override the Gitleaks image when--engine gitleaksML_SCAN_IMAGE: Override the full ModelScan image forml-scan(default:public.ecr.aws/k9v9d5v2/accuknox/ondemand_modelscan:1.0.21)ML_SCAN_IMAGE_REGISTRY/IMAGE_REGISTRY: On-prem registry host; builds{registry}/ondemand_modelscan:{tag}when setML_SCAN_IMAGE_TAG: Tag for ondemand_modelscan (default1.0.21, from platformk8s_jobs/modelscan/release.txt)ML_SCAN_DOCKER_PLATFORM: Docker platform for container mode (defaultlinux/amd64)API_DISCOVERY_IMAGE: Override the code2api image forapi-discovery(alias ofSCAN_IMAGEwhen set)CODE2API_IMAGE: Default code2api scanner image whenSCAN_IMAGEis unset
Install all supported local tools:
accuknox-aspm-scanner tool install --allInstall or update a specific tool:
accuknox-aspm-scanner tool install --type iac
accuknox-aspm-scanner tool update --type iacSupported tool types:
iacsastsq-sastsecretcontainerdastcodeassuregitleaks
User-level tool installs are placed under:
~/.local/bin/accuknox/All scans follow this structure:
accuknox-aspm-scanner scan [flags-before-the-scan-name] <scan-name> --command "<scanner-args>" [flags-after-the-scan-name]Here is what each part means:
scan: tells the CLI you want to run a scanflags before the scan name: these are common scan flags and work across all scan types<scan-name>: one ofiac,sast,sca,secret,container,ml-scan,api-discovery,dast, orsq-sastflags after the scan name: these are only for the selected scanner--command: required for every scan and passed to the underlying scanner
Simple rule:
- If a flag is written before
iac,sast,secret,container,dast, orsq-sast, it affects the overall scan behavior - If a flag is written after the scan name, it affects only that scanner
Example:
accuknox-aspm-scanner scan --skip-upload --keep-results iac --command "-d ." --container-modeIn that example:
--skip-uploadand--keep-resultsare flags before the scan name, so they control upload and file retentioniacis the scan name--commandand--container-modecome afteriac, so they apply only to the IaC scanner
Important:
--commandis required for every scan type- Use
--skip-uploadif you do not want to upload results - Use
--keep-resultsif you want to keep the generated artifact files - Some output/report flags passed inside
--commandare normalized by the CLI so it can collect results consistently
Common flags used before the scan name:
--endpoint--label--token--project-name--skip-upload--keep-results--softfail
If you do not use --skip-upload, you must provide:
ACCUKNOX_ENDPOINTor--endpointACCUKNOX_LABELor--labelACCUKNOX_TOKENor--token
You can provide upload settings in either style:
Using environment variables:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan iac --command "-d ." --container-modeUsing flags before the scan name:
accuknox-aspm-scanner scan --endpoint cspm.accuknox.com --label POC --token abcd1234 iac --command "-d ." --container-modeUse for Checkov-based IaC scanning.
Required:
--command
Flags used after iac:
--container-mode--severity— Comma-separated severities that fail the scan. Allowed:INFO,LOW,MEDIUM,HIGH,CRITICAL. Defaults to all.--repo-url--repo-branch
Typical --command value:
-d .Example:
accuknox-aspm-scanner scan --skip-upload --keep-results iac --command "-d ."Container mode with AccuKnox upload:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan iac --command "-d ." --container-modeUse for OpenGrep/SAST scanning.
Required:
--command
Flags used after sast:
--container-mode--severity— Comma-separated severities that fail the scan (matched on finding impact). Allowed:LOW,MEDIUM,HIGH,CRITICAL,UNKNOWN. Defaults to all.--aiscan-severity--repo-url--commit-ref--commit-sha--pipeline-id--job-url--ai-analysis--codeassure-config
Typical --command value:
scan .Basic example:
accuknox-aspm-scanner scan --skip-upload --keep-results sast --command "scan ."With AI analysis (CLI flag or per-repo env var):
accuknox-aspm-scanner scan --skip-upload --keep-results sast --command "scan ." --ai-analysis --aiscan-severity "HIGH,CRITICAL"Per-repo AI-SAST via environment variable (e.g. GitLab CI variable):
ACCUKNOX_ENABLE_AI_SAST=TRUE accuknox-aspm-scanner scan --skip-upload sast --command "scan ." --container-modeContainer mode with AccuKnox upload:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan sast --command "scan ." --container-modeUse for TruffleHog or Gitleaks secret scanning.
Required:
--command
Flags used after secret:
--container-mode--engine—trufflehog(default) orgitleaks
TruffleHog example:
accuknox-aspm-scanner scan --skip-upload --keep-results secret --command "filesystem ." --container-modeGitleaks example (SARIF output; upload uses data_type=DS → DroopescanParser; findings appear as droopescan, not in TruffleHog secret-scan filters):
accuknox-aspm-scanner scan --skip-upload --keep-results secret \
--engine gitleaks \
--command "detect --source . --report-format sarif --report-path results.json --no-banner" \
--container-modeUse for Trivy filesystem dependency vulnerability scanning (Software Composition Analysis).
Required:
--command
Flags used after sca:
--container-mode--severity
Typical --command value:
fs .Example:
accuknox-aspm-scanner scan --skip-upload --keep-results sca --command "fs ." --container-modeUse for Trivy-based container image vulnerability scanning and SBOM generation (image or filesystem).
Required:
--command
Flags used after container:
--container-mode--generate-sbom
Typical --command values:
image nginx:latest # image vuln scan or container SBOM
filesystem . # repo/filesystem SBOM (--generate-sbom only)Vulnerability scan example:
accuknox-aspm-scanner scan --skip-upload --keep-results container --command "image nginx:latest" --container-modeImage SBOM (AccuKnox project classifier container):
accuknox-aspm-scanner scan --skip-upload --keep-results --project-name demo-project container --command "image nginx:latest" --generate-sbom --container-modeFilesystem SBOM (AccuKnox project classifier application; run from repo root in container mode):
accuknox-aspm-scanner scan --skip-upload --keep-results --project-name demo-project container --command "filesystem ." --generate-sbom --container-modeSBOM upload requires --project-name (or ACCUKNOX_PROJECT_NAME). --project-name is not required for vulnerability scans. Legacy env ACCUKNOX_PROJECT is also accepted.
SBOM Phase-1 capabilities:
| Capability | CLI command | Upload data_type |
|---|---|---|
| Generate BOM | container --generate-sbom |
SBOM |
| Upload BOM | same + AccuKnox creds | SBOM |
| Dependency vulnerabilities | sca --command "fs ." |
TR (Trivy JSON; parser classifies as SCA via ArtifactType: filesystem) |
SBOM generation includes vulnerability and license metadata in CycloneDX output (--scanners vuln,license).
Container mode with AccuKnox upload:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan container --command "image nginx:latest" --container-modeUse for static ML model scanning with ModelScan (modelscan==0.8.1 inside the platform ondemand_modelscan job image). The CLI discovers model files under the -p path (.pkl, .pt, .pth, .h5, .keras, .pb, .ckpt, .npy), runs modelscan scan -p <file> -r json per file, wraps results as ondemand_modelscan, and uploads with artifact data_type=MLC (routes to ModelscanParser; findings appear in the UI as MLChecks).
Pre-release: use --container-mode (recommended for CI and platform parity). Local modelscan on PATH is optional for development only; release tarballs ship in a later GA.
Default container image (public mirror of platform Modelscan Ondemand ondemand_modelscan:1.0.21, linux/amd64):
public.ecr.aws/k9v9d5v2/accuknox/ondemand_modelscan:1.0.21
Override with ML_SCAN_IMAGE, or set IMAGE_REGISTRY / ML_SCAN_IMAGE_TAG for on-prem mirrors. On Apple Silicon Macs, container mode uses --platform linux/amd64 by default (override with ML_SCAN_DOCKER_PLATFORM).
Flags used after ml-scan:
--container-mode--repo-url— used formodel_id/model_pathmetadata--commit-ref— branch/ref inmodel_path--model-name— optional collector name in upload payload--source-type— defaultgithub
Default --command:
scan -p . -r jsonExample (CI — scan all models in repo checkout):
accuknox-aspm-scanner scan --skip-upload --keep-results ml-scan \
--repo-url "${CI_PROJECT_PATH}" \
--commit-ref "${CI_COMMIT_REF_NAME}" \
--command "scan -p . -r json" \
--container-modeExample (single model path):
accuknox-aspm-scanner scan ml-scan \
--command "scan -p ./models/model.pkl -r json" \
--container-modeUse code2api for static API discovery from source (internal routes, external HTTP calls, auth hints).
Pre-release: use --container-mode with the published image below. Local binary packaging (tool install --type api-discovery) ships in a later GA.
Default container image:
public.ecr.aws/k9v9d5v2/accuknox/code2api:0.1.0
Default --command:
-path . -output results.jsonFlags used after api-discovery:
--container-mode(required for pre-release)--repo-url(optional metadata; defaults from git)
Example:
export SCAN_IMAGE=public.ecr.aws/k9v9d5v2/accuknox/code2api:0.1.0
accuknox-aspm-scanner scan --skip-upload --keep-results api-discovery \
--command "-path . -output results.json" \
--container-modeUpload uses data_type=API. Output is code2api JSON (internal_apis, external_apis, summary).
Use for OWASP ZAP-based scanning.
Required:
--command
Flags used after dast:
--severity-threshold--container-mode
Typical --command value:
zap-baseline.py -t http://example.com/ -IRecommended example:
accuknox-aspm-scanner scan --skip-upload --keep-results dast --command "zap-baseline.py -t http://example.com/ -I" --container-modeContainer mode with AccuKnox upload:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan dast --command "zap-baseline.py -t http://example.com/ -I" --container-modeUse for SonarQube-based SAST plus result fetch.
Required:
--command
Flags used after sq-sast:
--skip-sonar-scan--container-mode--repo-url--branch--commit-sha--pipeline-url
Typical --command value:
-Dsonar.projectKey=<PROJECT_KEY> -Dsonar.host.url=<HOST_URL> -Dsonar.token=<TOKEN> -Dsonar.organization=<ORG_ID>Example:
accuknox-aspm-scanner scan --skip-upload --keep-results sq-sast --command "-Dsonar.projectKey=<PROJECT_KEY> -Dsonar.host.url=<HOST_URL> -Dsonar.token=<TOKEN> -Dsonar.organization=<ORG_ID>"Important note:
- Even with
--skip-sonar-scan,--commandis still required by the current parser
Container mode with AccuKnox upload:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan sq-sast --command "-Dsonar.projectKey=<PROJECT_KEY> -Dsonar.host.url=<HOST_URL> -Dsonar.token=<TOKEN> -Dsonar.organization=<ORG_ID>" --container-modeLocal mode is the default. Install the required local tool first:
accuknox-aspm-scanner tool install --type iac
accuknox-aspm-scanner scan --skip-upload --keep-results iac --command "-d ."Upload example:
ACCUKNOX_ENDPOINT=cspm.accuknox.com \
ACCUKNOX_LABEL=POC \
ACCUKNOX_TOKEN=abcd1234 \
accuknox-aspm-scanner scan --softfail sast --command "scan ."For most on-prem POCs:
- Install the CLI using the wheel or
.debpackage. - Decide whether each scan will run in local mode or container mode.
- If upload is not available, use
--skip-upload. - If you want local artifacts, use
--keep-results. - If using container mode in a restricted environment, point
SCAN_IMAGEto your internal registry image before each scan.
Recommended on-prem pattern:
accuknox-aspm-scanner scan --skip-upload --keep-results <scan-name> --command "<scanner args>"IaC with mirrored Checkov image:
export SCAN_IMAGE=registry.local/bridgecrew/checkov:3.2.458
accuknox-aspm-scanner scan --skip-upload --keep-results iac --command "-d ." --container-modeSecret scan with mirrored TruffleHog image:
export SCAN_IMAGE=registry.local/trufflesecurity/trufflehog:3.90.3
accuknox-aspm-scanner scan --skip-upload --keep-results secret --command "git file://." --container-modeContainer scan with mirrored Trivy image:
export SCAN_IMAGE=registry.local/accuknox/trivy:0.69.3
accuknox-aspm-scanner scan --skip-upload --keep-results container --command "image nginx:latest" --container-modeDAST with mirrored ZAP image:
export SCAN_IMAGE=registry.local/zaproxy/zap-stable:2.16.1
accuknox-aspm-scanner scan --skip-upload --keep-results dast --command "zap-baseline.py -t http://example.com/ -I" --container-modeSonarQube SAST against self-hosted SonarQube:
export SCAN_IMAGE=registry.local/sonarsource/sonar-scanner-cli:11.4
accuknox-aspm-scanner scan --skip-upload --keep-results sq-sast --command "-Dsonar.projectKey=my-project -Dsonar.host.url=https://sonarqube.internal -Dsonar.token=$SONAR_TOKEN" --container-modeSCAN_IMAGEis shared across scanner types, so set it per scan typeCODEASSURE_IMAGEis used only for SAST AI analysis- DAST is most reliable in
--container-mode - Result files are deleted unless
--keep-resultsis used tool installdownloads public artifacts, so fully restricted environments may need pre-staged local tools or mirrored images
More detailed operational notes and workarounds are available in docs/onprem-setup-guide.md.
Install the generated pre-commit hook:
accuknox-aspm-scanner pre-commit installRemove the generated pre-commit hook:
accuknox-aspm-scanner pre-commit uninstallEnable verbose debug mode:
DEBUG=TRUE accuknox-aspm-scanner scan --skip-upload iac --command "-d ."