performing-ot-vulnerability-scanning-safely
Perform vulnerability scanning in OT/ICS environments safely using passive monitoring, native protocol queries, and carefully controlled active scanning with Tenable OT Security to identify vulnerabilities without disrupting industrial processes or crashing legacy controllers.
What this skill does
# Performing OT Vulnerability Scanning Safely
## When to Use
- When conducting vulnerability assessments in OT environments with legacy controllers
- When implementing continuous vulnerability monitoring without impacting process availability
- When preparing for IEC 62443 or NERC CIP compliance audits requiring vulnerability data
- When evaluating risk-based patching priorities for OT assets
- When validating that compensating controls protect unpatched ICS devices
**Do not use** for aggressive active scanning of production PLCs (can crash legacy controllers), for IT vulnerability scanning using standard Nessus profiles on OT networks, or for penetration testing of live OT systems (see performing-ics-penetration-testing).
## Prerequisites
- Tenable OT Security (formerly Tenable.ot/Indegy) or equivalent OT-safe scanning platform
- Passive monitoring sensor deployed on SPAN/TAP at OT network segments
- Lab-tested scanning profiles verified against each device type before production use
- Change management approval and maintenance window for any active scanning
- Vendor warranty verification to confirm scanning will not void support agreements
## Workflow
### Step 1: Deploy Passive Vulnerability Detection
Passive monitoring identifies vulnerabilities without sending any packets to OT devices.
```python
#!/usr/bin/env python3
"""OT Safe Vulnerability Scanner Orchestrator.
Coordinates passive monitoring, native protocol queries, and carefully
controlled active scanning for OT vulnerability assessment without
disrupting industrial operations.
"""
import json
import csv
import sys
from datetime import datetime
from typing import Dict, List, Optional
try:
import requests
except ImportError:
print("Install requests: pip install requests")
sys.exit(1)
class OTVulnerabilityScanner:
"""Safe OT vulnerability scanning orchestrator."""
SCAN_SAFETY_LEVELS = {
"passive": {
"description": "Observe network traffic only, zero risk to devices",
"risk_level": "NONE",
"methods": ["traffic_fingerprinting", "protocol_analysis", "version_detection"],
"requires_window": False,
},
"native_query": {
"description": "Query devices using native industrial protocols",
"risk_level": "MINIMAL",
"methods": ["modbus_device_id", "s7_szl_read", "cip_identity", "bacnet_whois"],
"requires_window": True,
},
"controlled_active": {
"description": "Standard vulnerability checks with OT-safe profiles",
"risk_level": "LOW-MODERATE",
"methods": ["credentialed_scan", "banner_grab", "service_detection"],
"requires_window": True,
},
}
def __init__(self, tenable_url: str, api_key: str, verify_ssl: bool = True):
self.tenable_url = tenable_url.rstrip("/")
self.session = requests.Session()
self.session.headers.update({
"X-ApiKeys": f"accessKey={api_key}",
"Content-Type": "application/json",
})
self.session.verify = verify_ssl
self.findings = []
def check_safety_prerequisites(self, scan_level: str, target_subnet: str) -> dict:
"""Verify safety prerequisites before scanning."""
checks = {
"scan_level": scan_level,
"target": target_subnet,
"safety_level": self.SCAN_SAFETY_LEVELS[scan_level],
"checks_passed": [],
"checks_failed": [],
"approved": False,
}
prerequisites = [
{
"name": "Lab validation complete",
"description": "Scan profile tested against each device type in lab environment",
"required_for": ["native_query", "controlled_active"],
},
{
"name": "Vendor warranty verified",
"description": "Scanning will not void vendor support agreements",
"required_for": ["native_query", "controlled_active"],
},
{
"name": "Change management approved",
"description": "Change ticket approved for scanning activity",
"required_for": ["native_query", "controlled_active"],
},
{
"name": "Maintenance window confirmed",
"description": "Operations team confirms acceptable scanning window",
"required_for": ["controlled_active"],
},
{
"name": "Rollback plan documented",
"description": "Procedure to stop scan and recover if device becomes unresponsive",
"required_for": ["controlled_active"],
},
{
"name": "SIS excluded from scope",
"description": "Safety Instrumented Systems are never actively scanned",
"required_for": ["passive", "native_query", "controlled_active"],
},
]
for prereq in prerequisites:
if scan_level in prereq["required_for"]:
checks["checks_passed"].append(prereq["name"])
return checks
def run_passive_assessment(self, site_id: str):
"""Run passive vulnerability assessment using traffic analysis."""
print(f"[*] Running passive vulnerability assessment for site {site_id}")
print(f"[*] Safety Level: NONE - no packets sent to OT devices")
try:
resp = self.session.get(
f"{self.tenable_url}/api/v1/assets",
params={"site_id": site_id}
)
resp.raise_for_status()
assets = resp.json().get("assets", [])
for asset in assets:
asset_id = asset.get("id")
vuln_resp = self.session.get(
f"{self.tenable_url}/api/v1/assets/{asset_id}/vulnerabilities"
)
if vuln_resp.status_code == 200:
vulns = vuln_resp.json().get("vulnerabilities", [])
for vuln in vulns:
self.findings.append({
"asset": asset.get("name", "Unknown"),
"ip": asset.get("ip_address", ""),
"type": asset.get("type", ""),
"vendor": asset.get("vendor", ""),
"cve": vuln.get("cve_id", ""),
"severity": vuln.get("severity", ""),
"cvss": vuln.get("cvss_score", 0),
"description": vuln.get("description", ""),
"detection_method": "passive",
"remediation": vuln.get("remediation", ""),
})
print(f"[+] Passive assessment complete: {len(self.findings)} vulnerabilities found")
except requests.RequestException as e:
print(f"[!] API error: {e}")
def generate_prioritized_report(self, output_file: str):
"""Generate risk-prioritized vulnerability report for OT environment."""
self.findings.sort(key=lambda x: x.get("cvss", 0), reverse=True)
print(f"\n{'='*70}")
print("OT VULNERABILITY ASSESSMENT REPORT")
print(f"{'='*70}")
print(f"Date: {datetime.now().isoformat()}")
print(f"Total Findings: {len(self.findings)}")
severity_counts = {}
for f in self.findings:
sev = f.get("severity", "Unknown")
severity_counts[sev] = severity_counts.get(sev, 0) + 1
print(f"\nSeverity Distribution:")
for sev in ["Critical", "High", "Medium", "Low"]:
print(f" {sev}: {severity_counts.get(sev, 0)}")
# Risk-based prioritization considering OT context
print(f"\n--- RISK-PRIORITIZED FINDINGS ---")
print(f"(Prioritized by CVSS score and OT impact)")
for i, finding inRelated in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.