Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces major enhancements to the backend database schema, primarily focused on adding comprehensive Security Incident & Event Management (SIEM) capabilities, team invitation and role management, and Sigma rule enablement. It also updates package dependencies and configuration utilities. The most important changes are grouped below:
SIEM & Incident Management Infrastructure:
detection_events(as a TimescaleDB hypertable for time-series analytics),incidents(main incident tracking),incident_alerts(linking incidents to alerts),incident_comments(collaboration), andincident_history(audit trail). Includes indexes, triggers for audit and timestamping, MITRE ATT&CK support, and enrichment fields for IP reputation and GeoIP. [1] [2] [3]types.tsto reflect the new SIEM-related tables and their fields, including enums for severity and status. [1] [2]Team Invitation & Role Management:
organization_invitationstable for inviting team members via email with role assignment and token-based acceptance, plus supporting indexes and a cleanup function. Also adds a role index fororganization_membersand updates the type definition to use a strict role enum. [1] [2]organization_membersandorganization_invitationstypes to use explicit role enums ('owner' | 'admin' | 'member').Sigma Rule Management:
enabledboolean field to thesigma_rulestable (and type definition) to allow enabling/disabling rules, with a supporting index for filtering. [1] [2]Incident History User Context Fix:
incident_historytable to make theuser_idcolumn nullable, ensuring audit triggers work even when user context is unavailable.Dependency and Utility Updates:
@maxmind/geoip2-nodeandmaxmindpackages for GeoIP enrichment. [1] [2]isSmtpConfigured()utility function for checking SMTP configuration.These changes lay the groundwork for advanced security analytics, incident response, and team management features in the backend.
refs: #5