Skip to content

feat(eda): add webhook, polling, and Kafka event source plugins#11

Open
stevefulme1 wants to merge 3 commits into
logicmonitor:mainfrom
stevefulme1:feat/eda-source-plugins
Open

feat(eda): add webhook, polling, and Kafka event source plugins#11
stevefulme1 wants to merge 3 commits into
logicmonitor:mainfrom
stevefulme1:feat/eda-source-plugins

Conversation

@stevefulme1
Copy link
Copy Markdown
Contributor

Summary

Adds Event-Driven Ansible (EDA) source plugins to enable bidirectional automation with Edwin AI. Edwin AI can now trigger Ansible playbooks in response to alerts, complementing the existing data collection modules.

Event Source Plugins

Plugin Pattern Use Case
webhook Edwin AI pushes to EDA Real-time, simplest setup
alerts EDA polls Edwin AI API Works behind firewalls, no Edwin config needed
kafka EDA consumes from Kafka High-volume enterprise deployments

All three sources emit a consistent normalized event schema under the edwin_ai key:

edwin_ai:
  event_type: alert
  alert_id: "12345"
  severity: critical
  host: web-server-01
  message: CPU usage exceeded 95%
  metric: cpu.usage
  value: 97.3
  threshold: 95
  resource_group: production
  timestamp: 1715788800
  status: active
  raw: {original payload}

Example Rulebooks

  • alert_remediation.yml — webhook-based auto-remediation (CPU, disk, memory, service down)
  • alert_polling.yml — polling-based with incident creation/closure
  • alert_kafka.yml — Kafka stream processing with escalation

Auth

Uses the same portal/access_id/access_key pattern as the existing query_api module. Webhook source optionally supports HMAC signature verification.

Dependencies

  • webhook: aiohttp (included in EDA controller)
  • alerts: requests (already a collection dependency)
  • kafka: aiokafka (optional, only needed for Kafka source)

Test plan

  • Webhook source receives and normalizes sample payloads
  • Alerts source authenticates and polls Edwin AI API
  • Kafka source connects and consumes from topic
  • Rulebook conditions match on normalized event fields
  • HMAC signature verification rejects invalid webhooks

stevefulme1 and others added 3 commits May 15, 2026 12:28
Add three EDA source plugins for event-driven automation:
- webhook: receive Edwin AI alerts via HTTP webhook
- alerts: poll Edwin AI API for active alerts
- kafka: consume alert events from Kafka topics

All sources emit a consistent normalized event schema under
the 'edwin_ai' key. Includes example rulebooks for each source.
- Validate portal name against allowlist pattern to prevent SSRF
- Add explicit verify=True on requests calls for SSL cert validation
- Validate webhook bind host and port inputs
- Add payload size limit to webhook endpoint
- Validate deserialized payload types before processing
- Use logger.exception() instead of logging raw exception strings
- Add minimum polling interval guard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add portal name validation to _rest_methods.py to prevent SSRF
- Add explicit timeout and verify=True on all requests calls
- Add raise_for_status() to auth token request
- Import _validate_portal in query_api.py module

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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