Skip to content

Add CSV export for First Class Vulnerabilities

What does this MR do?

Related to #197494 (closed)

In this MR we add the ability in API to generate CSV Export for Vulnerabilities as a background job. All exports with files will be removed after 1 hour after they were available for download.

New endpoints:

  • POST /api/v4/projects/:project_id/vulnerability_exports - initiate export
{
    "id": 7,
    "created_at": "2020-03-11T21:56:28.835Z",
    "project_id": 19,
    "format": "csv",
    "status": "created",
    "started_at": null,
    "finished_at": null,
    "_links": {
        "self": "http://gitlab.alan:3000/api/v4/projects/19/vulnerability_exports/7",
        "download": "http://gitlab.alan:3000/api/v4/projects/19/vulnerability_exports/7/download"
    }
}
  • GET /api/v4/projects/:project_id/vulnerability_exports/:id - get export status
{
    "id": 7,
    "created_at": "2020-03-11T21:56:28.835Z",
    "project_id": 19,
    "format": "csv",
    "status": "finished",
    "started_at": "2020-03-11T21:57:28.835Z",
    "finished_at": "2020-03-11T21:59:28.835Z",
    "_links": {
        "self": "http://gitlab.alan:3000/api/v4/projects/19/vulnerability_exports/7",
        "download": "http://gitlab.alan:3000/api/v4/projects/19/vulnerability_exports/7/download"
    }
}
  • GET /api/v4/projects/:project_id/vulnerability_exports/:id/download - download export file

root-security-reports_vulnerability_findings_2020-03-10.csv

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Alan (Maciej) Paruszewski

Merge request reports