Skip to content

[RUN AS-IF-FOSS] Add option to send slack notifications when a new vulnerability is detected

What does this MR do?

Add option to send slack notifications when a new vulnerability is detected

Related to #334951 (closed)

Screenshots (strongly suggested)

image

Testing locally

  1. Create a project, with a file named gl-dependency-scanning-report.json with the following content

    {
      "version": "2.4",
      "vulnerabilities": [
        {
          "id": "566894f5b08c7d540fc523535577f28d26b1a323b3827d65b7d2d04d28c30897",
          "category": "dependency_scanning",
          "name": "Exposure of Resource to Wrong Sphere CVE-2021-22897",
          "message": "Exposure of Resource to Wrong Sphere in haxx/curl CVE-2021-22897",
          "cve": "builds/gitlab-org/omnibus-gitlab/version-manifest.json:haxx/curl:cve:CVE-2021-22897",
          "severity": "Unknown",
          "scanner": {
            "id": "gitlab-depscan",
            "name": "GitLab Depscan"
          },
          "location": {
            "file": "builds/gitlab-org/omnibus-gitlab/version-manifest.json",
            "dependency": {
              "package": {
                "name": "haxx/curl"
              },
              "version": "7.74.0"
            }
          },
          "identifiers": [
            {
              "type": "cve",
              "name": "CVE-2021-22897",
              "value": "CVE-2021-22897",
              "url": "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22897"
            }
          ],
          "links": [
            {
              "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-22897"
            }
          ]
        }
      ],
      "remediations": []
    }
  2. Configure CI using the following configuration

    dependency_scanning:
      stage: test
      script:
        - echo "Running Dependency Scanning"
      artifacts:
        reports:
          dependency_scanning: gl-dependency-scanning-report.json
        paths:
          - gl-dependency-scanning-report.json
  3. Configure Slack integration for Vulnerabilities

  4. Run a pipeline

  5. If you need to test again, edit the security report file, do a find-and-replce-all of 897 with some three other digits.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Balasankar 'Balu' C

Merge request reports