Description: Get condition templates with their parameters, from which custom conditions can be built.
Notes:Every custom condition is built using a single template identified by condition_template_id and some parameters. Each template lists the parameters that are allowed (or required) to use the template to create a custom condition. For example, to create a custom condition from the CVEName template, the cve_name parameter is required.
This API lists all the available templates and their parameters.
Since: 3.116.x
Security: Requires a valid user with the "VIEW_POLICIES" permission.
Usage: GET /xray/api/v1/curation/condition_templates
Consumes: None
Produces: application/json
Path Parameters: None
Query Parameters: None
Response Body
Name | Type | Description |
|---|---|---|
| Array[ConditionTemplate] | Object per supported condition template |
| integer | Total number of available condition templates |
ConditionTemplate
Name | Type | Description |
|---|---|---|
| string | Identifier of one of the condition templates. |
| string | Name of condition template. |
| string | One of |
| Array[string] | List of package types that can be used with this condition template. Note that the created condition might only support some, not all of the package types. |
| Array[Param] | List of supported parameters for the condition template. |
Param
Name | Type | Description |
|---|---|---|
| string | Identifier of the parameter for the template. |
| boolean | Marks optional parameters. If not specified, the parameter is required. |
Sample Response
{
"data": [
{
"condition_template_id": "OpenSSF",
"name": "Package OpenSSF scorecard score in a range",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"],
"params": [
{
"param_id": "list_of_scorecard_checks"
},
{
"param_id": "block_in_case_check_value_is_missing"
}
]
},
{
"condition_template_id": "BannedLabels",
"name": "Package assigned to a label that is banned",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML", "Docker"],
"params": [
{
"param_id": "list_of_labels"
}
]
},
{
"condition_template_id": "AllowedLabels",
"name": "Block package unless it has a label in allowed labels list",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML", "Docker"],
"params": [
{
"param_id": "list_of_labels"
}
]
},
{
"condition_template_id": "SpecificVersions",
"name": "Block specific package version",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML", "Docker"],
"params": [
{
"param_id": "package_type"
},
{
"param_id": "package_name"
},
{
"param_id": "package_versions",
"is_optional": true
}
]
},
{
"condition_template_id": "AllowedLicenses",
"name": "Package license in allowed license list",
"risk_type": "legal",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML"],
"params": [
{
"param_id": "list_of_package_licenses"
},
{
"param_id": "multiple_license_permissive_approach"
}
]
},
{
"condition_template_id": "BannedLicenses",
"name": "Package license in banned license list",
"risk_type": "legal",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle", "HuggingFaceML"],
"params": [
{
"param_id": "list_of_package_licenses"
},
{
"param_id": "multiple_license_permissive_approach"
}
]
},
{
"condition_template_id": "CVECVSSRange",
"name": "Package has vulnerability with CVSS score in range {range}",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"],
"params": [
{
"param_id": "vulnerability_cvss_score_range"
},
{
"param_id": "epss",
"is_optional": true
},
{
"param_id": "apply_only_if_fix_is_available",
"is_optional": true
},
{
"param_id": "do_not_apply_for_already_existing_vulnerabilities",
"is_optional": true
}
]
},
{
"condition_template_id": "isImmature",
"name": "Package version is immature",
"risk_type": "operational",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"],
"params": [
{
"param_id": "package_age_days"
},
{
"param_id": "vulnerability_cvss_score",
"is_optional": true
}
]
},
{
"condition_template_id": "CVEName",
"name": "Package is vulnerable to CVE {CVE-ID}",
"risk_type": "security",
"supported_pkg_types": ["npm", "PyPI", "Maven", "Go", "NuGet", "Conan", "Gems", "Gradle"],
"params": [
{
"param_id": "cve_name"
}
]
}
],
"total_count": 9
}
Parameter Explanation
Condition Template | Parameter | Required/Optional | Description |
|---|---|---|---|
| |||
| Required | Array of objects, each object has two properties:
" | |
| Required | Boolean, if set to true the condition would block a package if the package does not have a value for one of the checks used in the | |
|
| Required | Array of strings which must be labels in the customer’s catalog |
| |||
| Required | String, one of: " | |
| Required | String, package name from Catalog. | |
| Required | Array of objects. Exact list of versions to block those specific listed versions: Greater than a version: Greater than or equals a version: Less than a version: Less than or equals a version: Range of versions (not inclusive): Range of versions (including start, not including end): Range of versions (not including start, including end): Range of versions (including start and end): All versions: | |
| |||
| Required | Array of strings. Licences from Catalog. | |
| Required | Boolean.If If | |
| |||
| Required | Array of strings. Licences from Catalog. | |
| Required | Boolean. If If | |
| |||
| Required | Array of exactly two numbers. Each number must be between 0 and 10 (not inclusive) and can have at most one decimal digit after the decimal point. | |
| Optional | Object with two properties: | |
| Optional | If t | |
| Optional | Default: Boolean. | |
| Optional | Default: Boolean. If | |
| |||
| Required | A whole number between | |
| Optional | A number between | |
|
| Required | String of the form “ |