dependency-scanning-report-format.json 13.8 KB
Newer Older
Igor Frenkel's avatar
Igor Frenkel committed
1
{
2
  "$schema": "http://json-schema.org/draft-07/schema#",
Igor Frenkel's avatar
Igor Frenkel committed
3
  "title": "Report format for GitLab Dependency Scanning",
4
  "description": "This schema provides the the report format for Dependency Scanning analyzers (https://docs.gitlab.com/ee/user/application_security/dependency_scanning).",
Igor Frenkel's avatar
Igor Frenkel committed
5
  "self": {
6
    "version": "3.1.0"
Igor Frenkel's avatar
Igor Frenkel committed
7 8 9 10 11 12
  },
  "required": [
    "dependency_files",
    "version",
    "vulnerabilities"
  ],
13
  "additionalProperties": true,
Igor Frenkel's avatar
Igor Frenkel committed
14
  "properties": {
15 16 17 18 19 20 21 22 23 24 25 26 27
    "scan": {
      "type": "object",
      "required": [
        "end_time",
        "messages",
        "scanner",
        "start_time",
        "status",
        "type"
      ],
      "properties": {
        "end_time": {
          "type": "string",
28
          "description": "ISO8601 UTC value with format yyyy-mm-ddThh:mm:ss, representing when the scan finished.",
29 30 31 32 33 34 35 36
          "examples": [
            "2020-01-28T03:26:02"
          ]
        },
        "messages": {
          "type": "array",
          "items": {
            "type": "object",
37
            "description": "Communication intended for the initiator of a scan.",
38 39 40 41 42 43 44
            "required": [
              "level",
              "value"
            ],
            "properties": {
              "level": {
                "type": "string",
45
                "description": "Describes the severity of the communication. Use info to communicate normal scan behaviour; warn to communicate a potentially recoverable problem, or a partial error; fatal to communicate an issue that causes the scan to halt.",
46 47 48 49 50 51 52 53 54 55 56
                "enum": [
                  "info",
                  "warn",
                  "fatal"
                ],
                "examples": [
                  "info"
                ]
              },
              "value": {
                "type": "string",
57
                "description": "The message to communicate.",
58 59 60 61 62 63 64 65 66
                "examples": [
                  "Permission denied, scanning aborted"
                ]
              }
            }
          }
        },
        "scanner": {
          "type": "object",
67
          "description": "Object defining the scanner used to perform the scan.",
68 69 70
          "required": [
            "id",
            "name",
71 72
            "version",
            "vendor"
73 74 75 76
          ],
          "properties": {
            "id": {
              "type": "string",
77
              "description": "Unique id that identifies the scanner.",
78 79 80 81 82 83
              "examples": [
                "my-sast-scanner"
              ]
            },
            "name": {
              "type": "string",
84
              "description": "A human readable value that identifies the scanner, not required to be unique.",
85 86 87 88 89 90
              "examples": [
                "My SAST Scanner"
              ]
            },
            "url": {
              "type": "string",
91
              "description": "A link to more information about the scanner.",
92 93 94 95 96 97
              "examples": [
                "https://scanner.url"
              ]
            },
            "version": {
              "type": "string",
98
              "description": "The version of the scanner.",
99 100 101
              "examples": [
                "1.0.2"
              ]
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
            },
            "vendor": {
              "type": "object",
              "description": "The vendor/maintainer of the scanner.",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the vendor.",
                  "examples": [
                    "GitLab"
                  ]
                }
              }
118 119 120 121 122
            }
          }
        },
        "start_time": {
          "type": "string",
123
          "description": "ISO8601 UTC value with format yyyy-mm-ddThh:mm:ss, representing when the scan started.",
124 125 126 127 128 129
          "examples": [
            "2020-02-14T16:01:59"
          ]
        },
        "status": {
          "type": "string",
130
          "description": "Result of the scan.",
131 132 133 134 135 136 137
          "enum": [
            "success",
            "failure"
          ]
        },
        "type": {
          "type": "string",
138
          "description": "Type of the scan.",
139 140 141 142 143 144 145 146 147
          "enum": [
            "container_scanning",
            "dependency_scanning",
            "dast",
            "sast"
          ]
        }
      }
    },
