Notification System
Relevant source files
The following files were used as context for generating this wiki page:
The Notification System in Horizon is an event-driven framework designed to provide real-time alerts and updates regarding IT infrastructure changes, security vulnerabilities, and system status. It serves as a critical communication bridge between the Horizon CMDB core and external stakeholders or systems, ensuring that significant events are captured and delivered through various channels.
The system is designed for high reliability and scalability, utilizing an asynchronous delivery engine with retry logic and intelligent grouping to prevent alert fatigue. It supports multiple delivery methods, including email, webhooks, and integrations with collaboration platforms like Slack and Microsoft Teams.
Sources: README.md:103-109, IMPLEMENTATION_PLAN.md:465-470
Architecture and Delivery Flow
The notification architecture follows a pipeline starting from an event trigger and ending at the delivery channel. Events within the CMDB, such as asset creation or vulnerability detection, serve as inputs to the trigger engine.
This diagram illustrates the high-level flow from event detection to final delivery across various channels.
Sources: IMPLEMENTATION_PLAN.md:465-495
Delivery Engine Logic
The delivery engine is responsible for processing the notification queue and ensuring message delivery. It incorporates:
- Retry Logic: Implements exponential backoff for failed delivery attempts.
- Escalation Workflows: Automated procedures to route notifications to higher-tier recipients if initial alerts are unacknowledged.
- Aggregation: Intelligent grouping of similar notifications to reduce alert volume.
Sources: README.md:107-109, IMPLEMENTATION_PLAN.md:488-493
Components and Data Models
The system is built upon a structured database schema that defines how notifications are generated, stored, and sent.
Database Entities
The Notification System relies on the following core entities:
| Entity | Description |
|---|---|
notification_templates | Stores reusable message formats with placeholders for dynamic data. |
notification_triggers | Defines the conditions and events that initiate a notification. |
notification_subscriptions | Maps users or teams to specific notification types and channels. |
webhook_endpoints | Stores configuration for external HTTP callbacks, including security signatures. |
notification_log | Provides a complete audit trail of all sent and failed notifications. |
notification_aggregates | Manages the grouping of multiple events into a single notification. |
Sources: IMPLEMENTATION_PLAN.md:466-471
Event Triggers
Triggers are configured based on specific system events. Common event types identified in the implementation plan include:
asset_created: Triggered when a new asset is added to the CMDB.vulnerability_detected: High-priority trigger for security findings.- Condition-based filtering: Allows for fine-grained control over when a trigger fires.
Sources: IMPLEMENTATION_PLAN.md:474-477
Multi-Channel Delivery
Horizon supports a diverse set of delivery channels to ensure accessibility and integration with existing workflows.
Delivery Methods
The following integration methods are implemented:
- Email: Utilizes the
lettrecrate with support for SMTP transactions and TLS. - Webhooks: Delivers JSON payloads to external URLs with security provided by HMAC-BLAKE3 signatures to ensure authenticity.
- Collaboration Tools: Native integrations for Slack and Microsoft Teams.
- Push Notifications: Support for mobile or browser-based alerts.
Sources: Cargo.toml:57-58, IMPLEMENTATION_PLAN.md:481-486, IMPLEMENTATION_PLAN.md:417
Security and Verification
For external integrations like webhooks, the system employs high-standard cryptographic practices.
This sequence shows the secure delivery of a webhook notification using HMAC signatures for verification.
Sources: IMPLEMENTATION_PLAN.md:417, IMPLEMENTATION_PLAN.md:482
API and Response Structure
The Notification System API follows the project's standard ApiResponse format. This ensures that UI components, such as the Notification Dashboard, receive consistent data regarding delivery status and history.
Response Format Example
{
"status": "success",
"data": {
"notification_id": "cuid_123",
"status": "delivered",
"channel": "email",
"sent_at": "2026-01-30T12:00:00Z"
},
"meta": {
"request_id": "req-456"
}
}
Sources: crates/error/src/response.rs:88-124
Summary
The Notification System is an essential component of the Horizon platform, providing automated, secure, and multi-channel alerting. By leveraging event-based triggers, a robust delivery engine with retry capabilities, and secure webhook signatures, it ensures that IT administrators and security teams remain informed of critical infrastructure changes and threats. Its integration into the broader CMDB ecosystem allows for sophisticated workflows, ranging from simple email alerts to complex business impact escalations.