2021-02-22 17:27:13 +05:30
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"description": "The schema for vulnerability finding details",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"patternProperties": {
|
|
|
|
"^.*$": {
|
|
|
|
"allOf": [
|
|
|
|
{ "$ref": "#/definitions/named_field" },
|
2021-04-17 20:07:23 +05:30
|
|
|
{ "$ref": "#/definitions/detail_type" }
|
2021-02-22 17:27:13 +05:30
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"detail_type": {
|
2021-02-22 17:27:13 +05:30
|
|
|
"oneOf": [
|
|
|
|
{ "$ref": "#/definitions/named_list" },
|
|
|
|
{ "$ref": "#/definitions/list" },
|
|
|
|
{ "$ref": "#/definitions/table" },
|
|
|
|
{ "$ref": "#/definitions/text" },
|
|
|
|
{ "$ref": "#/definitions/url" },
|
|
|
|
{ "$ref": "#/definitions/code" },
|
2021-04-17 20:07:23 +05:30
|
|
|
{ "$ref": "#/definitions/value" },
|
|
|
|
{ "$ref": "#/definitions/diff" },
|
|
|
|
{ "$ref": "#/definitions/markdown" },
|
2021-02-22 17:27:13 +05:30
|
|
|
{ "$ref": "#/definitions/commit" },
|
|
|
|
{ "$ref": "#/definitions/file_location" },
|
|
|
|
{ "$ref": "#/definitions/module_location" }
|
|
|
|
]
|
|
|
|
},
|
2021-04-17 20:07:23 +05:30
|
|
|
"text_value": {
|
|
|
|
"type": "string"
|
2021-02-22 17:27:13 +05:30
|
|
|
},
|
|
|
|
"named_field": {
|
|
|
|
"type": "object",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"name"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"name": {
|
|
|
|
"$ref": "#/definitions/text_value",
|
|
|
|
"minLength": 1
|
|
|
|
},
|
|
|
|
"description": {
|
|
|
|
"$ref": "#/definitions/text_value"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
"named_list": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "An object with named and typed fields",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"items"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "named-list"
|
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"patternProperties": {
|
|
|
|
"^.*$": {
|
|
|
|
"allOf": [
|
2021-04-17 20:07:23 +05:30
|
|
|
{
|
|
|
|
"$ref": "#/definitions/named_field"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "#/definitions/detail_type"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"list": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A list of typed fields",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"items"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "list"
|
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
"items": {
|
|
|
|
"type": "array",
|
2021-04-17 20:07:23 +05:30
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/detail_type"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"table": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A table of typed fields",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"rows"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "table"
|
|
|
|
},
|
|
|
|
"header": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/detail_type"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"rows": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/detail_type"
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "Raw text",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"value"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "text"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"$ref": "#/definitions/text_value"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
"url": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A single URL",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"href"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "url"
|
|
|
|
},
|
|
|
|
"text": {
|
|
|
|
"$ref": "#/definitions/text_value"
|
|
|
|
},
|
|
|
|
"href": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
"examples": ["http://mysite.com"]
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
"code": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A codeblock",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"value"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "code"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"lang": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "A programming language"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
2021-04-17 20:07:23 +05:30
|
|
|
"value": {
|
2021-02-22 17:27:13 +05:30
|
|
|
"type": "object",
|
2021-04-17 20:07:23 +05:30
|
|
|
"description": "A field that can store a range of types of value",
|
|
|
|
"required": ["type", "value"],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": { "const": "value" },
|
|
|
|
"value": {
|
|
|
|
"type": ["number", "string", "boolean"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"diff": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A diff",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"before",
|
|
|
|
"after"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"const": "diff"
|
|
|
|
},
|
|
|
|
"before": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"after": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"markdown": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "GitLab flavoured markdown, see https://docs.gitlab.com/ee/user/markdown.html",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"type": {
|
|
|
|
"const": "markdown"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"$ref": "#/definitions/text_value",
|
|
|
|
"examples": ["Here is markdown `inline code` #1 [test](gitlab.com)\n\n![GitLab Logo](https://about.gitlab.com/images/press/logo/preview/gitlab-logo-white-preview.png)"]
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"commit": {
|
|
|
|
"type": "object",
|
2021-04-17 20:07:23 +05:30
|
|
|
"description": "A commit/tag/branch within the GitLab project",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"value"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "commit"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The commit SHA",
|
|
|
|
"minLength": 1
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
"file_location": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A location within a file in the project",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"file_name",
|
|
|
|
"line_start"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "file-location"
|
|
|
|
},
|
|
|
|
"file_name": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1
|
|
|
|
},
|
|
|
|
"line_start": {
|
|
|
|
"type": "integer"
|
|
|
|
},
|
|
|
|
"line_end": {
|
|
|
|
"type": "integer"
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
"module_location": {
|
|
|
|
"type": "object",
|
|
|
|
"description": "A location within a binary module of the form module+relative_offset",
|
2021-04-17 20:07:23 +05:30
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"module_name",
|
|
|
|
"offset"
|
|
|
|
],
|
2021-02-22 17:27:13 +05:30
|
|
|
"properties": {
|
2021-04-17 20:07:23 +05:30
|
|
|
"type": {
|
|
|
|
"const": "module-location"
|
|
|
|
},
|
|
|
|
"module_name": {
|
|
|
|
"type": "string",
|
|
|
|
"minLength": 1,
|
|
|
|
"examples": ["compiled_binary"]
|
|
|
|
},
|
|
|
|
"offset": {
|
|
|
|
"type": "integer",
|
|
|
|
"examples": [100]
|
|
|
|
}
|
2021-02-22 17:27:13 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|