Skip to main content
Calseta’s alert source system is plugin-based. Each source is a Python class implementing the 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.md before writing code)

Step 1: Research the Source API

Before writing any integration code, document the source system’s API:
Create 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
This step is mandatory. Don’t skip it — integration bugs almost always stem from incomplete understanding of the source API.

Step 2: Create the Plugin File

Create app/integrations/sources/your_source.py:

Step 3: Register the Plugin

Add your source to the source registry in app/integrations/sources/__init__.py:

Step 4: Add Webhook Signature Verification (Optional)

Override verify_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 your extract_indicators() method, add custom field mappings via the API:

Step 6: Write Tests

Create tests/test_your_source.py:

Step 7: Test End-to-End

Verify the alert appears in GET /v1/alerts with the correct normalized fields.

Indicator Types

Supported indicator types for extraction:

Contributing

Community-contributed source plugins are welcome. See Community Integrations for the contribution process.