Automating the defense of cold chain controllers

CISA, the FBI, HHS, the USDA, and the DOT have warned about cyber activity aimed at industrial refrigeration and cold chain monitoring systems [1]. The attacks caused disruption across Europe. A Delhaize store manager in Eeklo found freezers remotely set to 50°C at 2:30 in the morning on November 2. The store lost meat and fish worth tens of thousands of euros.

Exposed Operational Technology (OT) controllers are often the root cause. Bitsight TRACE research found about 2,000 results for Danfoss refrigeration controllers on the open internet, with roughly 1,100 real instances [2]. Attackers accessed these controllers and set them to defrost mode [3]. The FBI and CISA warn that these attacks can damage equipment and create fire hazards, on top of spoiling food [4].

Automating exposure detection with actual commands

You cannot protect assets you cannot see. Thousands of controllers showing up on the open internet [2] points to gaps in asset inventory and perimeter monitoring. Teams should automate the discovery of exposed OT interfaces.

Nmap commands for OT/ICS reconnaissance

Nmap ships a modbus-discover script that asks a Modbus device for its slave ID and device details, which is often enough to tell a refrigeration controller from other gear [5]. It also ships identification scripts for other industrial protocols: s7-info (Siemens S7 on TCP 102), iec-identify (IEC 60870-5-104 on TCP 2404), enip-info (EtherNet/IP on TCP 44818), fox-info (Niagara Fox on TCP 1911), pcworx-info (PC Worx on TCP 1962) and bacnet-info (BACnet on UDP 47808) [7]. Nmap has no built-in OPC UA script, so port 4840 only gets service detection below. Only scan networks you own or have written permission to test, and use the slow profile on live production OT.

# Basic Modbus/TCP (port 502) scan
nmap -sS -Pn -p 502 --script modbus-discover <target_IP>

# Controller web interfaces plus Modbus
nmap -sS -Pn -p 80,443,502 --script http-title,modbus-discover <target_CIDR>

# Common OT ports. BACnet runs over UDP, so add -sU and a U: port list
nmap -sS -sU -Pn -sV \
  -p T:102,502,1911,1962,2404,4840,20000,44818,U:47808 \
  --script modbus-discover,s7-info,iec-identify,enip-info,fox-info,pcworx-info,bacnet-info \
  <target_CIDR> -oA ics_scan_$(date +%Y%m%d)

# Ask modbus-discover to walk more slave IDs (more traffic, use with care)
nmap -sS -Pn -p 502 --script modbus-discover --script-args modbus-discover.aggressive=true <target_IP> -oN modbus_enum.txt

# Gentler scan for production OT environments
nmap -sS -Pn -T2 -p 502 --script modbus-discover --max-retries 1 <target_CIDR>

Shodan CLI commands for continuous monitoring

The Shodan command line tool comes with the official Python library [8]. Search filters such as port: and net: need a paid Shodan plan. Shodan's network alerts watch address ranges you own and fire on named triggers, which is the right fit for continuous monitoring of your own perimeter [8].

# Install the Shodan CLI and store your Shodan key (read here from an environment variable)
pip3 install shodan
shodan init "$SHODAN_KEY"

# Search your own address space for exposed Modbus and BACnet services
shodan search "net:<your_public_CIDR> port:502,47808" --fields ip_str,port,org,product --separator "," > ot_exposed.csv

# Look for Danfoss banners inside your address space
shodan search "net:<your_public_CIDR> danfoss" --fields ip_str,port,org,location.city,product --separator "," > danfoss_exposed.csv

# Watch your ranges continuously: create a network alert, then turn on triggers
shodan alert create "OT perimeter" <your_public_CIDR>
shodan alert triggers                     # list the trigger names Shodan supports
shodan alert enable <alert_id> industrial_control_system
shodan alert enable <alert_id> new_service

Python script for automated CISA KEV + Shodan correlation

CISA publishes its Known Exploited Vulnerabilities catalog as a JSON feed [6]. The script below pulls that feed, keeps the entries for OT vendors, and checks Shodan for internet-facing hosts that match. Each Shodan search with a filter uses query credits, so keep the keyword list short.

#!/usr/bin/env python3
"""
Automated OT exposure detection - polls CISA KEV and cross-references with Shodan
Run via cron every hour: 0 * * * * /opt/scripts/ot_exposure_check.py
"""
import requests
import json
import shodan
import os
from datetime import datetime, timezone

