Skip to main content
implementing-network-segmentation-for-ot Implements OT network segmentation using VLANs, OT-aware firewalls, data diodes, and IEC 62443 zone/conduit architecture, with a traffic-baseline-driven design tool for migrating flat Purdue-model networks without disrupting operations. Use when segmenting a flat OT network into Purdue levels, deploying an IT/OT DMZ, or isolating safety instrumented systems from basic process control systems.
Aller à l'installation Skills Marketplace Découvrez et explorez les compétences IA créées par la communauté.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Copier le promptAfficher les détails du prompt Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills --skill implementing-network-segmentation-for-otLa commande reste sur une seule ligne. Faites défiler horizontalement pour la vérifier avant de la copier.
Vous préférez une copie locale ? Téléchargez les fichiers actuellement disponibles dans SkillsMP.
Télécharger Zip Téléchargement... Plus depuis ce dépôt abusing-dpapi-for-credential-access Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket's dpapi.py, including domain-wide decryption via the DPAPI backup key. Use during authorized red-team credential-access engagements after gaining a foothold or when triaging DPAPI blobs pulled from a host.
abusing-shadow-credentials-for-privesc Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target's NT hash without a password reset. Use when BloodHound shows GenericWrite/GenericAll/AddKeyCredentialLink over a target, as a stealthier alternative to ForceChangePassword, during authorized red-team engagements.
acquiring-disk-image-with-dd-and-dcfldd Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.
Explorateur de fichiers
4 fichiers Métiers associés SOC
Basé sur la classification professionnelle SOC
name implementing-network-segmentation-for-ot description Implements OT network segmentation using VLANs, OT-aware firewalls, data diodes, and IEC 62443 zone/conduit architecture, with a traffic-baseline-driven design tool for migrating flat Purdue-model networks without disrupting operations. Use when segmenting a flat OT network into Purdue levels, deploying an IT/OT DMZ, or isolating safety instrumented systems from basic process control systems.
domain cybersecurity subdomain ot-ics-security tags ["ot-security","ics","scada","industrial-control","iec62443","network-segmentation","vlan"] version 1.0.0 author mahipal license Apache-2.0 nist_csf ["PR.IR-01","DE.CM-01","ID.AM-05","GV.OC-02"] mitre_attack ["T1078","T1190","T1059","T0816","T0836"]
Implementing Network Segmentation for OT
When to Use
When an OT security assessment reveals a flat network with no segmentation between Purdue levels
When implementing IEC 62443 zone/conduit architecture after completing risk assessment (IEC 62443-3-2)
When separating IT and OT networks as part of an IT/OT convergence security initiative
When deploying a DMZ between corporate IT and OT to protect industrial systems from IT-originating threats
When segmenting safety instrumented systems (SIS) from basic process control systems (BPCS)
Do not use for IT-only microsegmentation without OT components (see implementing-zero-trust-in-cloud), or for initial zone design without prior traffic analysis (see performing-ot-network-security-assessment first).
Prerequisites
Complete traffic baseline from passive monitoring (minimum 2-4 weeks of capture data)
Asset inventory with Purdue level classifications for all OT devices
Industrial-grade network switches with VLAN support and port security
OT-aware firewalls (Cisco ISA-3000, Fortinet FortiGate Rugged, Palo Alto with OT Security)
Maintenance window schedule for network changes
Rollback plan approved by operations management
Workflow
Step 1: Design Segmentation Architecture Based on Traffic Baseline
Use the traffic baseline to design VLAN and firewall architecture that preserves all legitimate communication paths while isolating zones.
"""OT Network Segmentation Design Tool.
Analyzes traffic baseline data and generates a segmentation design
with VLAN assignments, firewall rules, and migration plan.
"""
import json
import sys
from collections import defaultdict
from dataclasses import dataclass, field, asdict
from ipaddress import ip_address, ip_network
@dataclass
class VLANDesign :
vlan_id: int
name: str
purdue_level: str
subnet: str
gateway: str
description:
devices: = field(default_factory= )
:
rule_id:
source_zone:
source_ip:
dest_zone:
dest_ip:
protocol:
port:
action:
dpi_profile: =
comment: =
:
( ):
(baseline_file) f:
.baseline = json.load(f)
.vlans = []
.rules = []
.rule_counter =
( ):
.vlans = [
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
VLANDesign( , , ,
, ,
),
]
.vlans
( ):
.rules = []
zone_pairs = [
( , ),
( , ),
( , ),
( , ),
]
flow .baseline.get( , []):
.rules.append(FirewallRule(
rule_id= .rule_counter,
source_zone=flow[ ],
source_ip=flow[ ],
dest_zone=flow[ ],
dest_ip=flow[ ],
protocol=flow.get( , ),
port=flow.get( , ),
action= ,
dpi_profile= ._get_dpi_profile(flow.get( , )),
comment= ,
))
.rule_counter +=
src_zone, dst_zone zone_pairs:
.rules.append(FirewallRule(
rule_id= .rule_counter,
source_zone=src_zone,
source_ip= ,
dest_zone=dst_zone,
dest_ip= ,
protocol= ,
port= ,
action= ,
comment= ,
))
.rule_counter +=
.rules
( ):
dpi_profiles = {
: ,
: ,
: ,
: ,
: ,
}
dpi_profiles.get(port, )
( ):
plan = {
: {
: ,
: ,
: [
,
,
,
,
,
,
],
: ,
},
: {
: ,
: ,
: [
,
,
,
,
,
,
],
: ,
},
: {
: ,
: ,
: [
,
,
,
,
,
],
: ,
},
: {
: ,
: ,
: [
,
,
,
,
,
],
: ,
},
}
plan
( ):
design = {
: [asdict(v) v .vlans],
: [asdict(r) r .rules],
: .generate_migration_plan(),
}
(output_file, ) f:
json.dump(design, f, indent= )
( )
( )
( )
design
__name__ == :
(sys.argv) < :
( )
sys.exit( )
designer = SegmentationDesigner(sys.argv[ ])
designer.design_vlans()
designer.generate_firewall_rules_from_baseline()
output = sys.argv[ ] (sys.argv) >
designer.export_design(output)
str
list
list
@dataclass
class
FirewallRule
int
str
str
str
str
str
int
str
str
""
str
""
class
SegmentationDesigner
"""Generates segmentation design from traffic baseline."""
def
__init__
self, baseline_file
with
open
as
self
self
self
self
1
def
design_vlans
self
"""Create VLAN design based on Purdue levels."""
self
10
"SIS-SAFETY"
"Level 1 (Safety)"
"10.10.10.0/24"
"10.10.10.1"
"Safety Instrumented Systems - air-gapped or hardware-isolated"
20
"BPCS-FIELD"
"Level 0-1 (Field/Control)"
"10.10.20.0/24"
"10.10.20.1"
"PLCs, RTUs, I/O modules, field instruments"
30
"BPCS-SUPERVISORY"
"Level 2 (Supervisory)"
"10.10.30.0/24"
"10.10.30.1"
"HMIs, engineering workstations, local historian"
40
"SITE-OPS"
"Level 3 (Operations)"
"10.10.40.0/24"
"10.10.40.1"
"Site historian, OPC server, MES, alarm management"
50
"OT-DMZ"
"Level 3.5 (DMZ)"
"172.16.50.0/24"
"172.16.50.1"
"Data diode, historian mirror, jump server, patch server"
60
"ENTERPRISE"
"Level 4 (Enterprise)"
"10.0.60.0/24"
"10.0.60.1"
"Enterprise IT systems accessing OT data"
999
"QUARANTINE"
"Quarantine"
"10.10.99.0/24"
"10.10.99.1"
"Quarantine VLAN for unauthorized or untrusted devices"
return
self
def
generate_firewall_rules_from_baseline
self
"""Generate firewall rules based on observed legitimate traffic."""
self
"Level 2"
"Level 0-1"
"Level 3"
"Level 2"
"Level 3.5"
"Level 3"
"Level 4"
"Level 3.5"
for
in
self
"cross_zone_flows"
self
self
"src_level"
"src"
"dst_level"
"dst"
"protocol"
"TCP"
"port"
0
"ALLOW"
self
"port"
0
f"Baseline observed: {flow['src' ]} -> {flow['dst' ]} "
self
1
for
in
self
self
"any"
"any"
"any"
0
"DENY"
f"Default deny: {src_zone} -> {dst_zone} "
self
1
return
self
def
_get_dpi_profile
self, port
"""Return the appropriate DPI inspection profile for an OT protocol port."""
502
"modbus-inspect (allow read FC only from L3)"
44818
"enip-inspect"
4840
"opcua-inspect (require SignAndEncrypt)"
102
"s7comm-inspect"
20000
"dnp3-inspect"
return
"none"
def
generate_migration_plan
self
"""Generate phased migration plan for network segmentation."""
"phase_1"
"name"
"DMZ Implementation (Week 1-2)"
"description"
"Deploy DMZ between enterprise and OT networks"
"steps"
"Deploy DMZ firewall pair (inside and outside)"
"Migrate historian mirror to DMZ"
"Configure jump server in DMZ with MFA"
"Install data diode for unidirectional historian replication"
"Route enterprise-to-OT traffic through DMZ"
"Verify enterprise access to historian data via DMZ"
"rollback"
"Remove DMZ firewall rules, restore direct routing"
"phase_2"
"name"
"L3/L2 Segmentation (Week 3-4)"
"description"
"Separate operations (L3) from control (L2) zones"
"steps"
"Create VLAN 30 and VLAN 40 on OT switches"
"Deploy industrial firewall between L2 and L3"
"Configure firewall in monitor mode (log only, no blocking)"
"Analyze logs for 1 week to validate rule completeness"
"Switch to enforcement mode during maintenance window"
"Validate all HMI-to-PLC and historian-to-PLC communications"
"rollback"
"Revert VLAN assignments, set firewall to permit-any"
"phase_3"
"name"
"Field Device Isolation (Week 5-6)"
"description"
"Isolate Level 0-1 field devices from Level 2 supervisory"
"steps"
"Create VLAN 20 for PLCs and field instruments"
"Configure port security with MAC binding on PLC ports"
"Apply Modbus function code filtering (block writes from L3)"
"Test all control loops during maintenance window"
"Verify alarm propagation from field to HMI"
"rollback"
"Merge VLAN 20 back into VLAN 30"
"phase_4"
"name"
"SIS Isolation (Week 7-8)"
"description"
"Fully isolate Safety Instrumented Systems"
"steps"
"Verify SIS is on dedicated VLAN 10 or air-gapped"
"Remove any network path between SIS and BPCS"
"Implement dedicated engineering workstation for SIS"
"Apply USB and removable media controls on SIS EWS"
"Test SIS functionality in isolation"
"rollback"
"N/A - SIS isolation should not be reversed"
return
def
export_design
self, output_file
"""Export complete segmentation design."""
"vlans"
for
in
self
"firewall_rules"
for
in
self
"migration_plan"
self
with
open
"w"
as
2
print
f"[*] Segmentation design exported to: {output_file} "
print
f" VLANs: {len (self.vlans)} "
print
f" Firewall Rules: {len (self.rules)} "
return
if
"__main__"
if
len
2
print
"Usage: python segmentation_designer.py <baseline.json> [output.json]"
1
1
2
if
len
2
else
"segmentation_design.json"
Step 2: Configure Industrial Switch VLANs Apply VLAN configuration to industrial Ethernet switches with port security and unused port hardening.
vlan 10
name SIS-SAFETY-L1
vlan 20
name BPCS-FIELD-L01
vlan 30
name BPCS-SUPERVISORY-L2
vlan 40
name SITE-OPS-L3
vlan 50
name OT-DMZ-L35
vlan 999
name QUARANTINE
interface range GigabitEthernet1/0/1-12
description PLC Connections
switchport mode access
switchport access vlan 20
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address sticky
switchport port-security violation shutdown
storm-control broadcast level 10
storm-control multicast level 10
spanning-tree portfast
spanning-tree bpduguard enable
no cdp enable
no lldp transmit
no lldp receive
interface range GigabitEthernet1/0/13-18
description HMI Stations
switchport mode access
switchport access vlan 30
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address sticky
switchport port-security violation restrict
spanning-tree portfast
interface TenGigabitEthernet1/0/1
description Trunk to OT Zone Firewall
switchport mode trunk
switchport trunk allowed vlan 20,30,40,50
switchport trunk native vlan 999
switchport nonegotiate
interface range GigabitEthernet1/0/19-48
description UNUSED - Shutdown
switchport mode access
switchport access vlan 999
shutdown
Step 3: Validate Segmentation Effectiveness After implementation, validate that segmentation correctly blocks unauthorized cross-zone traffic while permitting all legitimate operations.
"""OT Network Segmentation Validator.
Runs automated tests to verify zone isolation, firewall rules,
and protocol enforcement after segmentation deployment.
"""
import json
import socket
import subprocess
import sys
import time
from dataclasses import dataclass, asdict
@dataclass
class ValidationTest :
test_id: str
description: str
source_zone: str
target_ip: str
target_port: int
expected_result: str
actual_result: str = ""
status: str = ""
class SegmentationValidator :
"""Validates OT network segmentation implementation."""
def __init__ (self ):
self .tests = []
self .results = []
def add_test (self, test ):
self .tests.append(test)
def run_connectivity_test (self, target_ip, target_port, timeout=3 ):
"""Test TCP connectivity to target."""
try :
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(timeout)
result = sock.connect_ex((target_ip, target_port))
sock.close()
return "reachable" if result == 0 else "blocked"
except (socket.timeout, ConnectionRefusedError):
return "blocked"
except Exception:
return "error"
def run_all_tests (self ):
"""Execute all segmentation validation tests."""
print ("=" * 60 )
print ("OT SEGMENTATION VALIDATION" )
print ("=" * 60 )
passed = 0
failed = 0
for test in self .tests:
actual = self .run_connectivity_test(test.target_ip, test.target_port)
test.actual_result = actual
if actual == test.expected_result:
test.status = "PASS"
passed += 1
else :
test.status = "FAIL"
failed += 1
icon = "[+]" if test.status == "PASS" else "[-]"
print (f" {icon} {test.test_id} : {test.description} " )
print (f" Target: {test.target_ip} :{test.target_port} " )
print (f" Expected: {test.expected_result} | Actual: {actual} -> {test.status} " )
print (f"\n Results: {passed} passed, {failed} failed out of {len (self.tests)} tests" )
return {"passed" : passed, "failed" : failed, "total" : len (self .tests)}
if __name__ == "__main__" :
validator = SegmentationValidator()
validator.add_test(ValidationTest(
"SEG-001" , "Enterprise cannot reach PLCs via Modbus" ,
"Level 4" , "10.10.20.10" , 502 , "blocked" ))
validator.add_test(ValidationTest(
"SEG-002" , "Enterprise cannot reach PLCs via EtherNet/IP" ,
"Level 4" , "10.10.20.10" , 44818 , "blocked" ))
validator.add_test(ValidationTest(
"SEG-003" , "Enterprise can reach DMZ jump server" ,
"Level 4" , "172.16.50.10" , 3389 , "allowed" ))
validator.add_test(ValidationTest(
"SEG-004" , "Enterprise can reach DMZ historian mirror" ,
"Level 4" , "172.16.50.20" , 443 , "allowed" ))
validator.add_test(ValidationTest(
"SEG-005" , "Operations can read from PLCs via Modbus" ,
"Level 3" , "10.10.20.10" , 502 , "allowed" ))
validator.add_test(ValidationTest(
"SEG-006" , "Operations cannot reach SIS controllers" ,
"Level 3" , "10.10.10.10" , 1502 , "blocked" ))
validator.run_all_tests()
Key Concepts Term Definition VLAN Virtual Local Area Network - Layer 2 broadcast domain isolation used to separate OT zones on shared switch infrastructure Industrial Firewall Firewall with deep packet inspection capabilities for industrial protocols (Modbus, DNP3, EtherNet/IP, OPC UA) Data Diode Hardware-enforced unidirectional gateway that physically prevents reverse data flow, used between OT operations and DMZ Port Security Switch feature that limits the number of MAC addresses on a port and locks assignments, preventing unauthorized device connections Trunk Port Switch port carrying multiple VLANs using 802.1Q tagging, used to connect switches and firewalls across zone boundaries DMZ Demilitarized Zone between enterprise IT and OT - a buffer zone where all cross-domain traffic terminates and is inspected
Tools & Systems
Cisco ISA-3000 : Industrial security appliance with Modbus, DNP3, and EtherNet/IP deep packet inspection for OT zone firewalls
Fortinet FortiGate Rugged Series : Ruggedized NGFW with OT protocol support and industrial environment certifications
Waterfall Security Unidirectional Gateway : Hardware data diode for enforcing one-way data flow from OT to IT
Cisco Industrial Ethernet Switches : Managed switches with VLAN, port security, and industrial protocol support
Output Format OT Network Segmentation Report
================================
Implementation Date: YYYY-MM-DD
VLAN ARCHITECTURE:
VLAN [ID] - [Name] ([Purdue Level])
Subnet: [subnet/mask]
Devices: [count]
FIREWALL RULES:
[Zone A] -> [Zone B]: [allow/deny count]
VALIDATION RESULTS:
Tests Passed: [N]/[Total]
Critical Failures: [N]