Skip to content

Add pipeline securityReportSummary to GraphQL

Craig Smith requested to merge add_securtiy_report_summary_214388 into master

What does this MR do?

We need the ability to show the number of vulnerabilities and scanned resources for a pipeline.

Screen_Shot_2020-05-11_at_10.26.51_am

The facilitate this, this MR adds securityReportSummary to the GraphQL endpoint.

To query this data use:

query{
  project(fullPath: "root/railsgoat-dast-test"){
    pipeline(iid: "137"){
      securityReportSummary{
        dast{
          scannedResourcesCount
          vulnerabilitiesCount
        }
        sast{
          vulnerabilitiesCount
        }
        containerScanning{
          vulnerabilitiesCount
        }
        dependencyScanning{
          vulnerabilitiesCount
        }
      }
    }
  }
}

and the response

{
  "data": {
    "project": {
      "pipeline": {
        "securityReportSummary": {
          "dast": {
            "scannedResourcesCount": 13,
            "vulnerabilitiesCount": 48
          },
          "sast": {
            "vulnerabilitiesCount": 0
          },
          "containerScanning": {
            "vulnerabilitiesCount": 0
          },
          "dependencyScanning": {
            "vulnerabilitiesCount": 0
          }
        }
      }
    }
  }
}

The MR partial resolves #214388 (closed)

Screenshots

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 Alex Kalderimis

Merge request reports