[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HM4K7H8080EY8REBVB2NRX":3,"skill-same:01M6HM4K7H8080EY8REBVB2NRX":100},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":61,"commitSha":62,"skillDirectory":63,"forksCount":64,"repositoryHtmlUrl":65,"repositoryHomepageUrl":6,"ownerHtmlUrl":66,"ownerBlogUrl":6,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6HM4K7H8080EY8REBVB2NRX","implementing-ics-firewall-with-tofino",null,"Deploy and configure Tofino industrial firewalls from Belden\u002FHirschmann to protect SCADA systems and PLCs using deep packet inspection for OT protocols including Modbus, EtherNet\u002FIP, OPC, and S7comm, enforcing granular access control between ICS...","HenriqueMC17\u002Fagente-core","HenriqueMC17","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206460478?v=4","01M6HB63HBBF18AC4H09XTB549","Henrique Monteiro Cardoso","01M6HB63NGSQXWKWCFWW2B20W0",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fimplementing-ics-firewall-with-tofino\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"implementing","with","firewall","ics","tofino","implementing ics firewall with tofino","for","cybersecurity","ip","Access Control","deep","cm","configure","access","deep-packet-inspection","belden","t1059","network-security","protocols","pr","2026-11-10 10:12:30",false,"---\nname: implementing-ics-firewall-with-tofino\ndescription: Deploy and configure Tofino industrial firewalls from Belden\u002FHirschmann to protect SCADA systems and PLCs using deep packet inspection for OT protocols including Modbus, EtherNet\u002FIP, OPC, and S7comm, enforcing granular access control between ICS...\ndomain: cybersecurity\nsubdomain: ot-ics-security\ntags:\n- ot-security\n- ics\n- firewall\n- tofino\n- belden\n- deep-packet-inspection\n- network-security\n- scada\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- DE.CM-01\n- ID.AM-05\n- GV.OC-02\nmitre_attack:\n- T1078\n- T1190\n- T1059\n- T0816\n- T0836\ncategory: implementing-ics-firewall-with-tofino\n---\n# Implementing-Ics-Firewall-With-Tofino\n\n## Overview\nDeploy and configure Tofino industrial firewalls from Belden\u002FHirschmann to protect SCADA systems and PLCs using deep packet inspection for OT protocols including Modbus, EtherNet\u002FIP, OPC, and S7comm, enforcing granular access control between ICS security zones.\n\n\n\n# Implementing ICS Firewall with Tofino\n\n## When to Use\n\n- When deploying zone-level firewall protection directly in front of critical PLCs or RTUs\n- When requiring deep packet inspection of industrial protocols (Modbus, EtherNet\u002FIP, OPC, S7comm)\n- When implementing IEC 62443 zone and conduit boundaries with protocol-aware enforcement\n- When protecting legacy PLCs that cannot be patched and need compensating controls\n- When segmenting control network zones without disrupting existing industrial communications\n\n**Do not use** for enterprise IT firewall deployment, for perimeter firewall between IT and OT (use Palo Alto\u002FFortinet at the DMZ), or for environments using only IP-based protocols without OT-specific DPI needs.\n\n## Prerequisites\n\n- Tofino Xenon appliance or Tofino virtual appliance with appropriate license\n- Tofino Central Management Platform (CMP) for centralized policy management\n- Network topology map showing PLC\u002FRTU placement and communication requirements\n- Baseline of OT protocol communications (Modbus function codes, EtherNet\u002FIP CIP services)\n- Change management approval for inline deployment between network zones\n\n## Workflow\n\n### Step 1: Design Tofino Deployment Architecture\n\n```yaml\n# Tofino ICS Firewall Deployment Architecture\n# Zone-level protection using deep packet inspection\n\ndeployment_zones:\n  zone_1_reactor_control:\n    tofino_appliance: \"TOFINO-XN-001\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"PLC-REACTOR-01\"\n        ip: \"10.10.1.10\"\n        vendor: \"Siemens S7-1500\"\n        protocols: [\"S7comm\u002F102\", \"Profinet\"]\n      - name: \"PLC-REACTOR-02\"\n        ip: \"10.10.1.11\"\n        vendor: \"Siemens S7-1500\"\n        protocols: [\"S7comm\u002F102\", \"Profinet\"]\n    authorized_communications:\n      - source: \"10.10.2.50\"  # Engineering workstation\n        dest: \"10.10.1.0\u002F24\"\n        protocols: [\"S7comm\"]\n        access_type: \"engineering\"\n      - source: \"10.10.2.10\"  # HMI server\n        dest: \"10.10.1.0\u002F24\"\n        protocols: [\"S7comm\"]\n        access_type: \"operational\"\n\n  zone_2_packaging:\n    tofino_appliance: \"TOFINO-XN-002\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"PLC-PACK-01\"\n        ip: \"10.10.3.10\"\n        vendor: \"Rockwell ControlLogix\"\n        protocols: [\"EtherNet-IP\u002F44818\", \"CIP\"]\n    authorized_communications:\n      - source: \"10.10.2.20\"  # HMI\n        dest: \"10.10.3.0\u002F24\"\n        protocols: [\"EtherNet-IP\"]\n        access_type: \"operational\"\n\n  zone_3_utilities:\n    tofino_appliance: \"TOFINO-XN-003\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"RTU-BOILER-01\"\n        ip: \"10.10.4.10\"\n        vendor: \"Schneider M340\"\n        protocols: [\"Modbus-TCP\u002F502\"]\n    authorized_communications:\n      - source: \"10.10.2.30\"  # SCADA server\n        dest: \"10.10.4.0\u002F24\"\n        protocols: [\"Modbus-TCP\"]\n        allowed_function_codes: [1, 2, 3, 4]  # Read only from SCADA\n```\n\n### Step 2: Configure Deep Packet Inspection Rules\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Tofino ICS Firewall Rule Generator.\n\nGenerates Tofino firewall rules with deep packet inspection for\nindustrial protocols based on communication baseline analysis.\n\"\"\"\n\nimport json\nimport sys\nfrom datetime import datetime\nfrom typing import Dict, List\n\n\nclass TofinoRuleGenerator:\n    \"\"\"Generates Tofino ICS firewall DPI rules.\"\"\"\n\n    def __init__(self):\n        self.rules = []\n        self.rule_id = 1000\n\n    def add_modbus_rule(self, src: str, dst: str, allowed_funcs: List[int],\n                        allowed_registers: List[dict] = None, description: str = \"\"):\n        \"\"\"Generate Modbus DPI rule.\"\"\"\n        func_names = {\n            1: \"read_coils\", 2: \"read_discrete_inputs\",\n            3: \"read_holding_registers\", 4: \"read_input_registers\",\n            5: \"write_single_coil\", 6: \"write_single_register\",\n            15: \"write_multiple_coils\", 16: \"write_multiple_registers\",\n        }\n\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"Modbus-TCP\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 502,\n            \"dpi_policy\": {\n                \"allowed_function_codes\": [\n                    {\"code\": fc, \"name\": func_names.get(fc, f\"FC{fc}\")}\n                    for fc in allowed_funcs\n                ],\n                \"blocked_function_codes\": [\n                    fc for fc in range(1, 128) if fc not in allowed_funcs\n                ],\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        if allowed_registers:\n            rule[\"dpi_policy\"][\"allowed_register_ranges\"] = allowed_registers\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_s7comm_rule(self, src: str, dst: str, allowed_operations: List[str],\n                        description: str = \"\"):\n        \"\"\"Generate S7comm DPI rule.\"\"\"\n        operation_map = {\n            \"read\": {\"function\": 0x04, \"name\": \"Read Variable\"},\n            \"write\": {\"function\": 0x05, \"name\": \"Write Variable\"},\n            \"setup\": {\"function\": 0xF0, \"name\": \"Setup Communication\"},\n            \"download\": {\"function\": 0x1A, \"name\": \"Request Download\"},\n            \"upload\": {\"function\": 0x1D, \"name\": \"Start Upload\"},\n            \"cpu_stop\": {\"function\": 0x29, \"name\": \"PLC Stop\"},\n            \"cpu_start\": {\"function\": 0x28, \"name\": \"PI Service (Start)\"},\n        }\n\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"S7comm\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 102,\n            \"dpi_policy\": {\n                \"allowed_operations\": [\n                    operation_map[op] for op in allowed_operations if op in operation_map\n                ],\n                \"block_cpu_stop\": \"cpu_stop\" not in allowed_operations,\n                \"block_program_download\": \"download\" not in allowed_operations,\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_ethernet_ip_rule(self, src: str, dst: str, allowed_services: List[str],\n                              description: str = \"\"):\n        \"\"\"Generate EtherNet\u002FIP CIP DPI rule.\"\"\"\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"EtherNet-IP\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 44818,\n            \"dpi_policy\": {\n                \"allowed_cip_services\": allowed_services,\n                \"block_firmware_flash\": True,\n                \"block_program_download\": \"program_download\" not in allowed_services,\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_default_deny(self):\n        \"\"\"Add default deny rule at the end.\"\"\"\n        self.rules.append({\n            \"rule_id\": 9999,\n            \"protocol\": \"ANY\",\n            \"action\": \"DENY\",\n            \"source\": \"ANY\",\n            \"destination\": \"ANY\",\n            \"port\": \"ANY\",\n            \"description\": \"Default deny - block all unmatched traffic\",\n            \"log\": True,\n        })\n\n    def generate_config(self) -> str:\n        \"\"\"Generate complete Tofino firewall configuration.\"\"\"\n        config = {\n            \"tofino_configuration\": {\n                \"generated\": datetime.now().isoformat(),\n                \"appliance_model\": \"Tofino Xenon\",\n                \"firmware_version\": \"4.2\",\n                \"mode\": \"inline_bridge\",\n                \"failsafe\": \"fail_open\",\n                \"rules\": self.rules,\n            }\n        }\n        return json.dumps(config, indent=2)\n\n    def print_summary(self):\n        \"\"\"Print rule summary.\"\"\"\n        print(f\"\\n{'='*65}\")\n        print(\"TOFINO ICS FIREWALL RULE SUMMARY\")\n        print(f\"{'='*65}\")\n        print(f\"Generated: {datetime.now().isoformat()}\")\n        print(f\"Total Rules: {len(self.rules)}\")\n\n        for rule in self.rules:\n            action_icon = \"+\" if rule[\"action\"] == \"ALLOW\" else \"X\"\n            print(f\"\\n  [{action_icon}] Rule {rule['rule_id']}: {rule.get('description', '')}\")\n            print(f\"      {rule['source']} -> {rule['destination']}:{rule['port']}\")\n            print(f\"      Protocol: {rule['protocol']}\")\n            if \"dpi_policy\" in rule:\n                dpi = rule[\"dpi_policy\"]\n                if \"allowed_function_codes\" in dpi:\n                    funcs = [f[\"name\"] for f in dpi[\"allowed_function_codes\"]]\n                    print(f\"      DPI - Allowed Modbus FCs: {', '.join(funcs)}\")\n                if \"allowed_operations\" in dpi:\n                    ops = [o[\"name\"] for o in dpi[\"allowed_operations\"]]\n                    print(f\"      DPI - Allowed S7 Ops: {', '.join(ops)}\")\n\n\nif __name__ == \"__main__\":\n    gen = TofinoRuleGenerator()\n\n    # SCADA server to Modbus RTUs: read-only\n    gen.add_modbus_rule(\n        src=\"10.10.2.30\",\n        dst=\"10.10.4.0\u002F24\",\n        allowed_funcs=[1, 2, 3, 4],\n        description=\"SCADA to utilities RTUs - read only\",\n    )\n\n    # Engineering workstation to Siemens PLCs: full access\n    gen.add_s7comm_rule(\n        src=\"10.10.2.50\",\n        dst=\"10.10.1.0\u002F24\",\n        allowed_operations=[\"read\", \"write\", \"setup\", \"download\", \"upload\"],\n        description=\"Engineering WS to reactor PLCs - full engineering access\",\n    )\n\n    # HMI to Siemens PLCs: read + write only (no program download)\n    gen.add_s7comm_rule(\n        src=\"10.10.2.10\",\n        dst=\"10.10.1.0\u002F24\",\n        allowed_operations=[\"read\", \"write\", \"setup\"],\n        description=\"HMI to reactor PLCs - operational access only\",\n    )\n\n    # HMI to Rockwell PLCs: operational access\n    gen.add_ethernet_ip_rule(\n        src=\"10.10.2.20\",\n        dst=\"10.10.3.0\u002F24\",\n        allowed_services=[\"read_tag\", \"write_tag\", \"get_attribute\"],\n        description=\"HMI to packaging PLCs - operational access\",\n    )\n\n    gen.add_default_deny()\n    gen.print_summary()\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Tofino Xenon | Belden\u002FHirschmann industrial firewall appliance with deep packet inspection for OT protocols |\n| Deep Packet Inspection (DPI) | Examining message payload content beyond headers to enforce fine-grained rules on industrial protocol operations |\n| Inline Bridge Mode | Transparent deployment mode where the firewall sits between network segments without requiring IP changes |\n| Fail-Open | Safety mode where firewall passes all traffic if the appliance fails, maintaining process availability |\n| Loadable Security Module (LSM) | Tofino plugin module providing protocol-specific DPI for Modbus, EtherNet\u002FIP, OPC, or other protocols |\n| Central Management Platform (CMP) | Tofino centralized management server for deploying and managing policies across multiple Tofino appliances |\n\n## Output Format\n\n```\nTOFINO DEPLOYMENT REPORT\n===========================\nDate: YYYY-MM-DD\nAppliances Deployed: [count]\n\nPER-APPLIANCE SUMMARY:\n  [Appliance ID]:\n    Mode: Inline Bridge\n    Failsafe: Fail-Open\n    Protected Assets: [count]\n    Rules: [count]\n    DPI Protocols: [list]\n\nRULE SUMMARY:\n  Allow Rules: [count]\n  Deny Rules: [count]\n  DPI-Enforced Rules: [count]\n\nMONITORING:\n  Blocked Packets (24h): [count]\n  DPI Violations (24h): [count]\n```\n","# Implementing-Ics-Firewall-With-Tofino\n\n## Overview\nDeploy and configure Tofino industrial firewalls from Belden\u002FHirschmann to protect SCADA systems and PLCs using deep packet inspection for OT protocols including Modbus, EtherNet\u002FIP, OPC, and S7comm, enforcing granular access control between ICS security zones.\n\n\n\n# Implementing ICS Firewall with Tofino\n\n## When to Use\n\n- When deploying zone-level firewall protection directly in front of critical PLCs or RTUs\n- When requiring deep packet inspection of industrial protocols (Modbus, EtherNet\u002FIP, OPC, S7comm)\n- When implementing IEC 62443 zone and conduit boundaries with protocol-aware enforcement\n- When protecting legacy PLCs that cannot be patched and need compensating controls\n- When segmenting control network zones without disrupting existing industrial communications\n\n**Do not use** for enterprise IT firewall deployment, for perimeter firewall between IT and OT (use Palo Alto\u002FFortinet at the DMZ), or for environments using only IP-based protocols without OT-specific DPI needs.\n\n## Prerequisites\n\n- Tofino Xenon appliance or Tofino virtual appliance with appropriate license\n- Tofino Central Management Platform (CMP) for centralized policy management\n- Network topology map showing PLC\u002FRTU placement and communication requirements\n- Baseline of OT protocol communications (Modbus function codes, EtherNet\u002FIP CIP services)\n- Change management approval for inline deployment between network zones\n\n## Workflow\n\n### Step 1: Design Tofino Deployment Architecture\n\n```yaml\n# Tofino ICS Firewall Deployment Architecture\n# Zone-level protection using deep packet inspection\n\ndeployment_zones:\n  zone_1_reactor_control:\n    tofino_appliance: \"TOFINO-XN-001\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"PLC-REACTOR-01\"\n        ip: \"10.10.1.10\"\n        vendor: \"Siemens S7-1500\"\n        protocols: [\"S7comm\u002F102\", \"Profinet\"]\n      - name: \"PLC-REACTOR-02\"\n        ip: \"10.10.1.11\"\n        vendor: \"Siemens S7-1500\"\n        protocols: [\"S7comm\u002F102\", \"Profinet\"]\n    authorized_communications:\n      - source: \"10.10.2.50\"  # Engineering workstation\n        dest: \"10.10.1.0\u002F24\"\n        protocols: [\"S7comm\"]\n        access_type: \"engineering\"\n      - source: \"10.10.2.10\"  # HMI server\n        dest: \"10.10.1.0\u002F24\"\n        protocols: [\"S7comm\"]\n        access_type: \"operational\"\n\n  zone_2_packaging:\n    tofino_appliance: \"TOFINO-XN-002\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"PLC-PACK-01\"\n        ip: \"10.10.3.10\"\n        vendor: \"Rockwell ControlLogix\"\n        protocols: [\"EtherNet-IP\u002F44818\", \"CIP\"]\n    authorized_communications:\n      - source: \"10.10.2.20\"  # HMI\n        dest: \"10.10.3.0\u002F24\"\n        protocols: [\"EtherNet-IP\"]\n        access_type: \"operational\"\n\n  zone_3_utilities:\n    tofino_appliance: \"TOFINO-XN-003\"\n    deployment_mode: \"inline_bridge\"\n    protected_assets:\n      - name: \"RTU-BOILER-01\"\n        ip: \"10.10.4.10\"\n        vendor: \"Schneider M340\"\n        protocols: [\"Modbus-TCP\u002F502\"]\n    authorized_communications:\n      - source: \"10.10.2.30\"  # SCADA server\n        dest: \"10.10.4.0\u002F24\"\n        protocols: [\"Modbus-TCP\"]\n        allowed_function_codes: [1, 2, 3, 4]  # Read only from SCADA\n```\n\n### Step 2: Configure Deep Packet Inspection Rules\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Tofino ICS Firewall Rule Generator.\n\nGenerates Tofino firewall rules with deep packet inspection for\nindustrial protocols based on communication baseline analysis.\n\"\"\"\n\nimport json\nimport sys\nfrom datetime import datetime\nfrom typing import Dict, List\n\n\nclass TofinoRuleGenerator:\n    \"\"\"Generates Tofino ICS firewall DPI rules.\"\"\"\n\n    def __init__(self):\n        self.rules = []\n        self.rule_id = 1000\n\n    def add_modbus_rule(self, src: str, dst: str, allowed_funcs: List[int],\n                        allowed_registers: List[dict] = None, description: str = \"\"):\n        \"\"\"Generate Modbus DPI rule.\"\"\"\n        func_names = {\n            1: \"read_coils\", 2: \"read_discrete_inputs\",\n            3: \"read_holding_registers\", 4: \"read_input_registers\",\n            5: \"write_single_coil\", 6: \"write_single_register\",\n            15: \"write_multiple_coils\", 16: \"write_multiple_registers\",\n        }\n\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"Modbus-TCP\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 502,\n            \"dpi_policy\": {\n                \"allowed_function_codes\": [\n                    {\"code\": fc, \"name\": func_names.get(fc, f\"FC{fc}\")}\n                    for fc in allowed_funcs\n                ],\n                \"blocked_function_codes\": [\n                    fc for fc in range(1, 128) if fc not in allowed_funcs\n                ],\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        if allowed_registers:\n            rule[\"dpi_policy\"][\"allowed_register_ranges\"] = allowed_registers\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_s7comm_rule(self, src: str, dst: str, allowed_operations: List[str],\n                        description: str = \"\"):\n        \"\"\"Generate S7comm DPI rule.\"\"\"\n        operation_map = {\n            \"read\": {\"function\": 0x04, \"name\": \"Read Variable\"},\n            \"write\": {\"function\": 0x05, \"name\": \"Write Variable\"},\n            \"setup\": {\"function\": 0xF0, \"name\": \"Setup Communication\"},\n            \"download\": {\"function\": 0x1A, \"name\": \"Request Download\"},\n            \"upload\": {\"function\": 0x1D, \"name\": \"Start Upload\"},\n            \"cpu_stop\": {\"function\": 0x29, \"name\": \"PLC Stop\"},\n            \"cpu_start\": {\"function\": 0x28, \"name\": \"PI Service (Start)\"},\n        }\n\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"S7comm\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 102,\n            \"dpi_policy\": {\n                \"allowed_operations\": [\n                    operation_map[op] for op in allowed_operations if op in operation_map\n                ],\n                \"block_cpu_stop\": \"cpu_stop\" not in allowed_operations,\n                \"block_program_download\": \"download\" not in allowed_operations,\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_ethernet_ip_rule(self, src: str, dst: str, allowed_services: List[str],\n                              description: str = \"\"):\n        \"\"\"Generate EtherNet\u002FIP CIP DPI rule.\"\"\"\n        rule = {\n            \"rule_id\": self.rule_id,\n            \"protocol\": \"EtherNet-IP\",\n            \"action\": \"ALLOW\",\n            \"source\": src,\n            \"destination\": dst,\n            \"port\": 44818,\n            \"dpi_policy\": {\n                \"allowed_cip_services\": allowed_services,\n                \"block_firmware_flash\": True,\n                \"block_program_download\": \"program_download\" not in allowed_services,\n            },\n            \"description\": description,\n            \"log\": True,\n        }\n\n        self.rules.append(rule)\n        self.rule_id += 1\n        return rule\n\n    def add_default_deny(self):\n        \"\"\"Add default deny rule at the end.\"\"\"\n        self.rules.append({\n            \"rule_id\": 9999,\n            \"protocol\": \"ANY\",\n            \"action\": \"DENY\",\n            \"source\": \"ANY\",\n            \"destination\": \"ANY\",\n            \"port\": \"ANY\",\n            \"description\": \"Default deny - block all unmatched traffic\",\n            \"log\": True,\n        })\n\n    def generate_config(self) -> str:\n        \"\"\"Generate complete Tofino firewall configuration.\"\"\"\n        config = {\n            \"tofino_configuration\": {\n                \"generated\": datetime.now().isoformat(),\n                \"appliance_model\": \"Tofino Xenon\",\n                \"firmware_version\": \"4.2\",\n                \"mode\": \"inline_bridge\",\n                \"failsafe\": \"fail_open\",\n                \"rules\": self.rules,\n            }\n        }\n        return json.dumps(config, indent=2)\n\n    def print_summary(self):\n        \"\"\"Print rule summary.\"\"\"\n        print(f\"\\n{'='*65}\")\n        print(\"TOFINO ICS FIREWALL RULE SUMMARY\")\n        print(f\"{'='*65}\")\n        print(f\"Generated: {datetime.now().isoformat()}\")\n        print(f\"Total Rules: {len(self.rules)}\")\n\n        for rule in self.rules:\n            action_icon = \"+\" if rule[\"action\"] == \"ALLOW\" else \"X\"\n            print(f\"\\n  [{action_icon}] Rule {rule['rule_id']}: {rule.get('description', '')}\")\n            print(f\"      {rule['source']} -> {rule['destination']}:{rule['port']}\")\n            print(f\"      Protocol: {rule['protocol']}\")\n            if \"dpi_policy\" in rule:\n                dpi = rule[\"dpi_policy\"]\n                if \"allowed_function_codes\" in dpi:\n                    funcs = [f[\"name\"] for f in dpi[\"allowed_function_codes\"]]\n                    print(f\"      DPI - Allowed Modbus FCs: {', '.join(funcs)}\")\n                if \"allowed_operations\" in dpi:\n                    ops = [o[\"name\"] for o in dpi[\"allowed_operations\"]]\n                    print(f\"      DPI - Allowed S7 Ops: {', '.join(ops)}\")\n\n\nif __name__ == \"__main__\":\n    gen = TofinoRuleGenerator()\n\n    # SCADA server to Modbus RTUs: read-only\n    gen.add_modbus_rule(\n        src=\"10.10.2.30\",\n        dst=\"10.10.4.0\u002F24\",\n        allowed_funcs=[1, 2, 3, 4],\n        description=\"SCADA to utilities RTUs - read only\",\n    )\n\n    # Engineering workstation to Siemens PLCs: full access\n    gen.add_s7comm_rule(\n        src=\"10.10.2.50\",\n        dst=\"10.10.1.0\u002F24\",\n        allowed_operations=[\"read\", \"write\", \"setup\", \"download\", \"upload\"],\n        description=\"Engineering WS to reactor PLCs - full engineering access\",\n    )\n\n    # HMI to Siemens PLCs: read + write only (no program download)\n    gen.add_s7comm_rule(\n        src=\"10.10.2.10\",\n        dst=\"10.10.1.0\u002F24\",\n        allowed_operations=[\"read\", \"write\", \"setup\"],\n        description=\"HMI to reactor PLCs - operational access only\",\n    )\n\n    # HMI to Rockwell PLCs: operational access\n    gen.add_ethernet_ip_rule(\n        src=\"10.10.2.20\",\n        dst=\"10.10.3.0\u002F24\",\n        allowed_services=[\"read_tag\", \"write_tag\", \"get_attribute\"],\n        description=\"HMI to packaging PLCs - operational access\",\n    )\n\n    gen.add_default_deny()\n    gen.print_summary()\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Tofino Xenon | Belden\u002FHirschmann industrial firewall appliance with deep packet inspection for OT protocols |\n| Deep Packet Inspection (DPI) | Examining message payload content beyond headers to enforce fine-grained rules on industrial protocol operations |\n| Inline Bridge Mode | Transparent deployment mode where the firewall sits between network segments without requiring IP changes |\n| Fail-Open | Safety mode where firewall passes all traffic if the appliance fails, maintaining process availability |\n| Loadable Security Module (LSM) | Tofino plugin module providing protocol-specific DPI for Modbus, EtherNet\u002FIP, OPC, or other protocols |\n| Central Management Platform (CMP) | Tofino centralized management server for deploying and managing policies across multiple Tofino appliances |\n\n## Output Format\n\n```\nTOFINO DEPLOYMENT REPORT\n===========================\nDate: YYYY-MM-DD\nAppliances Deployed: [count]\n\nPER-APPLIANCE SUMMARY:\n  [Appliance ID]:\n    Mode: Inline Bridge\n    Failsafe: Fail-Open\n    Protected Assets: [count]\n    Rules: [count]\n    DPI Protocols: [list]\n\nRULE SUMMARY:\n  Allow Rules: [count]\n  Deny Rules: [count]\n  DPI-Enforced Rules: [count]\n\nMONITORING:\n  Blocked Packets (24h): [count]\n  DPI Violations (24h): [count]\n```\n",{"name":5,"tags":44,"author":47,"domain":26,"license":15,"version":48,"category":5,"nist_csf":49,"subdomain":54,"description":7,"mitre_attack":55},[45,22,21,23,34,33,36,46],"ot-security","scada","mahipal","1.0",[50,51,52,53],"PR.IR-01","DE.CM-01","ID.AM-05","GV.OC-02","ot-ics-security",[56,57,58,59,60],"T1078","T1190","T1059","T0816","T0836","main","5eea5b3296f4673b5f481e8bcc1ba76281149f16","modules\u002Fimplementing-ics-firewall-with-tofino",0,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core","https:\u002F\u002Fgithub.com\u002FHenriqueMC17","Qualquer tecnologia suficientemente avançada é indistinguível da mágica.","2026-09-28 22:40:38",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add HenriqueMC17\u002Fagente-core --skill implementing-ics-firewall-with-tofino",{"tool":75,"command":76},"bunx","bunx skills add HenriqueMC17\u002Fagente-core --skill implementing-ics-firewall-with-tofino",{"tool":78,"command":79},"pnpm","pnpm dlx skills add HenriqueMC17\u002Fagente-core --skill implementing-ics-firewall-with-tofino","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fimplementing-ics-firewall-with-tofino\u002FSKILL.md",true,[83,88,94],{"path":84,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fimplementing-ics-firewall-with-tofino\u002FLICENSE",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fapi-reference.md","REFERENCE","参考文档",1565,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fimplementing-ics-firewall-with-tofino\u002Freferences\u002Fapi-reference.md",{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"scripts\u002Fagent.py","SCRIPT","脚本",8206,"https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fimplementing-ics-firewall-with-tofino\u002Fscripts\u002Fagent.py",[101,131,156,179,195,215],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":112,"publishedAt":39},"01M6HPFF0RCN0X6WT5EBSV71GY","validating-backup-integrity-for-recovery","Validate backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to ensure backups are reliable for disaster recovery and ransomware response scenarios.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[107],{"categoryNo":108,"categoryName":109,"taxonomyType":110,"taxonomyTypeDesc":111},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[113,114,115,116,25,117,26,118,119,120,121,122,123,124,125,126,127,128,129,130],"integrity","backup","recovery","validating backup integrity for recovery","testing","validate","verification","hash-verification","incident-response","ransomware","detection","t1078","t1490","disaster-recovery","restore","incident","disaster recovery","ransomware response",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":39},"01M6HPFAWJVFK25Q33K3T7WQ8G","triaging-vulnerabilities-with-ssvc-framework","Triage and prioritize vulnerabilities using CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree framework to produce actionable remediation priorities.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[],[138,139,140,141,20,26,142,143,144,145,146,147,148,149,150,151,152,153,154,155],"vulnerabilities","framework","ssvc","triaging vulnerabilities with ssvc framework","triage and prioritize","CISA","vulnerability-management","risk-management","cvss","remediation","vulnerability","prioritization","decision-tree","prioritize","decision","priorities","actionable","tree",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":39},"01M6HPF6JS9X72WP59094H3ASQ","triaging-security-incident","Performs initial triage of security incidents to determine severity, scope, and required response actions using the NIST SP 800-61r3 and SANS PICERL frameworks. Classifies incidents by type, assigns priority based on business impact, and routes...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident\u002FSKILL.md",[],[163,164,128,26,165,166,167,124,125,168,169,170,171,172,173,174,175,176,177,178],"security","triaging security incident","actions","soc","NIST","analysis","severity-classification","incident-triage","SANS-PICERL","SOC-operations","picerl","conversion","isolation","scope","impact","consistency",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":185,"publishedAt":39},"01M6HPF2EX6ZYNYYHKBRJN7GEF","triaging-security-incident-with-ir-playbook","Classify and prioritize security incidents using structured IR playbooks to determine severity, assign response teams, and initiate appropriate response procedures.","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-incident-with-ir-playbook\u002FSKILL.md",[],[163,186,187,164,128,20,26,188,166,121,189,190,124,125,191,169,151,192,193,194],"playbook","triaging security incident with ir playbook","teams","IR-playbook","severity","classification","classify","incidents","initiate",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":39},"01M6HPEY9XPGE7X95AG4XJFQAW","triaging-security-alerts-in-splunk","Triages security alerts in Splunk Enterprise Security by classifying severity, investigating notable events, correlating related telemetry, and making escalation or closure decisions using SPL queries and the Incident Review dashboard. Use when...","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftriaging-security-alerts-in-splunk\u002FSKILL.md",[],[163,202,203,204,205,206,26,207,208,209,166,210,124,211,212,213,172,30,128,214],"security alerts","splunk","triaging security alerts in splunk","alerts","review","siem","dashboard","search","correlation-search","t1566","notable-events","incident-review","de",{"skillNo":216,"name":217,"nameZh":6,"description":218,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":219,"categories":220,"keywords":221,"publishedAt":39},"01M6HPET6XGEPEJPN7V032JGZ0","tracking-threat-actor-infrastructure","Threat actor infrastructure tracking involves monitoring and mapping adversary-controlled assets including command-and-control (C2) servers, phishing domains, exploit kit hosts, bulletproof hosting, a","https:\u002F\u002Fgithub.com\u002FHenriqueMC17\u002Fagente-core\u002Fblob\u002Fmain\u002Fmodules\u002Ftracking-threat-actor-infrastructure\u002FSKILL.md",[],[222,223,224,225,26,226,227,228,229,230,231,211,232,233,30,234,214,235,236,237],"infrastructure","tracking threat actor infrastructure","tracking","threat","monitoring","mitre-attack","threat-actor","threat-intelligence","command-and-control","dns","command","exploit","intelligence","domains","kit","hosts"]