Skip to main content

Jfrog Xray scanner reference for STO

You can ingest scan results from JFrog Xray, a software composition analyis (SCA) solution that integrates with Artifactory and identifies vulnerabilities in open-source libraries and packages used in your code.

The standard workflow is to create a CI Build or Security Tests stage to your pipeline, add a Security step, and then use setting:value pairs to configure the step as specified below.

Important notes for running Xray scans in STO

  • Harness STO supports ingestionOnly scans with Jfrog Xray. orchestrationOnly and dataLoad scans are not supported.

  • For information about running Xray scans with custom SSL certificates, go to Authenticating with RSA Keys in the JFrog documentation.

  • If you need to add trusted certificates to your scan images at runtime, you need to run the scan step with root access.

    You can set up your STO scan images and pipelines to run scans as non-root and establish trust for your own proxies using custom certificates. For more information, go to Configure STO to Download Images from a Private Registry.

For more information

The following topics contain useful information for setting up scanner integrations in STO:

Security step settings for Xray scans in STO

You can add a Security step to a Security Tests or CI Build stage and then configure it as described below.

Target and variant

The following settings are required for every Security step:

  • target_name A user-defined label for the code repository, container, application, or configuration to scan.
  • variant A user-defined label for the branch, tag, or other target variant to scan.
note

Make sure that you give unique, descriptive names for the target and variant. This makes navigating your scan results in the STO UI much easier.

You can see the target name, type, and variant in the Test Targets UI:

Target name, type, and branch

For more information, go to Targets, baselines, and variants in STO.

Jfrog Xray settings

Ingestion file

If the policy_type is ingestionOnly:

  • ingestion_file = The path to your scan results when running an Ingestion scan, for example /shared/scan_results/myscan.latest.sarif.
  • The data file must be in a supported format for the scanner.

  • The data file must be accessible to the scan step. It's good practice to save your results files to a shared path in your stage. In the visual editor, go to the stage where you're running the scan. Then go to Overview > Shared Paths. You can also add the path to the YAML stage definition like this:

        - stage:
    spec:
    sharedPaths:
    - /shared/scan_results

Fail on Severity

Every Security step has a Fail on Severity setting. If the scan finds any vulnerability with the specified severity level or higher, the pipeline fails automatically. You can specify one of the following:

  • CRITICAL
  • HIGH
  • MEDIUM
  • LOW
  • INFO
  • NONE — Do not fail on severity

The YAML definition looks like this: fail_on_severity : critical # | high | medium | low | info | none