SHODAN_KEY = os.getenv('SHODAN_KEY')
OWN_NET = os.getenv('OT_PUBLIC_CIDR')  # your public range, so results stay on your own assets
KEV_URL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
OT_KEYWORDS = ['modbus', 'bacnet', 'danfoss', 'schneider', 'siemens', 'rockwell', 'mitsubishi']

def fetch_kev_catalog():
    resp = requests.get(KEV_URL, timeout=30)
    resp.raise_for_status()
    return resp.json()['vulnerabilities']

def check_shodan_for_kev(kev_entry, api):
    """Check if a KEV-affected product appears in Shodan within your range"""
    query = f"net:{OWN_NET} {kev_entry.get('vendor', '')} {kev_entry.get('product', '')}".strip()
    try:
        results = api.search(query, limit=100)
        return [{'ip': r['ip_str'], 'port': r['port'], 'org': r.get('org', ''), 'hostnames': r.get('hostnames', [])}
                for r in results['matches']]
    except shodan.APIError:
        return []

def main():
    api = shodan.Shodan(SHODAN_KEY)
    ot_findings = []
    for vuln in fetch_kev_catalog():
        text = f"{vuln.get('vendor', '')} {vuln.get('product', '')}".lower()
        if any(kw in text for kw in OT_KEYWORDS):
            matches = check_shodan_for_kev(vuln, api)
            if matches:
                ot_findings.append({
                    'cve': vuln['cveID'],
                    'product': vuln['product'],
                    'vendor': vuln['vendor'],
                    'exposed_hosts': matches
                })

    if ot_findings:
        # Alert via webhook (n8n, Slack, etc.)
        requests.post(os.environ['ALERT_WEBHOOK_URL'], json={
            'alert': 'OT_KEV_EXPOSURE',
            'timestamp': datetime.now(timezone.utc).isoformat(),
            'findings': ot_findings
        }, timeout=30)

        # Save local copy
        with open(f"/var/log/ot_kev_exposure_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json", 'w') as f:
            json.dump(ot_findings, f, indent=2)

if __name__ == '__main__':
    main()

Zabbix monitoring for temperature anomalies

Zabbix agent 2 can read Modbus registers directly with its built-in modbus.get item key, so no helper script is needed [9]. The key takes the endpoint, slave ID, Modbus function, register address, count, data type, endianness and offset. Register numbers and scaling differ by controller model, so take them from the vendor's Modbus map.

# Item keys on a Zabbix agent 2 host that can reach the controller.
# Function 3 reads holding registers. Replace <controller_ip> and <register> from your vendor's Modbus map.
modbus.get[tcp://<controller_ip>:502,1,3,<temp_register>,1,int16,be,0]
modbus.get[tcp://<controller_ip>:502,1,3,<setpoint_register>,1,int16,be,0]

# Trigger: cabinet above 10 °C while the setpoint is a freezer value (below -10 °C)
# last(/<host>/modbus.get[tcp://<controller_ip>:502,1,3,<temp_register>,1,int16,be,0])>10
#   and last(/<host>/modbus.get[tcp://<controller_ip>:502,1,3,<setpoint_register>,1,int16,be,0])<-10

# Trigger: temperature swing of more than 20 degrees inside 5 minutes (possible sabotage)
# max(/<host>/modbus.get[...temp key...],5m)-min(/<host>/modbus.get[...temp key...],5m)>20

n8n workflow for automated ticketing (JSON import)

The workflow below takes the alert the Python script posts, splits it into one item per finding with a Code node [10], and opens a Jira issue per finding through Jira's documented create issue endpoint [11]. The Webhook node puts the posted JSON under body. Set the Jira site URL and pick your Jira credential after import.

{
  "name": "OT Exposure Auto-Ticket",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "ot-exposure-alert",
        "responseMode": "onReceived"
      },
      "id": "1",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [250, 300]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const findings = $input.first().json.body.findings || [];\nreturn findings.map(f => ({\n  json: {\n    title: `OT KEV Exposure: ${f.cve} on ${f.product}`,\n    description: `Exposed ${f.vendor} ${f.product} (${f.cve}) found on ${f.exposed_hosts.length} hosts`,\n    labels: ['OT', 'KEV', 'exposure', f.vendor.toLowerCase().replace(/\\s+/g, '-')]\n  }\n}));"
      },
      "id": "2",
      "name": "Format for Jira",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://<your-site>.atlassian.net/rest/api/2/issue",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "jiraSoftwareCloudApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ fields: { project: { key: 'SEC' }, issuetype: { name: 'Task' }, summary: $json.title, description: $json.description, labels: $json.labels } }) }}"
      },
      "id": "3",
      "name": "Create Jira Ticket",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [750, 300]
    }
  ],
  "connections": {
    "Webhook": { "main": [[{ "node": "Format for Jira", "type": "main", "index": 0 }]] },
    "Format for Jira": { "main": [[{ "node": "Create Jira Ticket", "type": "main", "index": 0 }]] }
  }
}

