The AccuKnox Code Analysis extension is a single, unified Azure DevOps task that runs any combination of AccuKnox ASPM code-analysis scans β SAST, SCA, Secret, IaC, ML Static Scan, API Discovery and SBOM β and uploads the results to the AccuKnox Console for centralized visibility, risk tracking and remediation.
Instead of wiring up a separate task for every scanner, configure one task, pick the scans you need via scanType, and shift security left across your entire codebase β before it reaches production.
- β 7 Scanners, One Task β SAST (optional AI-SAST), SCA, Secret, IaC, ML Static Scan, API Discovery and SBOM (image + filesystem).
- π§© Run Any Combination β Select one or many scans with a single comma/space separated
scanTypeinput. - π€ AI-SAST β After OpenGrep SAST, optionally run CodeAssure AI analysis (
enableAiSast) to triage findings. - β¨οΈ Command Text Per Scan β Every scanner exposes a
*Commandinput mapped directly to the CLI's--command. - ποΈ IaC with Frameworks β Restrict IaC scans to one or more frameworks (e.g.
Kubernetes,Terraform). - π¦ SBOM for Image & Filesystem β Generate a CycloneDX SBOM from a container image or your source tree.
- π Shift Left Security β Integrate all checks directly into your Azure Pipelines.
- π₯ Seamless AccuKnox Console Integration β Findings flow automatically to the AccuKnox dashboard.
- π₯οΈ Any Linux or Windows agent β SAST, SCA, Secret, IaC and SBOM run the scanner natively, so Microsoft-hosted agents work; no Docker required.
- π€ AI-SAST β Native CodeAssure install is Linux-only. Enable with
enableAiSastorACCUKNOX_ENABLE_AI_SAST=TRUE. Put the LLM key inACCUKNOX_AI_API_KEY(provider-agnostic) and map it on the task withenv:. Incodeassure.jsonset"api_key": "$ACCUKNOX_AI_API_KEY". Optionally pass the config path assastCodeassureConfig. - π³ Docker (only for ML Static Scan and API Discovery) β These two scans still run in container mode, so selecting either one requires an agent with Docker available and network access to pull scanner images.
- π AccuKnox Console Access β Sign in to your AccuKnox tenant.
- ποΈ API Token β Retrieve this from the AccuKnox Console (Settings β Tokens).
- π·οΈ Label Created in Console β For tagging the uploaded scan reports.
- π Pipeline Variables / Secrets β Store the credentials securely as pipeline variables.
- Log in to your AccuKnox Console.
- Navigate to Settings β Tokens, click Create Token, and save the value.
- Create a label under Dashboard β Labels to tag scan results.
Define the following as pipeline variables (mark the token as secret):
| Variable | Description |
|---|---|
ACCUKNOX_TOKEN |
Your AccuKnox API token |
ACCUKNOX_ENDPOINT |
The AccuKnox Console URL (e.g. cspm.demo.accuknox.com) |
ACCUKNOX_LABEL |
Label used to tag and group scan results |
ACCUKNOX_ENABLE_AI_SAST (optional) |
Set to TRUE to enable AI-SAST (same as enableAiSast) |
ACCUKNOX_AI_API_KEY (optional) |
Provider-agnostic LLM API key for AI-SAST. Mark as secret and map it on the task with env:. codeassure.json must use "api_key": "$ACCUKNOX_AI_API_KEY" |
trigger:
- main
pool:
name: selfhosted
steps:
- task: AccuKnox-Code-Analysis@2
inputs:
# Pick any combination of scans
scanType: 'sast, sca, secret, iac'
# AccuKnox credentials
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
# Common options
softFail: trueπ‘ Only the inputs for the scans listed in
scanTypeare used β everything else is ignored, so you can keep your pipeline minimal.
- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'sast'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
sastSeverity: 'HIGH,CRITICAL'
softFail: trueEnable with enableAiSast: true or ACCUKNOX_ENABLE_AI_SAST=TRUE. Store the LLM key in ACCUKNOX_AI_API_KEY (any provider). Use a Linux agent.
- task: AccuKnox-Code-Analysis@2
env:
ACCUKNOX_ENABLE_AI_SAST: 'TRUE' # optional if enableAiSast is true
ACCUKNOX_AI_API_KEY: $(ACCUKNOX_AI_API_KEY)
inputs:
scanType: 'sast'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
sastSeverity: 'HIGH,CRITICAL'
enableAiSast: true
sastAiScanSeverity: 'HIGH,CRITICAL'
# sastCodeassureConfig: 'codeassure.json' # optional
softFail: trueExample codeassure.json β the key name is AccuKnox-generic; provider / api_base pick the actual LLM:
{
"model": {
"provider": "openai-compatible",
"name": "your-model-name",
"api_base": "https://your-llm-endpoint",
"api_key": "$ACCUKNOX_AI_API_KEY",
"tool_calling": true
}
}- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'sca'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
scaSeverity: 'HIGH,CRITICAL'
softFail: true- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'secret'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
softFail: true- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'iac'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
softFail: true- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'ml'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
softFail: true- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'api-discovery'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
softFail: truePrerequisite β Create a Project. To associate SBOM data with the correct entity, create a Project in the AccuKnox Console first (SBOM β Projects β New Project). Use Container classifier for an image SBOM or Application for a filesystem SBOM, and pass the project name as
sbomProjectName.
- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'sbom'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
sbomScanType: 'filesystem'
sbomScanPath: '.'
sbomProjectName: 'my-project' # required for SBOM
softFail: trueFor an image SBOM, set
sbomScanType: 'image'andsbomImageRef: 'myapp:latest'(build/pull the image earlier in the same job).
- task: AccuKnox-Code-Analysis@2
inputs:
scanType: 'sast, sca, secret, iac, sbom'
accuknoxEndpoint: $(ACCUKNOX_ENDPOINT)
accuknoxToken: $(ACCUKNOX_TOKEN)
accuknoxLabel: $(ACCUKNOX_LABEL)
softFail: true
sastSeverity: 'HIGH,CRITICAL'
sbomScanType: 'filesystem'
sbomScanPath: '.'
sbomProjectName: 'my-project'Add
mlandapi-discoverytoscanTypeto include those scans β they run in container mode, so the agent needs Docker.
| Input | Description | Required | Default |
|---|---|---|---|
scanType |
Scans to run (comma/space separated): sast, sca, secret, iac, ml, api-discovery, sbom |
Yes | β |
accuknoxEndpoint |
URL of the AccuKnox Console to push results | Yes | β |
accuknoxToken |
API token for authenticating with AccuKnox SaaS | Yes | β |
accuknoxLabel |
Label used in AccuKnox SaaS to organise results | Yes | β |
scannerVersion |
Git tag of the accuknox-aspm-scanner binary |
No | v0.14.8 |
softFail |
Prevent the task from failing on findings (all scans) | No | true |
| Input | Description | Default |
|---|---|---|
sastCommand |
Command text passed to --command (target to scan) |
. |
sastSeverity |
Comma-separated severities (LOW, MEDIUM, HIGH, CRITICAL) |
HIGH |
enableAiSast |
After OpenGrep SAST, run CodeAssure AI analysis (--ai-analysis). Same as ACCUKNOX_ENABLE_AI_SAST=TRUE |
false |
sastAiScanSeverity |
OpenGrep impacts sent to CodeAssure (--aiscan-severity). Shown when AI-SAST is on |
HIGH,CRITICAL |
sastCodeassureConfig |
Optional path to codeassure.json (--codeassure-config). Use "api_key": "$ACCUKNOX_AI_API_KEY" |
"" |
| Input | Description | Default |
|---|---|---|
scaCommand |
Command text passed to --command (e.g. fs .) |
fs . |
scaSeverity |
Comma-separated severities to fail on | "" |
| Input | Description | Default |
|---|---|---|
secretCommand |
Command text passed to --command (e.g. git file://. or filesystem .) |
git file://. |
secretAdditionalArguments |
Extra arguments appended to the command | "" |
| Input | Description | Default |
|---|---|---|
iacCommand |
Raw command text passed to --command. Overrides the structured inputs below |
"" |
iacDirectory |
Directory with infrastructure code to scan | . |
iacFile |
Specific file to scan; cannot be used with iacDirectory |
"" |
iacFramework |
One or more frameworks (comma-separated), e.g. Kubernetes,Terraform |
"" (all) |
iacCompact |
Do not display code blocks in output | true |
iacQuiet |
Display only failed checks | true |
| Input | Description | Default |
|---|---|---|
mlCommand |
Command text passed to --command (e.g. scan -p . -r json) |
scan -p . -r json |
mlModelName |
Custom collector/model identifier | "" |
mlSourceType |
Source type for metadata | azure |
| Input | Description | Default |
|---|---|---|
apiCommand |
Command text passed to --command (e.g. -path . -output results.json) |
-path . -output results.json |
| Input | Description | Default |
|---|---|---|
sbomScanType |
Target type: image or filesystem |
filesystem |
sbomImageRef |
Image reference (required when sbomScanType is image) |
"" |
sbomScanPath |
Filesystem path (used when sbomScanType is filesystem) |
. |
sbomCommand |
Raw command text passed to --command. Overrides the structured inputs above |
"" |
sbomSeverity |
Comma-separated severities | "" |
sbomProjectName |
Project name (AccuKnox entity). Required when sbom is selected |
"" |
- Pipeline runs β A push/PR triggers the pipeline containing the task.
- Scanner setup (once) β The task validates credentials, parses
scanType, and downloads theaccuknox-aspm-scannerbinary for the requestedscannerVersion. - Selected scans run β Each enabled scan builds its arguments from your
*Commandand scan-specific inputs. Most run natively on the agent; ML and API Discovery run in--container-mode:- SAST β static application security analysis (optional AI-SAST via
enableAiSast) - SCA β dependency/composition analysis
- Secret β secret detection
- IaC β infrastructure-as-code misconfiguration checks (optionally per framework)
- ML β static ML model analysis
- API Discovery β route/endpoint discovery
- SBOM β CycloneDX bill of materials for an image or filesystem
- SAST β static application security analysis (optional AI-SAST via
- Results uploaded to AccuKnox Console β Using the provided
accuknoxTokenandaccuknoxLabel. - Review findings β Available in the AccuKnox Console: Dashboard β Issues β Findings, filtered by scan type.
- Pipeline decision β If
softFailisfalse, the task fails when any selected scan reports findings.
- π Read More: AccuKnox Docs
- π§ Contact Support: support@accuknox.com
π Shift Left with AccuKnox β Secure Your Code from Commit to Cloud! βοΈπ‘οΈ