Scan command
The agent is launched using the scan command with possible scanning options:
scan dir– scanning a directory;scan file– scanning a file;scan image– scanning a container image;scan bom– scanning a SBOM;scan <technology>- scanning a directory using settings for selected technology;scan build– scanning a build.
Launch options
Available and required options for launching the agent for scanning can be viewed using the help flag.
The --api_url parameter must contain the full address of the on-premise platform. The value for --api_token can be taken from the platform user profile.
Specifying the --project parameter will allow scanning to apply policies related to the selected project.
To specify the path to a SBOM save file, you must add the --bom-path parameter to the request or assign the bom-path variable in the config file. By default, the SBOM is saved in the startup directory in the file bom.json.
Run results
Depending on the run result and launch parameters, the agent returns the corresponding exit code:
- 0 – successful run, no issues were detected;
- 1 – as a result of the scan, problems were found that correspond to the configured security policies, user action is required;
- 2 – run failure;
- 3 – empty result, no artifacts were found for analysis. Returned only if the
--block-on-empty-resultparameter is set totrue.
Failed resolve
2026.35.0 If the agent failed to resolve dependencies for some manifests, the list of these manifests is printed at the end of the scan results under the Failed resolve heading. Use it to check whether the build environment provides everything required for resolution.
Priority of settings
Since agent startup parameters can be configured in multiple ways, if two or more methods are used at the same time, the agent will accept parameters in the following priority order:
- Value of the scan-technology command (if used);
- Value of the command flag;
- Value of environment variable;
- Value from config file.
Launch without the platform
If the --api_url and --api_token parameters are not specified, the scan will be launched without interacting with the CodeScoring platform. The scan will generate an SBOM file containing only a list of components and their versions without any additional information.