Implementing automated response and patching

Once you find an exposed controller, you need to respond fast to keep freezers from turning into ovens [2]. Uptime requirements often make manual patching of OT devices slow, so automate the response at the network layer instead.

Semgrep rules for OT management software vulnerabilities

Semgrep parses every pattern in a rule for each language the rule lists, so the Java and Python deserialization checks are separate rules.

# .semgrep-rules/ot-hardcoded-creds.yaml
rules:
  - id: ot-hardcoded-password
    patterns:
      - pattern: $NAME = "..."
      - metavariable-regex:
          metavariable: $NAME
          regex: (?i)^(password|passwd|pwd)$
    message: "Hardcoded password in OT management code"
    languages: [python, javascript, go]
    severity: ERROR
    metadata:
      category: ot-security
      cwe: "CWE-798"

  - id: ot-unauthenticated-api
    patterns:
      - pattern-either:
          - pattern: |
              @$APP.route(...)
              def $F(...): ...
          - pattern: |
              @$ROUTER.get(...)
              def $F(...): ...
      - pattern-not: |
          @login_required
          def $F(...): ...
      - pattern-not: |
          @requires_auth
          def $F(...): ...
    message: "Potentially unauthenticated API endpoint in OT management interface"
    languages: [python]
    severity: WARNING
    metadata:
      category: ot-security

  - id: ot-insecure-deserialization-python
    pattern-either:
      - pattern: pickle.loads(...)
      - pattern: yaml.load(..., Loader=yaml.Loader)
    message: "Insecure deserialization - potential RCE in OT management software"
    languages: [python]
    severity: ERROR
    metadata:
      category: ot-security
      cwe: "CWE-502"

  - id: ot-insecure-deserialization-java
    pattern: (ObjectInputStream $IN).readObject()
    message: "Java deserialization of a stream - potential RCE in OT management software"
    languages: [java]
    severity: ERROR
    metadata:
      category: ot-security
      cwe: "CWE-502"
# Check the rule file, then scan the OT management codebase [12]
semgrep scan --validate --config=.semgrep-rules/ot-hardcoded-creds.yaml
semgrep scan --config=.semgrep-rules/ot-hardcoded-creds.yaml \
  --config=auto --json-output=semgrep_results.json /path/to/ot-management-code/

# In CI, fail the job on findings and keep a SARIF copy for code scanning
semgrep scan --config=.semgrep-rules/ot-hardcoded-creds.yaml --error --sarif-output=semgrep-results.sarif

CodeQL query for privilege escalation paths

Current CodeQL uses the module based data flow API: a configuration module implements DataFlow::ConfigSig and is passed to TaintTracking::Global [13]. The method names in isSink are examples; replace them with the privileged calls in your own code.

/**
 * @name Untrusted input reaches privileged OT operation
 * @kind path-problem
 * @id ot/untrusted-input-to-privileged-op
 */
import java
import semmle.code.java.dataflow.FlowSources
import semmle.code.java.dataflow.TaintTracking

module OtPrivConfig implements DataFlow::ConfigSig {
  predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }

  predicate isSink(DataFlow::Node sink) {
    exists(MethodCall mc |
      mc.getMethod().hasName(["setPrivilege", "executeCommand", "changeConfig"]) and
      sink.asExpr() = mc.getAnArgument()
    )
  }
}

module OtPrivFlow = TaintTracking::Global<OtPrivConfig>;
import OtPrivFlow::PathGraph

from OtPrivFlow::PathNode source, OtPrivFlow::PathNode sink
where OtPrivFlow::flowPath(source, sink)
select sink.getNode(), source, sink, "Untrusted input reaches privileged OT operation"
# The query needs a pack that depends on the Java library. In the folder holding the .ql file:
#   qlpack.yml ->  name: local/ot-queries
#                  version: 0.0.1
#                  dependencies:
#                    codeql/java-all: "*"
codeql pack install

# Build the database (build-mode none skips compiling the project) and run the query
codeql database create ot-db --language=java --build-mode=none --source-root=/path/to/ot-code
codeql database analyze ot-db ot-privilege-escalation.ql --format=sarif-latest --output=ot-privesc.sarif

