AlertSourceBase abstract base class. This guide walks through adding a new source from scratch.
Prerequisites
- Python 3.12+
- Familiarity with the source system’s alert format
- API documentation for the source system (commit to
docs/integrations/{name}/api_notes.mdbefore writing code)
Step 1: Research the Source API
Before writing any integration code, document the source system’s API:docs/integrations/your-source/api_notes.md with:
- Alert payload structure and field names/types
- Webhook configuration method
- Signature verification format
- Severity levels and their mapping
- Rate limits
- Edge cases and known quirks
Step 2: Create the Plugin File
Createapp/integrations/sources/your_source.py:
Step 3: Register the Plugin
Add your source to the source registry inapp/integrations/sources/__init__.py:
Step 4: Add Webhook Signature Verification (Optional)
Overrideverify_webhook_signature() if your source supports it:
Always use
hmac.compare_digest() for signature comparison — never ==. This prevents timing attacks.Step 5: Add Indicator Field Mappings (Optional)
For indicators that aren’t extracted by yourextract_indicators() method, add custom field mappings via the API:
Step 6: Write Tests
Createtests/test_your_source.py:
Step 7: Test End-to-End
GET /v1/alerts with the correct normalized fields.

