Skip to content

Security Monitoring ​

Real-time threat detection — process auditing, C2 beaconing analysis, auth monitoring, DNS/DGA detection, and file integrity watching.

DeepSight's detection engine runs five background collectors that continuously analyze system activity for signs of compromise. Alerts are scored by severity, tagged with MITRE ATT&CK mappings, and surfaced in the Security dashboard view.

Process Execution Auditing ​

The process audit collector polls /proc every 5 seconds to detect:

PatternSeverityMITREDescription
Reverse shellCriticalT1059bash -i >& /dev/tcp/..., Python socket one-liners, netcat listeners
Hidden cmdlineHighT1564Process with no visible command line — stealth malware
Process from /tmpHighT1204Executables running from world-writable directories
Web server spawnCriticalT1505Apache/nginx/httpd spawning bash/sh — webshell execution
Python one-linerHighT1059python -c with socket/pty imports
Perl/Ruby shellHighT1059Perl/Ruby one-liners with socket operations

Process Audit Limitations

The collector runs without root privileges. It can detect process metadata but cannot intercept syscalls. For kernel-level auditing, deploy auditd alongside DeepSight.

C2 Beaconing Detection ​

Every 30 seconds, the beaconing collector analyzes the last 3 minutes of outbound HTTP connections for periodic patterns — the signature of command-and-control traffic.

How it works:

  1. Monitors all ESTABLISHED TCP connections to external IPs (detected via ss -tnp)
  2. Groups connections by (process, remote IP, remote port)
  3. Calculates timing deltas between successive connections
  4. Flags patterns where variance < 5% across 5+ samples, interval 10s–3600s
  5. Confidence score = 1 − (variance / mean)

Example alert:

Confidence: 94% | Process: malware_implant (PID 12345)
Remote: 203.0.113.50:443 | Interval: 60.0s (±1.2s)

→ Alert: HIGH, MITRE T1071 (Application Layer Protocol: Web Protocols)

Auth Monitoring ​

Parses /var/log/auth.log every 5 seconds for security-relevant events:

EventThresholdAlert
SSH failure>5 from same IP in 10sCritical — Brute Force (T1110)
SSH successAnyLogged (not alerted)
sudo executionAnyLogged for audit trail
su to rootAnyLogged
useradd/groupaddAnyHigh — Account Creation (T1136)

Auth events appear in the Security dashboard with colored indicators: red for failures, green for successes, yellow for privilege escalation.

DNS / DGA Detection ​

Monitors DNS resolution activity every 30 seconds (via resolvectl statistics and /var/log/syslog). Calculates Shannon entropy on resolved domain names to detect Domain Generation Algorithms (DGA) used by malware.

ScoreMeaning
< 2.5Normal domain (e.g., github.com)
2.5–3.5Suspicious — long/random subdomain
3.5–3.8Highly suspicious — likely DGA
> 3.8Almost certainly DGA (e.g., xs8f2q9a.xyz)

Entropy Calculation

Shannon entropy measures randomness in the domain's character distribution. Legitimate domains have low entropy (repeated characters, common patterns). DGA domains have uniformly distributed characters — approaching the theoretical maximum of ~4.7 for lowercase alphanumeric.

File Integrity Monitoring ​

Watches critical system files for unauthorized modification using inotify (falls back to mtime polling if the kernel API is unavailable):

Watched paths:

  • /etc/passwd, /etc/shadow, /etc/sudoers
  • /root/.ssh/authorized_keys
  • /etc/crontab, /var/spool/cron/crontabs/
  • /tmp and /dev/shm (for new executable files)

Any modification triggers an alert within 2 seconds.

Requires inotify

File monitoring requires the inotify_simple Python package. Install with:

bash
pip install inotify_simple --break-system-packages

Without it, the collector gracefully degrades — other SIEM features continue working.

Alert Rules Reference ​

RuleCategorySeverityMITRE TacticMITRE TechniqueThreshold
SSH Brute Forcecredential_accessCriticalCredential AccessT1110 (Brute Force)>5 failures/10s
Reverse ShellexecutionCriticalExecutionT1059 (Command & Scripting)Any match
Web Server SpawnpersistenceCriticalPersistenceT1505 (Server Software)Any match
C2 Beaconingcommand_and_controlHighC2T1071 (App Layer Protocol)Confidence >0.7
Hidden CmdlineevasionHighDefense EvasionT1564 (Hide Artifacts)Any match
Process from /tmpexecutionHighExecutionT1204 (User Execution)Any match
DGA Domaincommand_and_controlMediumC2T1568 (Dynamic Resolution)Entropy >3.8
Sudoers Changeprivilege_escalationCriticalPriv EscalationT1548 (Abuse Elevation)Any modification
Authorized Keys ChangepersistenceCriticalPersistenceT1098 (Account Manipulation)Any modification
New User CreationpersistenceHighPersistenceT1136 (Create Account)Any match

Alerts are deduplicated — the same (category, source, title) won't re-alert within 5 minutes.

Viewing Alerts ​

Click the 🛡️ Security tab in the dashboard to see:

  • Alert summary cards (critical/high/medium/low counts)
  • Active alerts list with MITRE ATT&CK tags
  • C2 beaconing detections with confidence scores
  • Auth event timeline
  • File integrity events

Acknowledge alerts by clicking the Acknowledge button — they fade out and are excluded from the active count.

Built with VitePress · DeepSight System Dashboard