Securing the OT perimeter

Connecting OT devices to the network created a large attack surface. The joint warning from CISA and its partners stresses that these systems need hardening [1].

Firewall rules for OT segmentation (iptables)

iptables evaluates rules top to bottom and stops at the first ACCEPT or DROP, so the order below matters: return traffic first, then the allowed Modbus sessions, then logging, then the drops.

# Set these to your own values before running
ENG_NET="<engineering-subnet-cidr>"   # approved engineering workstations
OT_NET="<ot-subnet-cidr>"             # refrigeration controllers
WAN_IF="<internet-facing-interface>"
OT_IF="<ot-facing-interface>"

# Allow replies to sessions that are already permitted
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

# Allow new Modbus sessions ONLY from approved engineering workstations, rate limited
iptables -A FORWARD -p tcp --dport 502 -s "$ENG_NET" -d "$OT_NET" \
  -m conntrack --ctstate NEW -m limit --limit 10/s --limit-burst 20 -j ACCEPT

# Log, then drop, everything else headed for the OT subnet
iptables -A FORWARD -d "$OT_NET" -j LOG --log-prefix "OT_BLOCKED: " --log-level 4
iptables -A FORWARD -d "$OT_NET" -j DROP

# Block the OT subnet from reaching the internet directly
iptables -A FORWARD -i "$OT_IF" -o "$WAN_IF" -s "$OT_NET" -j DROP

Network ACL for jump server access

# Cisco ASA config for OT jump server
# Fill in the addresses once in named objects, then reference the names
object network OT-JUMP-HOST
 host <jump-server-address>
object network OT-CONTROLLER-HMI
 host <controller-hmi-address>
object network OT-SUBNET
 subnet <ot-network-address> <ot-netmask>
access-list OT_MGMT extended permit tcp object OT-JUMP-HOST object OT-CONTROLLER-HMI eq 22 log
access-list OT_MGMT extended permit tcp object OT-JUMP-HOST object OT-CONTROLLER-HMI eq 443 log
access-list OT_MGMT extended deny ip any object OT-SUBNET log
# An ACL ends in an implicit deny. Keep this line, or replace it with your existing inside policy,
# so traffic that is not headed for the OT subnet still flows
access-list OT_MGMT extended permit ip any any
access-group OT_MGMT in interface inside

Actions for cold chain operators

The attacks in October 2026 [3] show that industrial refrigeration is a target for remote disruption. Operators should take these actions:

  1. Audit all Danfoss and other refrigeration controllers to confirm they are not reachable from the open internet [2].
   # Quick external scan of your own public address, run from outside your network
   nmap -Pn -p 80,443,502 <your_public_IP> --script http-title,modbus-discover
  1. Set up automated alerts for temperature set point changes that exceed normal parameters, especially unauthorized defrost mode activations. The Zabbix triggers above cover this.
  1. Review network logs for unauthorized access attempts against cold chain monitoring systems, as CISA and the FBI urge. Zeek's Modbus analyzer writes modbus.log with the function name of each request in the func field [14].
   # List Modbus write requests and who sent them (point the path at your Zeek log directory)
   zeek-cut ts id.orig_h id.resp_h func < <zeek_log_dir>/current/modbus.log | awk '$4 ~ /WRITE/'
  1. Prohibit default credentials on any OT controller exposed to the internal network, and enforce that as a strict policy.
   # Try the vendor default logins Nmap knows for web interfaces
   nmap -p 80,443 --script http-default-accounts <OT_subnet>

The http-default-accounts script only knows the products in its fingerprint file [7], so a clean result does not prove a controller has no default login.

  1. Keep a verified backup of controller configurations so you can recover quickly if a device is remotely sabotaged. Danfoss does not publish a public REST endpoint for configuration backup, so export each controller's configuration with the vendor's own service software, then keep dated, checksummed copies off the controller network.
   #!/bin/bash
   # Copy vendor tool exports into a dated archive and record checksums
   EXPORT_DIR="<folder where the vendor tool saves exports>"
   ARCHIVE="/opt/backups/controllers/$(date +%Y%m%d)"
   mkdir -p "$ARCHIVE"
   cp -p "$EXPORT_DIR"/* "$ARCHIVE"/
   ( cd "$ARCHIVE" && sha256sum * > SHA256SUMS )

Try it yourself: Public Health Jobs NYC, a free tool from CyberAutomations.