Description: Returns all Ignore Rules by specific filters.
Since: 3.11
Security: Requires a valid user with the "Manage Watches" permission.
Notes: For Xray version 3.21.2 and above with Projects, a Project Admin with the Manage Assets privilege can get a list of Ignore Rules using this REST API in the scope of a project, by using the additional query parameter projectKey.
Usage: GET /xray/api/v1/ignore_rules
Parameters:
"vulnerability"/"license"/"policy"/"watch"/"component_name"/"component_version"/
"artifact_name"/"artifact_version"/"build_name"/"build_version"/
"release_bundle_name"/"release_bundle_version"/"docker_layer"
Pagination Parameters:
"order_by""direction""page_num""num_of_rows""expires_before""expires_after""project_key"
Sample Usage
http://10.70.30.82:8082/xray/api/v1/ignore_rules?artifact_name=artifact&artifact_version=2&artifact_path=/myRepo
Sample Response
{
"data":
[
{
"id": string,
"created": Date,
"author": string,
"notes": string,
"expires_at": Date,
"ignore_filters": {
"vulnerabilities": [
"Vuln1",
"Vuln2"
],
"licenses": [
],
"watches": [
"Watch1",
"Watch2"
],
"components": [
{name:"docker://redis"},
{name:"Comp2", version: "2.6"},
{name:"Comp3", version: "1.03"}
]
}
],
"total_count": 1
}Ignore Rules that will expire before a date
GET /api/v1/ignore_rules?expires_before=2021-01-03T00:00:00Z
Ignore Rules that will expire after a date
GET /api/v1/ignore_rules?expires_after=2021-01-01T00:00:00Z
Ignore Rules that will expire between dates
GET /api/v1/ignore_rules?expires_after=2021-01-01T00:00:00Z&expires_before=2021-01-03T00:00:00Z
Get global Ignore Rules with Specific Project Filter
GET api/v1/ignore_rules?artifact_name=artifact&artifact_version=2&artifact_path=/myRepo&project=<project_key>
Get Ignore Rules for Specific Project
GET api/v1/ignore_rules?projectKey=<project_key>
Response Codes:
500 - Failed to get ignore rules
401 - Unauthorized
403 - Forbidden