|
| 1 | +# ThemisDB Audit Logging & SIEM Integration Configuration |
| 2 | +# Version: 1.5.0 |
| 3 | +# Last Updated: 2026-02-10 |
| 4 | +# |
| 5 | +# This configuration file controls audit logging and SIEM (Security Information |
| 6 | +# and Event Management) integration for ThemisDB, with specific support for |
| 7 | +# TaskScheduler trigger and cron events. |
| 8 | +# |
| 9 | +# SECURITY NOTE: Only authorized administrators should modify this file. |
| 10 | +# Changes to SIEM configuration require proper authorization and audit trail. |
| 11 | +# Complies with GDPR Article 32 and ISO 27001 requirements. |
| 12 | + |
| 13 | +# ============================================================================ |
| 14 | +# Core Audit Logging Settings |
| 15 | +# ============================================================================ |
| 16 | + |
| 17 | +audit_logging: |
| 18 | + # Enable/disable audit logging globally |
| 19 | + enabled: true |
| 20 | + |
| 21 | + # Encrypt-then-sign: Encrypt audit entries and sign for tamper-proofing |
| 22 | + encrypt_then_sign: true |
| 23 | + |
| 24 | + # Log file path (JSON Lines format) |
| 25 | + log_path: "data/logs/audit.jsonl" |
| 26 | + |
| 27 | + # Encryption key ID for audit log encryption |
| 28 | + key_id: "saga_log" |
| 29 | + |
| 30 | + # Hash chain for tamper-proofing (detect modifications) |
| 31 | + enable_hash_chain: true |
| 32 | + chain_state_file: "data/logs/audit_chain.json" |
| 33 | + |
| 34 | +# ============================================================================ |
| 35 | +# SIEM Integration Settings |
| 36 | +# ============================================================================ |
| 37 | + |
| 38 | +siem_integration: |
| 39 | + # Enable SIEM forwarding |
| 40 | + enable_siem: false |
| 41 | + |
| 42 | + # SIEM type: "syslog", "splunk", or "elastic" |
| 43 | + # - syslog: Compatible with syslog-ng, rsyslog, and standard syslog daemons |
| 44 | + # - splunk: Splunk HTTP Event Collector (HEC) |
| 45 | + # - elastic: Elasticsearch direct indexing |
| 46 | + siem_type: "syslog" |
| 47 | + |
| 48 | + # SIEM message format: "json", "cef", or "syslog" |
| 49 | + # - json: Native JSON format (best for Splunk, Elastic) |
| 50 | + # - cef: Common Event Format (industry standard, works with most SIEMs) |
| 51 | + # - syslog: RFC 5424 syslog format (best for traditional syslog systems) |
| 52 | + siem_format: "json" |
| 53 | + |
| 54 | + # SIEM server connection settings |
| 55 | + siem_host: "localhost" |
| 56 | + siem_port: 514 # Default ports: syslog=514, Splunk HEC=8088, Elastic=9200 |
| 57 | + |
| 58 | + # Splunk-specific settings (only used when siem_type="splunk") |
| 59 | + splunk: |
| 60 | + # HTTP Event Collector (HEC) token |
| 61 | + hec_token: "" |
| 62 | + # HEC endpoint URL (e.g., "https://splunk.example.com:8088/services/collector/event") |
| 63 | + hec_url: "" |
| 64 | + # Verify SSL certificate |
| 65 | + verify_ssl: true |
| 66 | + |
| 67 | + # Elasticsearch-specific settings (only used when siem_type="elastic") |
| 68 | + elasticsearch: |
| 69 | + # Index name for audit logs |
| 70 | + index: "themisdb-audit" |
| 71 | + # Index rotation pattern: "daily", "weekly", "monthly" |
| 72 | + index_rotation: "daily" |
| 73 | + # Authentication |
| 74 | + username: "" |
| 75 | + password: "" |
| 76 | + # API key (alternative to username/password) |
| 77 | + api_key: "" |
| 78 | + |
| 79 | +# ============================================================================ |
| 80 | +# Task Scheduler Audit Settings |
| 81 | +# ============================================================================ |
| 82 | + |
| 83 | +task_scheduler_audit: |
| 84 | + # Enable audit logging for task scheduler events |
| 85 | + enabled: true |
| 86 | + |
| 87 | + # Log all task registrations |
| 88 | + log_task_registration: true |
| 89 | + |
| 90 | + # Log all task executions (both success and failure) |
| 91 | + log_task_execution: true |
| 92 | + |
| 93 | + # Log cron trigger activations |
| 94 | + log_cron_triggers: true |
| 95 | + |
| 96 | + # Log CDC event trigger activations |
| 97 | + log_cdc_triggers: true |
| 98 | + |
| 99 | + # Log manual task executions |
| 100 | + log_manual_executions: true |
| 101 | + |
| 102 | + # Include resource consumption metrics in audit logs |
| 103 | + # (execution time, memory usage, CPU usage) |
| 104 | + include_resource_metrics: true |
| 105 | + |
| 106 | + # Fields included in task scheduler audit events: |
| 107 | + # - timestamp: ISO 8601 timestamp |
| 108 | + # - event_type: Type of event (TASK_REGISTERED, TASK_EXECUTED_SUCCESS, etc.) |
| 109 | + # - task_id: Unique task identifier |
| 110 | + # - task_name: Human-readable task name |
| 111 | + # - user_id: User or service account that triggered the event |
| 112 | + # - source_ip: Source IP address (if available) |
| 113 | + # - trigger_type: CRON, CDC_EVENT, MANUAL, etc. |
| 114 | + # - cron_expression: Cron expression (for cron triggers) |
| 115 | + # - execution_time_ms: Task execution time in milliseconds |
| 116 | + # - success: Boolean indicating success or failure |
| 117 | + # - error_message: Error message (on failure) |
| 118 | + # - resource_usage: Resource consumption metrics |
| 119 | + # - anomaly_score: Anomaly detection score (0.0 = normal, >2.0 = anomalous) |
| 120 | + |
| 121 | +# ============================================================================ |
| 122 | +# Anomaly Detection Settings |
| 123 | +# ============================================================================ |
| 124 | + |
| 125 | +anomaly_detection: |
| 126 | + # Enable anomaly detection for task scheduler events |
| 127 | + enabled: true |
| 128 | + |
| 129 | + # Anomaly detection threshold (standard deviations from baseline) |
| 130 | + # Values > threshold are considered anomalous |
| 131 | + # Recommended: 2.0 (95% confidence) or 3.0 (99.7% confidence) |
| 132 | + threshold: 2.0 |
| 133 | + |
| 134 | + # Minimum number of executions before anomaly detection is active |
| 135 | + # Need baseline data before detecting anomalies |
| 136 | + min_baseline_samples: 10 |
| 137 | + |
| 138 | + # Anomaly detection dimensions |
| 139 | + dimensions: |
| 140 | + # Detect tasks running longer than expected |
| 141 | + execution_time: true |
| 142 | + |
| 143 | + # Detect tasks running more/less frequently than expected |
| 144 | + execution_frequency: true |
| 145 | + |
| 146 | + # Detect tasks running at unusual times |
| 147 | + execution_timing: true |
| 148 | + |
| 149 | + # Detect tasks consuming excessive resources |
| 150 | + resource_usage: true |
| 151 | + |
| 152 | + # Actions on anomaly detection |
| 153 | + actions: |
| 154 | + # Log anomaly event (SecurityEventType::TASK_ANOMALY_DETECTED) |
| 155 | + log_event: true |
| 156 | + |
| 157 | + # Disable task automatically if anomaly detected |
| 158 | + auto_disable_task: false |
| 159 | + |
| 160 | + # Send high-priority SIEM alert |
| 161 | + send_siem_alert: true |
| 162 | + |
| 163 | +# ============================================================================ |
| 164 | +# Compliance Settings |
| 165 | +# ============================================================================ |
| 166 | + |
| 167 | +compliance: |
| 168 | + # GDPR compliance settings |
| 169 | + gdpr: |
| 170 | + # Enable GDPR compliance mode |
| 171 | + enabled: true |
| 172 | + |
| 173 | + # Pseudonymize user identifiers in audit logs |
| 174 | + pseudonymize_users: false |
| 175 | + |
| 176 | + # Data retention period (days) - GDPR Article 5(1)(e) |
| 177 | + retention_days: 365 |
| 178 | + |
| 179 | + # Automatically archive logs older than retention period |
| 180 | + auto_archive: true |
| 181 | + archive_path: "data/logs/archive/audit-{year}-{month}.jsonl.gz" |
| 182 | + |
| 183 | + # ISO 27001 compliance settings |
| 184 | + iso27001: |
| 185 | + # Enable ISO 27001 compliance mode |
| 186 | + enabled: true |
| 187 | + |
| 188 | + # Log access controls and authorization decisions |
| 189 | + log_access_controls: true |
| 190 | + |
| 191 | + # Require cryptographic protection of audit logs |
| 192 | + require_encryption: true |
| 193 | + |
| 194 | + # Require tamper-evident audit logs (hash chain) |
| 195 | + require_tamper_evidence: true |
| 196 | + |
| 197 | +# ============================================================================ |
| 198 | +# Authorization & Access Control |
| 199 | +# ============================================================================ |
| 200 | + |
| 201 | +authorization: |
| 202 | + # Roles allowed to modify SIEM configuration |
| 203 | + # Only users with these roles can change audit/SIEM settings |
| 204 | + siem_config_roles: |
| 205 | + - "system_admin" |
| 206 | + - "security_admin" |
| 207 | + |
| 208 | + # Roles allowed to view audit logs |
| 209 | + audit_view_roles: |
| 210 | + - "system_admin" |
| 211 | + - "security_admin" |
| 212 | + - "compliance_officer" |
| 213 | + - "auditor" |
| 214 | + |
| 215 | + # Roles allowed to export audit logs |
| 216 | + audit_export_roles: |
| 217 | + - "system_admin" |
| 218 | + - "security_admin" |
| 219 | + - "compliance_officer" |
| 220 | + |
| 221 | + # Require MFA for sensitive audit operations |
| 222 | + require_mfa: |
| 223 | + siem_config_changes: true |
| 224 | + audit_log_export: true |
| 225 | + audit_log_deletion: true |
| 226 | + |
| 227 | +# ============================================================================ |
| 228 | +# Example SIEM Integration Scenarios |
| 229 | +# ============================================================================ |
| 230 | + |
| 231 | +# Example 1: Splunk Integration |
| 232 | +# ------------------------------ |
| 233 | +# siem_integration: |
| 234 | +# enable_siem: true |
| 235 | +# siem_type: "splunk" |
| 236 | +# siem_format: "json" |
| 237 | +# splunk: |
| 238 | +# hec_token: "your-splunk-hec-token" |
| 239 | +# hec_url: "https://splunk.example.com:8088/services/collector/event" |
| 240 | +# verify_ssl: true |
| 241 | + |
| 242 | +# Example 2: Syslog-ng Integration with CEF Format |
| 243 | +# ------------------------------------------------- |
| 244 | +# siem_integration: |
| 245 | +# enable_siem: true |
| 246 | +# siem_type: "syslog" |
| 247 | +# siem_format: "cef" |
| 248 | +# siem_host: "syslog.example.com" |
| 249 | +# siem_port: 514 |
| 250 | + |
| 251 | +# Example 3: Elasticsearch/ELK Stack Integration |
| 252 | +# ----------------------------------------------- |
| 253 | +# siem_integration: |
| 254 | +# enable_siem: true |
| 255 | +# siem_type: "elastic" |
| 256 | +# siem_format: "json" |
| 257 | +# siem_host: "elasticsearch.example.com" |
| 258 | +# siem_port: 9200 |
| 259 | +# elasticsearch: |
| 260 | +# index: "themisdb-audit" |
| 261 | +# index_rotation: "daily" |
| 262 | +# username: "themisdb" |
| 263 | +# password: "your-password" |
| 264 | + |
| 265 | +# ============================================================================ |
| 266 | +# Performance & Operational Settings |
| 267 | +# ============================================================================ |
| 268 | + |
| 269 | +operational: |
| 270 | + # Buffer size for batch audit logging (entries) |
| 271 | + buffer_size: 100 |
| 272 | + |
| 273 | + # Flush interval (seconds) - write buffered logs to disk |
| 274 | + flush_interval: 10 |
| 275 | + |
| 276 | + # Maximum log file size (MB) before rotation |
| 277 | + max_log_file_size_mb: 100 |
| 278 | + |
| 279 | + # Number of rotated log files to keep |
| 280 | + max_rotated_files: 10 |
| 281 | + |
| 282 | + # Async SIEM forwarding (don't block on SIEM failures) |
| 283 | + async_siem_forwarding: true |
| 284 | + |
| 285 | + # Retry failed SIEM forwards |
| 286 | + retry_siem_failures: true |
| 287 | + max_retry_attempts: 3 |
| 288 | + retry_delay_seconds: 30 |
0 commit comments