Igor Frenkel's avatar
Igor Frenkel committed
148 149
    "schema": {
      "type": "string",
150 151
      "description": "URI pointing to the validating security report schema.",
      "format": "uri"
Igor Frenkel's avatar
Igor Frenkel committed
152 153 154
    },
    "version": {
      "type": "string",
155 156
      "description": "Report syntax version used to generate this JSON.",
      "pattern": "^[0-9]+\\.[0-9]+\\.?[0-9]*$"
Igor Frenkel's avatar
Igor Frenkel committed
157 158 159
    },
    "vulnerabilities": {
      "type": "array",
160
      "description": "Array of vulnerability objects.",
Igor Frenkel's avatar
Igor Frenkel committed
161 162
      "items": {
        "type": "object",
163
        "description": "Describes the vulnerability.",
Igor Frenkel's avatar
Igor Frenkel committed
164 165 166 167 168 169 170 171
        "required": [
          "category",
          "cve",
          "identifiers",
          "location",
          "scanner"
        ],
        "properties": {
172 173
          "id": {
            "type": "string",
174
            "description": "Unique identifier of the vulnerability. This is recommended to be a UUID.",
175 176 177 178
            "examples": [
              "642735a5-1425-428d-8d4e-3c854885a3c9"
            ]
          },
Igor Frenkel's avatar
Igor Frenkel committed
179 180
          "category": {
            "type": "string",
181
            "description": "Describes where this vulnerability belongs (for example, SAST, Dependency Scanning, and so on)."
Igor Frenkel's avatar
Igor Frenkel committed
182 183 184
          },
          "name": {
            "type": "string",
185
            "description": "The name of the vulnerability. This must not include the finding's specific information."
Igor Frenkel's avatar
Igor Frenkel committed
186 187 188
          },
          "message": {
            "type": "string",
189
            "description": "A short text section that describes the vulnerability. This may include the finding's specific information."
Igor Frenkel's avatar
Igor Frenkel committed
190 191 192
          },
          "description": {
            "type": "string",
193
            "description": "A long text section describing the vulnerability more fully."
Igor Frenkel's avatar
Igor Frenkel committed
194 195
          },
          "cve": {
196 197
            "type": "string",
            "description": "(Deprecated - use vulnerabilities[].id instead) A fingerprint string value that represents a concrete finding. This is used to determine whether two findings are same, which may not be 100% accurate. Note that this is NOT a CVE as described by https://cve.mitre.org/."
Igor Frenkel's avatar
Igor Frenkel committed
198 199 200
          },
          "severity": {
            "type": "string",
201
            "description": "How much the vulnerability impacts the software. Possible values are Info, Unknown, Low, Medium, High, or Critical. Note that some analyzers may not report all these possible values.",
Igor Frenkel's avatar
Igor Frenkel committed
202 203 204 205 206 207 208 209 210 211 212
            "enum": [
              "Info",
              "Unknown",
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "confidence": {
            "type": "string",
213
            "description": "How reliable the vulnerability's assessment is. Possible values are Ignore, Unknown, Experimental, Low, Medium, High, and Confirmed. Note that some analyzers may not report all these possible values.",
Igor Frenkel's avatar
Igor Frenkel committed
214 215 216 217 218 219 220 221 222 223 224 225
            "enum": [
              "Ignore",
              "Unknown",
              "Experimental",
              "Low",
              "Medium",
              "High",
              "Confirmed"
            ]
          },
          "solution": {
            "type": "string",
226
            "description": "Explanation of how to fix the vulnerability."
Igor Frenkel's avatar
Igor Frenkel committed
227 228
          },
          "scanner": {
229
            "description": "Describes the scanner used to find this vulnerability.",
Igor Frenkel's avatar
Igor Frenkel committed
230 231 232 233 234 235 236 237
            "type": "object",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
238
                "description": "The scanner's ID, as a snake_case string."
Igor Frenkel's avatar
Igor Frenkel committed
239 240 241
              },
              "name": {
                "type": "string",
242
                "description": "Name of the scanner, for display purposes."
Igor Frenkel's avatar
Igor Frenkel committed
243 244 245 246 247 248
              }
            }
          },
          "identifiers": {
            "type": "array",
            "minItems": 1,
249
            "description": "An ordered array of references that identify a vulnerability on internal or external databases. The first identifier is the Primary Identifier, which has special meaning.",
Igor Frenkel's avatar
Igor Frenkel committed
250 251 252 253 254 255 256 257 258 259
            "items": {
              "type": "object",
              "required": [
                "type",
                "name",
                "value"
              ],
              "properties": {
                "type": {
                  "type": "string",
260
                  "description": "for example, cve, cwe, osvdb, usn, or an analyzer-dependent type such as gemnasium)."
Igor Frenkel's avatar
Igor Frenkel committed
261 262 263
                },
                "name": {
                  "type": "string",
264
                  "description": "Name of the identifier, for display purposes."
Igor Frenkel's avatar
Igor Frenkel committed
265 266 267
                },
                "url": {
                  "type": "string",
268 269
                  "description": "URL of the identifier's documentation.",
                  "format": "uri"
Igor Frenkel's avatar
Igor Frenkel committed
270 271 272
                },
                "value": {
                  "type": "string",
273
                  "description": "Value of the identifier, for matching purpose."
Igor Frenkel's avatar
Igor Frenkel committed
274 275 276 277 278 279
                }
              }
            }
          },
          "links": {
            "type": "array",
280
            "description": "An array of references to external documentation or articles that describe the vulnerability.",
Igor Frenkel's avatar
Igor Frenkel committed
281 282 283 284 285 286 287 288
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "name": {
                  "type": "string",
289
                  "description": "Name of the vulnerability details link."
Igor Frenkel's avatar
Igor Frenkel committed
290 291 292
                },
                "url": {
                  "type": "string",
293 294
                  "description": "URL of the vulnerability details document.",
                  "format": "uri"
Igor Frenkel's avatar
Igor Frenkel committed
295 296 297 298 299
                }
              }
            }
          },
          "location": {
300 301
            "type": "object",
            "description": "Identifies the vulnerability's location.",
Igor Frenkel's avatar
Igor Frenkel committed
302 303 304 305 306 307 308
            "required": [
              "file",
              "dependency"
            ],
            "properties": {
              "file": {
                "type": "string",
309
                "description": "Path to the manifest or lock file where the dependency is declared (such as yarn.lock)."
Igor Frenkel's avatar
Igor Frenkel committed
310 311 312
              },
              "dependency": {
                "type": "object",
313
                "description": "Describes the dependency of a project where the vulnerability is located.",
Igor Frenkel's avatar
Igor Frenkel committed
314 315 316
                "properties": {
                  "package": {
                    "type": "object",
317
                    "description": "Provides information on the package where the vulnerability is located.",
Igor Frenkel's avatar
Igor Frenkel committed
318 319
                    "properties": {
                      "name": {
320 321
                        "type": "string",
                        "description": "Name of the package where the vulnerability is located."
Igor Frenkel's avatar
Igor Frenkel committed
322 323 324 325
                      }
                    }
                  },
                  "version": {
326 327
                    "type": "string",
                    "description": "Version of the vulnerable package."
Igor Frenkel's avatar
Igor Frenkel committed
328 329 330 331 332 333 334 335 336 337
                  }
                }
              }
            }
          }
        }
      }
    },
    "remediations": {
      "type": "array",
338
      "description": "An array of objects containing information on available remediations, along with patch diffs to apply.",
Igor Frenkel's avatar
Igor Frenkel committed
339 340 341 342 343 344 345 346 347 348
      "items": {
        "type": "object",
        "required": [
          "fixes",
          "summary",
          "diff"
        ],
        "properties": {
          "fixes": {
            "type": "array",
349
            "description": "An array of strings that represent references to vulnerabilities fixed by this remediation.",
Igor Frenkel's avatar
Igor Frenkel committed
350 351 352 353 354 355 356 357
            "items": {
              "type": "object",
              "required": [
                "cve"
              ],
              "properties": {
                "cve": {
                  "type": "string",
358
                  "description": "(Deprecated - use vulnerabilities[].id instead) A fingerprint string value that represents a concrete finding. This is used to determine whether two findings are same, which may not be 100% accurate. Note that this is NOT a CVE as described by https://cve.mitre.org/."
Igor Frenkel's avatar
Igor Frenkel committed
359 360 361 362 363 364
                }
              }
            }
          },
          "summary": {
            "type": "string",
365
            "description": "An overview of how the vulnerabilities were fixed."
Igor Frenkel's avatar
Igor Frenkel committed
366 367 368
          },
          "diff": {
            "type": "string",
369
            "description": "A base64-encoded remediation code diff, compatible with git apply."
Igor Frenkel's avatar
Igor Frenkel committed
370 371 372 373 374 375
          }
        }
      }
    },
    "dependency_files": {
      "type": "array",
376
      "description": "List of dependency files identified in the project.",
Igor Frenkel's avatar
Igor Frenkel committed
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
      "items": {
        "type": "object",
        "required": [
          "path",
          "package_manager",
          "dependencies"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "package_manager": {
            "type": "string"
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "object",
395
              "description": "Describes the dependency of a project where the vulnerability is located.",
Igor Frenkel's avatar
Igor Frenkel committed
396 397 398
              "properties": {
                "package": {
                  "type": "object",
399
                  "description": "Provides information on the package where the vulnerability is located.",
Igor Frenkel's avatar
Igor Frenkel committed
400 401
                  "properties": {
                    "name": {
402 403
                      "type": "string",
                      "description": "Name of the package where the vulnerability is located."
Igor Frenkel's avatar
Igor Frenkel committed
404 405 406 407
                    }
                  }
                },
                "version": {
408 409
                  "type": "string",
                  "description": "Version of the vulnerable package."
Igor Frenkel's avatar
Igor Frenkel committed
410 411 412 413 414 415 416 417 418
                }
              }
            }
          }
        }
      }
    }
  }
}