Scan Published Builds

JFrog CLI is integrated with JFrog Xray and JFrog Artifactory, allowing you to have your build artifacts and dependencies scanned for vulnerabilities and license violations.

Command: build-scan, bs

The build-scan command scans published builds for security vulnerabilities and license compliance issues.
Note: For the build-scan command to return meaningful results, the scanned build must be included in the scope of a Watch that is associated with a Policy containing a Fail Build action. This requirement applies to all command parameters except for --vuln, which can return vulnerability data independently of policy evaluation.

Commands Parameters

ParameterOptional/DefaultDescription
--server-idOptionalServer ID configured by the jf c add command. If not specified, the default configured server is used.
--urlOptionalSpecifies the URL of the JFrog platform.
--userOptionalSpecifies the user name of your JFrog platform.
--passwordOptionalSpecifies the user password of your JFrog platform.
--access-tokenOptionalSpecifies the access token of your JFrog platform.
--xray-urlOptionalSpecifies the URL of your Xray server.
--vulnOptionalSet if you'd like to receive all vulnerabilities, regardless of the policy configured in Xray.
--insecure-tlsDefault: falseSet to true to skip TLS certificates verification.
--failDefault: trueIf fail build violations are found, it will return exit code of 3. Set to false to see violations with exit code 0.
--formatDefault: tableDefines the output format of the command. Accepted values: table, json, simple-json, sarif, and cyclonedx.
--projectOptionalJFrog project key.
--rescanDefault: falseSet to true when scanning an already successfully scanned build, e.g., after adding an ignore rule.
--violationsDefault: trueControls whether policy violations are included in the results. With --project, violations are always included regardless of this flag.
--extended-tableDefault: falseSet to true to include extended fields such as CVSS and Xray Issue Id. Ignored unless --format is table.
--trigger-scan-retriesDefault: 12Number of times Xray retries triggering the build scan after a failure.

Arguments

Build NameBuild name to be scanned.
Build NumberBuild number to be scanned.

Examples

Scan a specific build:
Scans build number 18, corresponding to the build name my-build-name.

jf bs my-build-name 18

Scan with project policies:
Scans build 18 of my-build-name using policies defined for project-1.

jf bs my-build-name 18 --project project-1

Scan showing all vulnerabilities:
Displays all vulnerabilities for build 18.

jf bs my-build-name 18 --vuln

Rescan an already-scanned build:
Re-triggers the Xray scan for build 18, for example after adding an ignore rule.

jf bs my-build-name 18 --rescan

Did this page help you?