Audits and hardens process historian servers (OSIsoft PI, Honeywell PHD, GE Proficy, AVEVA Historian) in OT environments: Purdue-level network placement, interface access control, secure DMZ replication via data diodes or PI-to-PI connectors, SQL injection prevention, and process data integrity. Use when auditing or hardening a historian server, or designing secure OT-to-IT data replication through a DMZ.
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.
Instruções da origem · Visualização somente leitura
name
securing-historian-server-in-ot-environment
description
Audits and hardens process historian servers (OSIsoft PI, Honeywell PHD, GE Proficy, AVEVA Historian) in OT environments: Purdue-level network placement, interface access control, secure DMZ replication via data diodes or PI-to-PI connectors, SQL injection prevention, and process data integrity. Use when auditing or hardening a historian server, or designing secure OT-to-IT data replication through a DMZ.
When deploying a new historian server in an OT environment and configuring it securely from the start
When hardening an existing historian after a security assessment identified it as a high-risk target
When designing historian data replication architecture through a DMZ for IT access to process data
When implementing access controls to prevent unauthorized modification of historical process data
When investigating suspected historian compromise or data integrity issues
Do not use for IT-only database security without OT data (see general database hardening), for real-time SCADA data transmission security (see detecting-attacks-on-scada-systems), or for historian selection and sizing decisions.
Prerequisites
Historian platform (OSIsoft PI, Honeywell PHD, GE Proficy, AVEVA Historian) installed and operational
Network segmentation with historian placed in Level 3 (Site Operations) per Purdue Model
Understanding of data flows: field devices -> PLCs -> OPC servers -> historian
Access to historian administration credentials
DMZ infrastructure for IT-facing data replication
Workflow
Step 1: Audit Current Historian Security Configuration
Evaluate the current security posture of the historian server including network exposure, authentication, and access controls.
"""Check which network services are exposed by the historian."""
print
f"[*] Checking network exposure: {self.ip}"
# Common historian ports
5450
"PI Data Archive"
"PI SDK/API connections"
5457
"PI AF Server"
"PI Asset Framework"
5459
"PI Notifications"
"PI Notification Service"
443
"HTTPS"
"PI Vision / Web API"
80
"HTTP"
"Unsecured web interface"
1433
"MS SQL Server"
"Direct database access"
5432
"PostgreSQL"
"Direct database access"
3389
"RDP"
"Remote Desktop"
135
"RPC"
"Windows RPC"
445
"SMB"
"Windows File Sharing"
8080
"HTTP Alt"
"Alternative web interface"
for
in
try
3
self
if
0
"port"
"service"
"description"
except
pass
# Flag unnecessary exposed services
for
in
if
"port"
in
80
135
445
3389
self
f"HIST-{self.counter:03d}"
"high"
"Network Exposure"
f"Unnecessary service exposed: {svc['service']} (port {svc['port']})"
f"Port {svc['port']} ({svc['description']}) is accessible on historian"
f"Disable {svc['service']} or restrict via host firewall"
self
1
if
any
"port"
80
for
in
self
f"HIST-{self.counter:03d}"
"high"
"Encryption"
"Historian web interface on unencrypted HTTP"
"Port 80 (HTTP) is open, exposing credentials and data in cleartext"
"Redirect HTTP to HTTPS; disable port 80"
self
1
return
def
check_authentication
self
"""Check historian authentication configuration."""
print
f"[*] Checking authentication configuration"
# Check if PI Trust authentication is still enabled (legacy, insecure)
# PI Trust allows IP-based authentication without credentials
"check"
"PI Trust Authentication"
"risk"
"PI Trust allows connections based on IP address alone without credentials"
"severity"
"critical"
"remediation"
"Migrate all PI Trust connections to Windows Integrated Security"
"check"
"Default piadmin account"
"risk"
"Default PI administrator account may have default or weak password"
"severity"
"critical"
"remediation"
"Disable piadmin; use named Windows accounts with PI mappings"
"check"
"PI SDK anonymous access"
"risk"
"Anonymous PI SDK connections may be permitted"
"severity"
"high"
"remediation"
"Require authentication for all PI SDK connections"
for
in
self
f"HIST-{self.counter:03d}"
"severity"
"Authentication"
f"Check: {check['check']}"
"risk"
"remediation"
self
1
def
check_data_integrity
self
"""Check data integrity protections."""
print
f"[*] Checking data integrity protections"
f"HIST-{self.counter:03d}"
"high"
"Data Integrity"
"Verify historical data modification audit trail"
"Modifications to historical process data should be logged with before/after values"
"Enable PI audit trail for all data modifications; restrict edit permissions"
f"HIST-{self.counter + 1:03d}"
"medium"
"Data Integrity"
"Verify backup integrity and recovery testing"
"Historian backups should be tested regularly for recovery capability"
"Implement automated backup verification with quarterly recovery testing"
self
self
len
def
generate_report
self
"""Generate historian security audit report."""
"="
70
"HISTORIAN SECURITY AUDIT REPORT"
f"Target: {self.ip} ({self.type})"
f"Date: {datetime.now().isoformat()}"
"="
70
for
in
"critical"
"high"
"medium"
"low"
for
in
self
if
if
f"\n--- {sev.upper()} ({len(findings)}) ---"
for
in
f" [{f.finding_id}] {f.title}"
f" {f.detail}"
f" Fix: {f.remediation}"
return
"\n"
if
"__main__"
1
if
len
1
else
"10.30.1.50"
"PI"
print
Step 2: Harden Historian Server
Apply security hardening based on vendor security guides and IEC 62443 requirements.
# OSIsoft PI Server Hardening Script (Windows)
# Based on OSIsoft Security Best Practices Guide
# 1. Disable PI Trust authentication - migrate to Windows Integrated Security
# In PI SMT (System Management Tools):
# Security > Mappings & Trusts > Delete all Trust entries
# Create PI Mappings for Windows groups instead
# 2. Disable the default piadmin account
# In PI SMT: Security > Identities, Users & Groups
# Set piadmin account to disabled
# 3. Configure Windows Firewall for PI Server
New-NetFirewallRule -DisplayName "PI Data Archive" -Direction Inbound `
-Protocol TCP -LocalPort 5450 -Action Allow `
-RemoteAddress "10.30.0.0/16","10.20.0.0/16" `
-Description "Allow PI SDK connections from OT zones only"
New-NetFirewallRule -DisplayName "PI AF Server" -Direction Inbound `
-Protocol TCP -LocalPort 5457 -Action Allow `
-RemoteAddress "10.30.0.0/16" `
-Description "Allow PI AF connections from Operations zone"
New-NetFirewallRule -DisplayName "PI Vision HTTPS" -Direction Inbound `
-Protocol TCP -LocalPort 443 -Action Allow `
-RemoteAddress "172.16.0.0/16" `
-Description "Allow PI Vision HTTPS from DMZ only"
# Block HTTP (force HTTPS)
New-NetFirewallRule -DisplayName "Block HTTP" -Direction Inbound `
-Protocol TCP -LocalPort 80 -Action Block
# Block RDP from non-authorized sources
New-NetFirewallRule -DisplayName "RDP Restrict" -Direction Inbound `
-Protocol TCP -LocalPort 3389 -Action Allow `
-RemoteAddress "10.30.1.100" `
-Description "Allow RDP from admin jump server only"
# 4. Enable Windows audit policies for CIP-007 compliance
auditpol /set /subcategory:"Logon" /success:enable /failure:enable
auditpol /set /subcategory:"Account Lockout" /success:enable /failure:enable
auditpol /set /subcategory:"File System" /success:enable /failure:enable
auditpol /set /subcategory:"Registry" /success:enable /failure:enable
# 5. Configure PI audit trail for data integrity
# In PI SMT: Audit > Enable auditing for security changes
# Enable auditing for: point creation/deletion, data edits, security changes
Step 3: Implement Secure Data Replication to DMZ
Configure historian data replication through the DMZ using PI-to-PI interfaces or data diodes to provide IT access to process data without exposing the OT historian.
# Historian DMZ Replication Architecture## OT Historian (Level 3) --> Data Diode --> DMZ Historian (Level 3.5) <-- Enterprise (Level 4)## Key principle: Enterprise users NEVER connect directly to the OT historian.# Data flows unidirectionally from OT to DMZ.architecture:ot_historian:location:"Level 3 - Site Operations"server:"PI-OT-01 (10.30.1.50)"role:"Primary data collection from OPC servers and PLCs"access:"OT operators and engineers only"data_diode:location:"Between Level 3 and Level 3.5"device:"Waterfall Security Unidirectional Gateway"direction:"OT -> DMZ (physically enforced one-way)"protocol:"PI-to-PI replication protocol"dmz_historian:location:"Level 3.5 - DMZ"server:"PI-DMZ-01 (172.16.1.50)"role:"Read-only mirror of OT historian for enterprise access"access:"Enterprise users via PI Vision (HTTPS)"data_delay:"Near real-time (typically 5-30 second delay)"enterprise_access:method:"PI Vision web application on DMZ historian"authentication:"Windows Integrated Security with MFA"protocol:"HTTPS (TLS 1.2+)"restrictions:-"Read-only access to process data"-"No write-back capability to OT historian"-"No direct database queries - PI Vision API only"-"Session timeout after 30 minutes of inactivity"
Key Concepts
Term
Definition
Process Historian
Server that collects, stores, and serves time-series process data from industrial control systems at high frequency (sub-second to seconds)
PI Trust
Legacy OSIsoft PI authentication method based on IP address/hostname; insecure and should be migrated to Windows Integrated Security
Data Diode
Hardware-enforced unidirectional gateway ensuring historian data flows only from OT to DMZ, preventing reverse access
PI-to-PI Interface
OSIsoft replication mechanism that synchronizes PI data between servers, used for DMZ data mirroring
Audit Trail
Historian feature logging all modifications to historical data with before/after values, user identity, and timestamp
Tag Security
Per-tag access control in PI determining which users/applications can read or write specific process data points
Tools & Systems
OSIsoft PI Server: Industry-leading process historian by AVEVA (formerly OSIsoft) used in 90%+ of large industrial facilities
AVEVA Historian: Time-series database for process data with SQL-like query interface
Waterfall Security: Hardware data diode for unidirectional historian replication
PI Vision: Web-based visualization tool for PI data, deployed in DMZ for enterprise access
Output Format
Historian Security Assessment Report
=====================================
Historian: [Type and Version]
Server: [Hostname/IP]
Network Zone: [Purdue Level]
AUTHENTICATION:
PI Trust entries: [N] (should be 0)
Default accounts: [enabled/disabled]
Windows auth: [enabled/disabled]
NETWORK EXPOSURE:
Open ports: [list]
Unnecessary services: [list]
DATA INTEGRITY:
Audit trail: [enabled/disabled]
Backup tested: [date]
DMZ REPLICATION:
Method: [PI-to-PI / Data Diode / VPN]
Direction: [Unidirectional / Bidirectional]