Zum Inhalt springen
Prototyp pruefen

Event Pipeline

This specification defines the event pipeline: event lifecycle (creation → enrichment → persistence → delivery → archival), immutability guarantees, delivery semantics, and schema contracts.

Audience: Backend engineers, integration architects.


In-ScopeOut-of-Scope
Event lifecycle and state machineDetection logic and scoring
Schema contracts (Event, Threat, Device, Policy, Alert)Policy evaluation rules
Delivery guarantees (API, webhooks)Cloud Enrichment processing
Retention and redactionGUI/dashboard implementation

StageDescriptionStorage
CreatedPolicy Engine emits action decision with full contextIn-memory
EnrichedMetadata added: agent version, model version, platform, tenant IDIn-memory
PersistedWritten to local Event Store. AES-256 encrypted. Append-only, cryptographically chained.Device (encrypted)
DeliveredPushed via webhook (HMAC-SHA256 signed) or pulled via REST API (cursor-based)Cloud relay (transient)
ArchivedLocal retention expired. Cloud copy retained per retention policy.Cloud (EU — Frankfurt)
DeletedHard removal after retention period. Irreversible.None

  • Append-only: Events cannot be modified after creation
  • Cryptographic chaining: Each event contains a hash of the previous event, forming a tamper-evident chain
  • No updates: Corrections are recorded as new events with a reference to the original event ID
  • Encryption at rest: AES-256. Keys stored in secure enclave (iOS) or keystore (Android)

Documented product target: SHA-256 event chaining with periodic integrity verification. The current workspace code does not yet implement cryptographic chaining.


Every detection decision is logged as an event — including Allow decisions. This ensures a complete audit trail.

DecisionRecorded?Delivered?
AllowYesVisible in the canonical GET /events feed; no derived alert created by current workspace logic
WarnYesVisible in GET /events; may create derived alerts/webhooks depending on integration path
BlockYesVisible in GET /events; creates derived alerts in current workspace logic

FieldTypeRequiredDescription
event_idstringYesFormat: evt_.... Globally unique.
timestampstring (ISO 8601)YesPolicy decision timestamp
device_idstringYesFormat: dev_.... Associated device.
threat_categoryenumYesphone_scam, social_engineering, malicious_app, phishing, remote_control, deepfake
confidencefloat (0.0–1.0)YesDetection confidence
action_takenenumYesallow, warn, block
policy_idstringYesFormat: pol_.... Applied policy.
severityenumYeslow, medium, high, critical
descriptionstringNoHuman-readable, redacted for external delivery
indicatorsarray[string]NoIOCs: SHA-256 hashes, signature IDs
metadataobjectNoSee Metadata object below
FieldTypeDescription
agent_versionstringDevice Agent version (target-state metadata; optional in current workspace)
model_versionstringML model version (target-state metadata; not emitted by current workspace prototype)
device_platformenumios, android, windows, macos, linux
tenant_idstringLegacy or target-state metadata copy; current workspace uses top-level tenant_id as the canonical authorization field
FieldTypeRequiredDescription
threat_idstringYesFormat: thr_...
threat_categoryenumYesCanonical threat category
confidencefloat (0.0–1.0)YesHighest confidence from related events
severityenumYeslow, medium, high, critical
device_idstringYesAssociated device
detected_atstring (ISO 8601)YesFirst detection timestamp
descriptionstringNoHuman-readable
indicatorsarray[string]NoIOCs
statusenumYesactive, resolved, dismissed
FieldTypeRequiredDescription
device_idstringYesFormat: dev_...
tenant_idstringYesTenant binding used for event authorization
platformenumYesios, android, windows, macos, linux
statusenumYesactive, revoked
public_key_b64stringYesBase64-encoded DER public key used for signature verification
agent_versionstringNoCurrent agent version
last_seenstring (ISO 8601)NoLast contact timestamp
namestringNoUser-assigned display name
FieldTypeRequiredDescription
policy_idstringYesFormat: pol_...
namestringYesDisplay name
threat_categoriesarray[enum]YesApplicable categories
actionenumYesallow, warn, block
confidence_thresholdfloatNoMinimum confidence to trigger
enabledbooleanYesActive/inactive
FieldTypeRequiredDescription
alert_idstringYesUnique ID
tenant_idstringYesTenant associated with the alert
device_idstringYesDevice associated with the alert
severityenumYeslow, medium, high, critical
titlestringYesHuman-readable alert title
event_idsarray[string]YesReferenced event IDs
statusenumYesCurrent workspace currently uses open

Workspace note: schema contracts are still under reconciliation with the current implementation and should not be treated as final API-version guarantees.


PropertyValue
SemanticsAt-least-once (duplicates possible)
OrderingNo ordering guarantee (use timestamp for sorting)
SigningHMAC-SHA256 (X-Superheld-Signature)
Replay protectionX-Superheld-Timestamp header; consumer should reject events > 5 min old
IdempotencyX-Superheld-Idempotency-Key header + event_id for deduplication
Retry policyCurrent workspace: 3 total attempts with exponential backoff (1s, 2s, 4s) for 429, 5xx, and transport failures
Dead Letter QueueFailed events queued for manual replay (dashboard, 7-day retention)

Current workspace behavior:

  • X-Superheld-Timestamp — Unix timestamp of webhook dispatch (use for replay protection instead of payload timestamp)
  • X-Superheld-Idempotency-Key — Unique key per delivery attempt (use alongside event_id for deduplication)
  • Webhook-Konfigurationen speichern pro Endpoint die zuletzt bekannte Delivery-Beobachtung (last_delivery_status, last_delivery_error, last_delivery_at, last_delivery_attempts) im In-Memory-Store

Current workspace note: code includes DLQ retention logic for 7 days, but no dashboard/manual replay surface is implemented in this workspace.

PropertyValue
MethodGET /events
PaginationCursor-based (cursor + limit parameters)
Filteringsince (ISO 8601 timestamp), severity, threat_category
ResponseJSON array with has_more and cursor fields

Data TypeLocationRetentionStatus
Detection events (local)DeviceTarget: 90 daysNot confirmed by current workspace
Detection events (cloud)CloudTarget: 180 daysNot confirmed by current workspace
Audit logsCloudTarget: 12 monthsNot confirmed by current workspace
Aggregated metricsCloudTarget: 24 months (then anonymized)Not confirmed by current workspace

Deletion: Irreversible. Can be requested early via dashboard or API. Account deletion triggers full data removal within 30 days, backup overwrite within 90 days.


Data TypeRedaction Method
PII (email, name, phone)Replaced with placeholder
Message contentNot included in telemetry
URLsTransmitted as SHA-256 hashes (full URL stays local)
IP addressesTruncated to /24 (IPv4) or /48 (IPv6)

Applies to cloud transmission and external delivery only. Local Event Store retains full unredacted data (AES-256 encrypted).


FailureImpactMitigation
Event Store fullCannot persist new eventsRing buffer: oldest events overwritten. High-severity events prioritized.
Webhook endpoint unreachableEvents not deliveredCurrent workspace retries with exponential backoff and moves failed deliveries to DLQ after 3 total attempts.
API unavailableIntegrators cannot pollCurrent workspace has no durable cloud event queue; recovery semantics remain a target-state concern.
Encryption key unavailableCannot read/write Event StoreAgent enters safe mode. New events buffered in memory until key available.
Chain integrity violationTamper detectedAgent logs integrity error. Affected events flagged. Re-chaining from last verified event.