Skip to content

Add structured findings to webhook payload#38

Open
dc-larsen wants to merge 1 commit intomainfrom
feature/structured-webhook-payload
Open

Add structured findings to webhook payload#38
dc-larsen wants to merge 1 commit intomainfrom
feature/structured-webhook-payload

Conversation

@dc-larsen
Copy link
Contributor

Summary

  • Each connector's webhook formatter now builds a findings array of structured objects alongside the markdown table
  • WebhookNotifier payload includes timestamp (ISO 8601), scan_type, summary (severity counts), and findings
  • Backward compatible: notification.content (markdown) still present
  • TruffleHog findings intentionally omit redacted secret values from structured output

New payload shape

{
  "repository": "...",
  "branch": "...",
  "scanner": "socket-security",
  "timestamp": "2026-02-27T19:49:33Z",
  "scan_type": "Socket CVE Scanning Results: Dockerfile",
  "summary": {"total": 71, "critical": 9, "high": 22, "medium": 12, "low": 10},
  "findings": [
    {"package": "bson", "version": "1.0.9", "ecosystem": "npm", "purl": "pkg:npm/bson@1.0.9", "cves": ["CVE-2020-7610"], "severity": "critical", "scanner": "trivy"}
  ],
  "notification": {"title": "...", "content": "markdown table..."}
}

Test plan

  • 125 tests pass (all existing + 25 new)
  • Push to dc-larsen/socket-basics-test, trigger workflow, verify payload on webhook.site
  • Confirm findings are structured JSON with proper ecosystems (no pkg:unknown/)

Webhook payloads now include a machine-readable findings array alongside
the existing markdown content. Each connector (Trivy, Socket Tier1,
OpenGrep, TruffleHog) builds structured finding objects during format.
The WebhookNotifier aggregates these into the payload with a severity
summary and ISO 8601 timestamp. The notification.content field remains
for backward compatibility.

TruffleHog findings intentionally omit redacted secret values from the
structured output.
@dc-larsen dc-larsen requested a review from a team as a code owner February 27, 2026 20:39
@dc-larsen dc-larsen requested a review from lelia February 27, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant