Deploys anomaly detection for OT/ICS environments using machine learning on OT network baselines, physics-based process models, and Modbus/DNP3/OPC UA traffic analysis to flag deviations, rogue devices, and mismatches against historian data. Use for continuous OT monitoring, baselining deterministic SCADA polling, or investigating alerts from Nozomi Guardian/Dragos needing deeper protocol analysis.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Deploys anomaly detection for OT/ICS environments using machine learning on OT network baselines, physics-based process models, and Modbus/DNP3/OPC UA traffic analysis to flag deviations, rogue devices, and mismatches against historian data. Use for continuous OT monitoring, baselining deterministic SCADA polling, or investigating alerts from Nozomi Guardian/Dragos needing deeper protocol analysis.
When deploying continuous monitoring for OT environments that lack intrusion detection
When building behavior-based detection to complement signature-based IDS in OT networks
When establishing baselines for deterministic SCADA communications to detect deviations
When integrating machine learning anomaly detection with OT security monitoring platforms
When investigating alerts from Nozomi Guardian or Dragos Platform that require deeper analysis
Do not use for signature-based detection of known exploits (see detecting-attacks-on-scada-systems), for IT network anomaly detection without OT protocols, or as a replacement for process safety systems (SIS).
Prerequisites
Passive network monitoring sensors on OT network SPAN/TAP ports
Minimum 2-4 weeks of baseline traffic capture during normal operations
Python 3.9+ with scikit-learn, numpy, pandas for ML model training
Process historian access for physical process correlation data
Understanding of normal operational patterns including shift changes, batch processes, and maintenance windows
Workflow
Step 1: Build Multi-Dimensional Baseline Model
Capture and model the deterministic behavior of ICS communications across multiple dimensions: timing, protocol behavior, and network topology.
"Check for network congestion, device malfunction, or MITM attack"
return
None
def
detect_function_code_anomaly
self, src_ip, dst_ip, port, func_code
"""Detect unauthorized Modbus/DNP3 function codes."""
f"{src_ip}->{dst_ip}:{port}"
self
if
and
not
in
"critical"
if
in
5
6
15
16
8
else
"high"
return
"type"
"UNAUTHORIZED_FUNCTION_CODE"
"severity"
"detail"
f"Function code {func_code} from {src_ip} to {dst_ip}:{port} "
f"not in baseline. Allowed: {list(profile.function_codes.keys())}"
"recommendation"
"Investigate source - possible command injection attack"
return
None
def
analyze_flow
self, flow
"""Analyze a single network flow against all detection models."""
# Topology check
self
"src"
"dst"
"port"
if
# Timing check
if
"interval_ms"
in
self
"src"
"dst"
"port"
"interval_ms"
if
# Function code check
if
"function_code"
in
self
"src"
"dst"
"port"
"function_code"
if
self
return
def
generate_report
self
"""Generate anomaly detection report."""
print
f"\n{'='*60}"
print
f"ICS ANOMALY DETECTION REPORT"
print
f"{'='*60}"
print
f"Baseline Profiles: {len(self.profiles)}"
print
f"Anomalies Detected: {len(self.anomalies)}"
int
for
in
self
"severity"
1
for
in
"critical"
"high"
"medium"
"low"
if
print
f" {sev.upper()}: {severity_counts[sev]}"
for
in
self
20
print
f"\n [{a['severity'].upper()}] {a['type']}"
print
f" {a['detail']}"
if
"__main__"
print
"ICS Anomaly Detection System"
print
"Load baseline data and call analyze_flow() for real-time detection"
Key Concepts
Term
Definition
Deterministic Traffic
ICS networks exhibit highly predictable communication patterns where the same master polls the same slaves at fixed intervals with identical function codes
Isolation Forest
Unsupervised machine learning algorithm that isolates anomalies by randomly partitioning feature space, effective for OT traffic with low anomaly rates
Polling Interval
Time between consecutive SCADA master requests to a slave device, typically fixed and configurable (100ms to 10s)
Function Code Allowlist
Set of permitted industrial protocol operations for each communication pair, enforced by anomaly detection rules
Topology Baseline
Complete map of all authorized device-to-device communication paths in the OT network
Physics-Based Detection
Using physical process models (thermodynamics, fluid dynamics) to detect attacks that manipulate the process while spoofing sensor data
Tools & Systems
Nozomi Networks Guardian: OT anomaly detection with AI-powered baseline learning and industrial protocol analysis
Dragos Platform: Threat detection using behavioral analytics and threat intelligence specific to ICS environments
Scikit-learn: Python ML library with Isolation Forest, One-Class SVM, and Local Outlier Factor for anomaly detection
Zeek with OT plugins: Network security monitor with Modbus, DNP3, and BACnet protocol analyzers for baseline building