goharbor/harbor

Webhook support for Microsoft Teams

Open

#13,395 opened on Oct 29, 2020

View on GitHub
 (11 comments) (9 reactions) (0 assignees)Go (5,235 forks)batch import
area/webhookhelp wantedkind/requirement

Repository metrics

Stars
 (28,490 stars)
PR merge metrics
 (Avg merge 8d 17h) (74 merged PRs in 30d)

Description

Harbor currently supports two types of webhooks:

  • http
  • slack

It would be great to see support for Teams as the standard http webhooks do not appear to be supported by the Microsoft Teams webhook connector.

Currently, it fails with : Summary or Text is required.

You can test this by creating an endpoint here, adding the to url to your project's webhooks and then using postman or curl to post to your Teams webhook connector url.

curl \
-H 'Content-Type: application/json' \
-d '{
  "type": "SCANNING_COMPLETED",
  "occur_at": 1603969071,
  "operator": "auto",
  "event_data": {
    "resources": [
      {
        "digest": "sha256:a15790640a6690123456789cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65",
        "tag": "",
        "resource_url": "redactedsite.com/library/alpine:",
        "scan_overview": {
          "application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0": {
            "report_id": "5bf603cf-daa7-41f9-8466-9740b88b8b92",
            "scan_status": "Success",
            "severity": "Unknown",
            "duration": 8,
            "summary": {
              "total": 0,
              "fixable": 0,
              "summary": {}
            },
            "start_time": "2020-10-29T10:57:43.975649Z",
            "end_time": "2020-10-29T10:57:51.095958Z",
            "scanner": {
              "name": "Trivy",
              "vendor": "Aqua Security",
              "version": "v0.9.2"
            },
            "complete_percent": 100
          }
        }
      }
    ],
    "repository": {
      "name": "alpine",
      "namespace": "mynamespace",
      "repo_full_name": "library/alpine",
      "repo_type": "private"
    }
  }
}' \
https://outlook.office.com/webhook/<your webhook id>

Also, what happened to the 'Test Endpoint' button? It's mentioned in the Harbor documentation but doesn't appear to exist anymore.

Contributor guide