As a vulnerability manager, you can assign categories to vulnerabilities to:
- Prioritize the vulnerabilities according to their area of impact.
- Assign vulnerabilities to the appropriate remediation owners.
The following section provides a list of supported endpoints and an overview about running these endpoints. Before you run an endpoint, you must authenticate yourself. For more information, see Access and authentication for the REST API
Before you begin
To categorize vulnerabilities
You can create, assign, update, and delete categories by using the REST API.
openapi: 3.0.0
paths:
/automation-console/api/v1/violations/{id}/categories:
patch:
tags:
- Violations
- Category
summary: Assign a category to a vulnerability
description: An API to assign categories to vulnerability.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/categoriesByVidRequest'
required: true
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Creates categories violation map.
'401':
description: >-
Indicates that the create violation categories request is not authorized.
content:
application/json:
schema:
$ref: '#/components/schemas/UnAuthorizedResponse'
'404':
description: >-
Indicates that no data is found for the given request.
'500':
description: >-
Indicates that an internal server error is encountered when trying to create violation categories.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/automation-console/api/v1/violations/categories:
post:
tags:
- Category
summary: creates the categories
description: An API to create categories. It create the categories if all the provided categories in the list are not present.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createCategoriesRequest'
required: true
responses:
'200':
description: Returns the success once categories are created.
content:
application/json:
schema:
$ref: '#/components/schemas/createCategoriesResponse'
'400':
description: >-
Indicates bad request if the categories are not present in request body.
'401':
description: >-
Indicates that the request is not authorized.
content:
application/json:
schema:
$ref: '#/components/schemas/UnAuthorizedResponse'
'500':
description: >-
Indicates that an internal server error is encountered when trying to create categories.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
put:
tags:
- Category
summary: update category name
description: An API to update category name
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateCategoryNameRequest'
required: true
responses:
'200':
description: Returns the success once category name is updated.
content:
application/json:
schema:
$ref: '#/components/schemas/createCategoriesResponse'
'400':
description: >-
Indicates bad request if the existing_category name is not exists.
'401':
description: >-
Indicates that the request is not authorized.
content:
application/json:
schema:
$ref: '#/components/schemas/UnAuthorizedResponse'
'500':
description: >-
Indicates that an internal server error is encountered when trying to update category name.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
get:
tags:
- Category
summary: get all available categories
description: An API to fetch all available categories.
responses:
'200':
description: Returns categories list.
content:
application/json:
schema:
$ref: '#/components/schemas/getCategoriesResponse'
'204':
description:
Indicates that no categories available.
'401':
description: >-
Indicates that the request is not authorized.
content:
application/json:
schema:
$ref: '#/components/schemas/UnAuthorizedResponse'
'500':
description: >-
Indicates that an internal server error is encountered when trying to create categories.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/automation-console/api/v1/violations/categories/{categoryName}:
delete:
tags:
- Category
summary: Delete category by category name.
description: An API to delete existing category.
parameters:
- name: categoryName
in: path
required: true
description: category name
schema:
type: string
responses:
"200":
description: Indicates the successful deletion of the given category.
content:
application/json:
schema:
$ref: "#/components/schemas/deleteCategoriesResponse"
"401":
description: >-
Indicates that the request is not authorized.
content:
application/json:
schema:
$ref: "#/components/schemas/UnAuthorizedResponse"
"500":
description: >-
Indicates that an internal server error is encountered when trying to create categories.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
components:
schemas:
ErrorResponse:
properties:
errormessage:
type: string
example: Internal Server Error
errorcode:
type: string
example: 500
UnAuthorizedResponse:
type: object
properties:
message:
type: string
example: UNAUTHORIZED
categoriesByVidRequest:
type: object
properties:
categories:
type: array
items:
type: string
example: ["Microsoft OS", "Ubuntu", "Debian", "Java"]
createCategoriesRequest:
type: object
properties:
categories:
type: array
description: Name of categories.
items:
type: string
example: ["Microsoft windows", "Google Chrome", "FTP Server"]
createCategoriesResponse:
type: object
properties:
code:
type: string
example: 200
message:
type: string
example: OK
updateCategoryNameRequest:
type: array
items:
type: object
properties:
existing_category:
type: string
example: "Microsoft windows"
update_category:
type: string
example: "FTP"
getCategoriesResponse:
type: object
properties:
categories:
type: array
description: Name of categories.
items:
type: string
example: ["Microsoft windows", "Google Chrome", "FTP Server"]
deleteCategoriesResponse:
type: object
properties:
code:
type: string
example: 200
message:
type: string
example: OK