Skip to main content
The webhook command group manages outbound webhooks. When an InfraAudit event occurs — such as a drift finding or a new alert — InfraAudit sends an HTTP POST to each registered webhook URL. Use these commands to register, test, and remove webhooks.

webhook list

List all registered webhooks:
infraudit webhook list
Example output:
ID  NAME          URL                                    EVENTS                       STATUS
--  ----          ---                                    ------                       ------
1   Slack Alerts  https://hooks.slack.com/services/...  drift.detected,alert.created  active
2   PagerDuty     https://events.pagerduty.com/...      alert.created                active

webhook create

Register a new webhook endpoint. Synopsis:
infraudit webhook create [flags]
FlagDescription
--urlDestination URL that receives the HTTP POST
--eventsComma-separated list of event types to subscribe to
--nameDisplay name for the webhook
--secretSigning secret for HMAC payload verification
Example:
infraudit webhook create \
  --name "Slack Alerts" \
  --url https://hooks.slack.com/services/... \
  --events drift.detected,alert.created
To see available event types, run infraudit webhook events.

webhook get

Show details for a specific webhook, including its URL, subscribed events, and delivery statistics: Synopsis:
infraudit webhook get <webhook-id>
Example:
infraudit webhook get 1

webhook delete

Remove a registered webhook: Synopsis:
infraudit webhook delete <webhook-id>
Example:
infraudit webhook delete 1

webhook test

Send a test payload to a webhook endpoint to verify it is reachable and processing events correctly: Synopsis:
infraudit webhook test <webhook-id>
Example:
infraudit webhook test 1

webhook events

List all available event types that you can subscribe to:
infraudit webhook events
Example event types:
EventDescription
drift.detectedNew drift finding created
alert.createdNew alert triggered
vulnerability.foundNew vulnerability finding
compliance.failedCompliance control failed
remediation.completedRemediation action executed
Webhook payloads include an HMAC signature in the X-InfraAudit-Signature header when you provide a --secret. Verify this signature in your endpoint to reject forged requests.