You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
π― Key Features
β 7 Scanners, One Task β SAST, SCA, Secret, IaC, ML Static Scan, API Discovery and SBOM (image + filesystem).
β¨οΈ Command Text Per Scan β Every scanner exposes a *Command input 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.
β οΈ Prerequisites
π₯οΈ Any Linux or Windows agent β SAST, SCA, Secret, IaC and SBOM run the scanner natively, so Microsoft-hosted agents work; no Docker required.
π³ 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.
π Installation & Usage
Step 1: Retrieve AccuKnox Credentials
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.
Step 2: Add Pipeline Variables
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
Step 3: Add the Task to Your Pipeline
trigger:
- mainpool:
name: selfhostedsteps:
- task: AccuKnox-Code-Analysis@2inputs:
# Pick any combination of scansscanType: 'sast, sca, secret, iac'# AccuKnox credentialsaccuknoxEndpoint: $(ACCUKNOX_ENDPOINT)accuknoxToken: $(ACCUKNOX_TOKEN)accuknoxLabel: $(ACCUKNOX_LABEL)# Common optionssoftFail: true
π‘ Only the inputs for the scans listed in scanType are used β everything else is ignored, so you can keep your pipeline minimal.
Prerequisite β 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.
Command text passed to --command (e.g. git file://. or filesystem .)
git file://.
secretAdditionalArguments
Extra arguments appended to the command
""
IaC (iac)
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
ML Static Scan (ml)
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
API Discovery (api-discovery)
Input
Description
Default
apiCommand
Command text passed to --command (e.g. -path . -output results.json)
-path . -output results.json
SBOM (sbom)
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
""
π How It Works
Pipeline runs β A push/PR triggers the pipeline containing the task.
Scanner setup (once) β The task validates credentials, parses scanType, and downloads the accuknox-aspm-scanner binary for the requested scannerVersion.
Selected scans run β Each enabled scan builds its arguments from your *Command and scan-specific inputs. Most run natively on the agent; ML and API Discovery run in --container-mode:
SAST β static application security analysis
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
Results uploaded to AccuKnox Console β Using the provided accuknoxToken and accuknoxLabel.
Review findings β Available in the AccuKnox Console: Dashboard β Issues β Findings, filtered by scan type.
Pipeline decision β If softFail is false, the task fails when any selected scan reports findings.