Trigger Violations Using Xray Policy Rules

JFrog Security Documentation

ft:sourceType
Paligo

Policies contain user-defined rules allowing you to trigger violations for specific vulnerabilities or license breaches by setting a license or security criteria, with a corresponding set of automatic actions according to your needs. Rules are processed according to the ascending order in which they are placed in the Rules list on the Policy. If a rule is met, the subsequent rules in the list will not be applied.

Xray supports the following policy types:

Security Rules

A Security Rule allows you to create a set of rules around security vulnerabilities. These are the possible criteria:

  1. Minimal Severity (Minor, Major, Critical, All): The minimal security vulnerability severity as it is in the JFrog vulnerabilities database. If the artifact or build contains a vulnerability with the selected severity or higher, the rule will meet the criteria, the automatic actions will be executed, and the policy will stop processing.

  2. CVSS Score (1-10): The CVSS score range to apply to the rule. This is used for a fine-grained control, rather than using the predefined severities. The score range is based on CVSS v3 scoring, and CVSS v2 score is CVSS v3 score is not available.

  3. Vulnerabilities IDs: Creates policy rules for specific vulnerability IDs that you input. You can add multiple vulnerabilities IDs up to 100, separated by ",". CVEs and Xray IDs are supported.

  4. Generate violations only when fixed versions are available: Xray will not generate violations for issues that do not contain a fixed version. If a fixed version is available later, the violation will be generated.

  5. Packages: Xray will generate violations for the specific packages defined in this Policy. Provide the package type and name, and versions. You can either select all versions of the package or custom versions. Custom versions allows you to add specific package versions, or include a range.

    Package_Policy.png
    Package_Policy_2.png
Policy_Rules.png

License Rules

A license Rule allows you to create a set of rules around license compliance. There are three possible criteria:

  • Allowed Licenses: Specifies an Allow List of OSS licenses that may be attached to a component. If a component has an OSS license outside the specified Allow List, The rule will meet the criteria, a violation will be generated, automatic actions will be executed, and the policy will stop processing.

  • Banned Licenses: Specifies a Block List of OSS licenses that may not be attached to a component. If a component has any of the OSS licenses specified, The rule will meet the criteria, a violation will be generated, automatic actions will be executed, and the policy will stop processing.

  • Disallow Unknown License: Specifies the wanted behavior for components whose license cannot be determined. A violation will be triggered if a component with unknown license is found.