๐ Overview
โก Automated Response System
The Reactions feature is Jibril's powerful automation system that enables immediate, programmable responses to security detection events. When a security event is detected, reactions can automatically execute custom code to respond, remediate, or gather additional intelligence.
Reactions transform Jibril from a passive monitoring tool into an active security defense system. Instead of merely alerting on suspicious activities, reactions can take immediate action:
๐ซ Block malicious network traffic in real-time
๐ช Terminate suspicious processes before they cause harm
๐ Collect forensic evidence automatically
๐๏ธ Isolate compromised systems from the network
๐จ Trigger emergency procedures during critical incidents
โ๏ธ How Reactions Workโ
When Jibril detects a security event through its monitoring mechanisms (file access, process execution, network activity, etc.), the following workflow occurs:
- ๐ A Security Threat is Detected
An event from the OS matches a configured detection recipe - ๐ Event Detection
Security event is reported in all configured and enabled printers - โก Reaction Trigger
All reactions associated with that recipe are triggered in parallel - ๐ฅ Context Injection
The complete event context (process ancestry, network flows, file details, etc.) is made available to the reaction - โถ๏ธ Code Execution
The reaction code executes in an isolated environment with access to powerful helper functions - ๐ฏ Response Actions
The reaction can take various actions like blocking IPs, killing processes, or logging additional information
๐ง Supported Formatsโ
JavaScript (Recommended)โ
- Runtime: Google V8 JavaScript engine with isolated contexts
- Performance: Fast compilation and execution
- Features: Rich set of built-in helper functions
- Isolation: Each reaction runs in its own secure context
- Data Access: Full access to event data through JSON objects
Shell Scriptsโ
- Runtime: Standard
/bin/shshell execution - Flexibility: Full system access with shell commands
- Environment: Event data provided as
JSONviaREACTION_DATAenvironment variable - Security: Executed in temporary directories with restricted permissions
๐ฏ Key Capabilitiesโ
๐ Logging & Monitoringโ
Info("Detected suspicious file access");
Warn("High risk network connection identified");
Error("Critical security violation detected");
๐ Network Policy Enforcementโ
// Block malicious IPs automatically
NetBlockIp("192.168.1.100");
// Block domains associated with threats
NetBlockDomain("malicious-site.com");
// Block all remote IPs from the current event
NetBlockIp(); // Uses event context
๐ช Process Managementโ
// Terminate the offending process
KillCurrent();
// Stop the parent process if compromised
KillParent();
// Kill specific process by PID
KillProcess(1234);
๐ File System Operationsโ
// Read configuration files
let config = ReadFile("/etc/app/config.json");
// Write forensic evidence
WriteFile("/var/log/security/incident.log", evidenceData);
// Get file metadata
let fileInfo = Stat("/suspicious/file");
๐พ Persistent Data Storageโ
// Store incident data across reactions
DataSet("incident_count", "5");
DataPush("blocked_ips", "192.168.1.100");
// Retrieve historical data
let count = DataGet("incident_count");
let blockedIps = DataKeys(); // Get all stored keys
๐จ Emergency Actionsโ
// System shutdown in critical situations
PowerOff();
// Trigger kernel panic for immediate halt
Panic();
๐ Event Contextโ
Every reaction receives comprehensive context about the security event that triggered it.
Global Variablesโ
kind- The type of detection event (e.g., "file_access", "execution")name- The name of the detection recipe that triggereduuid- Unique identifier for this specific eventdata- Complete JSON object containing all event details
Event Data Structureโ
{
"uuid": "event-unique-identifier",
"timestamp": "2025-07-23T10:30:00Z",
"metadata": {
"kind": "file_access",
"name": "suspicious_file_access",
"importance": "high",
"tactic": "name_of_tactic",
"technique": "name_of_technique"
"subtechnique": "name_of_sub_technique"
},
"base": {
"background": {
"ancestry": [...], // Process chain
"flows": {...} // Network connections
}
},
"file": {
"file": "/etc/passwd",
"actions": ["read", "write"],
"basename": "passwd"
}
}
๐ Integration with Detection Recipesโ
Reactions are defined within detection recipes using YAML configuration (Alchemies):
- kind: malicious_file_access
name: detect_passwd_tampering
# ... detection criteria ...
reactions:
- format: js
code: |
function process(data) {
Info("Password file accessed by: " + data.process.cmd);
// Block the process
let result = KillCurrent();
if (result === 0) {
Info("Malicious process terminated");
}
// Log to incident database
DataSet("last_passwd_access", new Date().toISOString());
}