[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758XMPQXAJGQ6AVVXMT5YY5":3,"skill-same:01M758XMPQXAJGQ6AVVXMT5YY5":75},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":39,"commitSha":40,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M758XMPQXAJGQ6AVVXMT5YY5","securing-remote-access-to-ot-environment",null,"This skill covers implementing secure remote access to OT\u002FICS environments for operators, engineers, and vendors while preventing unauthorized access that could compromise industrial operations. It addresses jump server architecture, multi-factor authentication, session recording, privileged access management, vendor remote access controls, and compliance with IEC 62443 and NERC CIP-005 remote access requirements.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fsecuring-remote-access-to-ot-environment\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fsecuring-remote-access-to-ot-environment\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: securing-remote-access-to-ot-environment\ndescription: >\n  This skill covers implementing secure remote access to OT\u002FICS environments for\n  operators, engineers, and vendors while preventing unauthorized access that could\n  compromise industrial operations. It addresses jump server architecture, multi-factor\n  authentication, session recording, privileged access management, vendor remote access\n  controls, and compliance with IEC 62443 and NERC CIP-005 remote access requirements.\ndomain: cybersecurity\nsubdomain: ot-ics-security\ntags: [ot-security, ics, scada, industrial-control, iec62443, remote-access, jump-server, mfa]\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Securing Remote Access to OT Environment\n\n## When to Use\n\n- When implementing or upgrading remote access architecture for OT environments\n- When onboarding vendors who require remote access to OT systems for support and maintenance\n- When implementing CIP-005-7 R2 requirements for remote access management including MFA\n- When replacing legacy direct VPN access to OT networks with a secure jump server architecture\n- When responding to an incident involving unauthorized remote access to industrial control systems\n\n**Do not use** for securing IT-only remote access without OT components, for configuring VPN for corporate workers (see general VPN guides), or for physical access control to OT facilities.\n\n## Prerequisites\n\n- DMZ infrastructure (Level 3.5) between corporate IT and OT networks\n- Jump server\u002Fbastion host platform (CyberArk, BeyondTrust, or hardened Windows\u002FLinux server)\n- Multi-factor authentication solution (Duo, RSA SecurID, YubiKey, smart cards)\n- Session recording capability for audit trail compliance\n- Firewall rules permitting remote access only through the DMZ intermediate system\n\n## Workflow\n\n### Step 1: Design Secure Remote Access Architecture\n\nImplement a defense-in-depth remote access architecture with an intermediate system in the DMZ that prevents any direct network connectivity between external users and OT systems.\n\n```yaml\n# OT Remote Access Architecture\n# Key principle: NO direct connection from external networks to OT systems\n\narchitecture:\n  external_access_point:\n    location: \"Internet-facing firewall\"\n    service: \"VPN gateway (IKEv2\u002FIPsec or SSL VPN)\"\n    authentication: \"Certificate + MFA (CIP-005-7 R2.4)\"\n    controls:\n      - \"Source IP allowlisting for vendor access\"\n      - \"Time-based access windows\"\n      - \"Bandwidth rate limiting\"\n\n  dmz_intermediate_system:\n    location: \"Level 3.5 DMZ\"\n    platform: \"CyberArk Privileged Access Security or hardened jump server\"\n    function: \"Session broker - terminates external connection, initiates new internal connection\"\n    controls:\n      - \"All sessions terminate at jump server (no pass-through)\"\n      - \"Session recording with keystroke logging\"\n      - \"Clipboard and file transfer restrictions\"\n      - \"Session timeout after 30 minutes inactivity\"\n      - \"Concurrent session limits per user\"\n\n  ot_internal_access:\n    location: \"Level 3 \u002F Level 2 OT network\"\n    method: \"Jump server initiates RDP\u002FSSH\u002FVNC to OT systems\"\n    controls:\n      - \"Firewall allows only jump server IP to reach OT\"\n      - \"Protocol restricted (RDP 3389, SSH 22, VNC 5900)\"\n      - \"Destination-specific per user role\"\n\n  vendor_access:\n    description: \"Third-party vendor remote access\"\n    additional_controls:\n      - \"Vendor account disabled by default; enabled on request\"\n      - \"Time-limited access windows (enable\u002Fdisable per session)\"\n      - \"OT operator must co-attend vendor sessions\"\n      - \"Real-time session monitoring by OT security\"\n      - \"No persistent credentials - one-time access tokens\"\n\n# Network flow:\n# User -> VPN -> Firewall -> DMZ Jump Server -> Internal FW -> OT System\n# (Two separate authenticated connections; no direct routing)\n```\n\n### Step 2: Configure Jump Server with Privileged Access Management\n\nDeploy and harden the jump server in the DMZ with session management, recording, and role-based access controls.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"OT Remote Access Session Manager.\n\nManages authorized remote access sessions to OT environments\nincluding session creation, monitoring, recording, and termination.\nIntegrates with PAM solutions for credential vaulting.\n\"\"\"\n\nimport json\nimport hashlib\nimport sys\nfrom dataclasses import dataclass, field, asdict\nfrom datetime import datetime, timedelta\nfrom enum import Enum\n\n\nclass SessionState(str, Enum):\n    PENDING_APPROVAL = \"pending_approval\"\n    APPROVED = \"approved\"\n    ACTIVE = \"active\"\n    TERMINATED = \"terminated\"\n    EXPIRED = \"expired\"\n    DENIED = \"denied\"\n\n\nclass UserRole(str, Enum):\n    OT_OPERATOR = \"ot_operator\"\n    OT_ENGINEER = \"ot_engineer\"\n    VENDOR = \"vendor\"\n    SECURITY_ANALYST = \"security_analyst\"\n\n\n@dataclass\nclass RemoteAccessSession:\n    session_id: str\n    user_id: str\n    user_role: str\n    source_ip: str\n    target_system: str\n    target_ip: str\n    protocol: str\n    purpose: str\n    state: str = SessionState.PENDING_APPROVAL\n    mfa_verified: bool = False\n    approved_by: str = \"\"\n    created_at: str = \"\"\n    started_at: str = \"\"\n    ended_at: str = \"\"\n    max_duration_minutes: int = 120\n    recording_path: str = \"\"\n    actions_logged: list = field(default_factory=list)\n\n\nclass OTRemoteAccessManager:\n    \"\"\"Manages remote access sessions to OT environment.\"\"\"\n\n    def __init__(self):\n        self.sessions = {}\n        self.active_sessions = {}\n        self.access_policies = {}\n        self.audit_log = []\n\n    def define_access_policy(self, role, allowed_targets, protocols, max_duration):\n        \"\"\"Define access policy for a user role.\"\"\"\n        self.access_policies[role] = {\n            \"allowed_targets\": allowed_targets,\n            \"allowed_protocols\": protocols,\n            \"max_duration_minutes\": max_duration,\n            \"requires_co_attendance\": role == UserRole.VENDOR,\n            \"requires_approval\": role == UserRole.VENDOR,\n        }\n\n    def request_session(self, user_id, user_role, source_ip,\n                        target_system, target_ip, protocol, purpose):\n        \"\"\"Request a new remote access session.\"\"\"\n        # Generate unique session ID\n        session_id = hashlib.sha256(\n            f\"{user_id}{target_ip}{datetime.now().isoformat()}\".encode()\n        ).hexdigest()[:16]\n\n        # Check access policy\n        policy = self.access_policies.get(user_role)\n        if not policy:\n            return None, \"No access policy defined for role\"\n\n        if target_system not in policy[\"allowed_targets\"]:\n            self._audit(\"ACCESS_DENIED\", user_id, target_system,\n                       f\"Target not in allowed list for role {user_role}\")\n            return None, f\"Target {target_system} not authorized for role {user_role}\"\n\n        if protocol not in policy[\"allowed_protocols\"]:\n            self._audit(\"ACCESS_DENIED\", user_id, target_system,\n                       f\"Protocol {protocol} not allowed for role {user_role}\")\n            return None, f\"Protocol {protocol} not authorized\"\n\n        session = RemoteAccessSession(\n            session_id=session_id,\n            user_id=user_id,\n            user_role=user_role,\n            source_ip=source_ip,\n            target_system=target_system,\n            target_ip=target_ip,\n            protocol=protocol,\n            purpose=purpose,\n            max_duration_minutes=policy[\"max_duration_minutes\"],\n            created_at=datetime.now().isoformat(),\n        )\n\n        # Vendor sessions require approval\n        if policy.get(\"requires_approval\"):\n            session.state = SessionState.PENDING_APPROVAL\n        else:\n            session.state = SessionState.APPROVED\n\n        self.sessions[session_id] = session\n        self._audit(\"SESSION_REQUESTED\", user_id, target_system, purpose)\n\n        return session_id, \"Session created\"\n\n    def approve_session(self, session_id, approver_id):\n        \"\"\"Approve a pending vendor session.\"\"\"\n        session = self.sessions.get(session_id)\n        if not session:\n            return False, \"Session not found\"\n        if session.state != SessionState.PENDING_APPROVAL:\n            return False, \"Session not in pending approval state\"\n\n        session.state = SessionState.APPROVED\n        session.approved_by = approver_id\n        self._audit(\"SESSION_APPROVED\", approver_id, session.target_system,\n                    f\"Approved session {session_id} for {session.user_id}\")\n        return True, \"Session approved\"\n\n    def activate_session(self, session_id, mfa_token):\n        \"\"\"Activate an approved session after MFA verification.\"\"\"\n        session = self.sessions.get(session_id)\n        if not session or session.state != SessionState.APPROVED:\n            return False, \"Session not approved\"\n\n        # Verify MFA (simplified - real implementation calls MFA provider)\n        session.mfa_verified = True\n        session.state = SessionState.ACTIVE\n        session.started_at = datetime.now().isoformat()\n        session.recording_path = f\"\u002Frecordings\u002F{session_id}_{datetime.now().strftime('%Y%m%d')}.mp4\"\n\n        self.active_sessions[session_id] = session\n        self._audit(\"SESSION_ACTIVATED\", session.user_id, session.target_system,\n                    f\"MFA verified, recording to {session.recording_path}\")\n\n        return True, \"Session active\"\n\n    def terminate_session(self, session_id, reason=\"manual\"):\n        \"\"\"Terminate an active session.\"\"\"\n        session = self.active_sessions.pop(session_id, None)\n        if not session:\n            session = self.sessions.get(session_id)\n        if not session:\n            return False\n\n        session.state = SessionState.TERMINATED\n        session.ended_at = datetime.now().isoformat()\n        self._audit(\"SESSION_TERMINATED\", session.user_id, session.target_system, reason)\n        return True\n\n    def check_expired_sessions(self):\n        \"\"\"Terminate sessions that have exceeded their maximum duration.\"\"\"\n        now = datetime.now()\n        expired = []\n        for sid, session in list(self.active_sessions.items()):\n            started = datetime.fromisoformat(session.started_at)\n            if (now - started).total_seconds() > session.max_duration_minutes * 60:\n                self.terminate_session(sid, \"maximum_duration_exceeded\")\n                expired.append(sid)\n        return expired\n\n    def _audit(self, event_type, user_id, target, detail):\n        \"\"\"Write to audit log.\"\"\"\n        self.audit_log.append({\n            \"timestamp\": datetime.now().isoformat(),\n            \"event\": event_type,\n            \"user\": user_id,\n            \"target\": target,\n            \"detail\": detail,\n        })\n\n    def generate_report(self):\n        \"\"\"Generate remote access session report.\"\"\"\n        report = []\n        report.append(\"=\" * 70)\n        report.append(\"OT REMOTE ACCESS SESSION REPORT\")\n        report.append(f\"Date: {datetime.now().isoformat()}\")\n        report.append(\"=\" * 70)\n\n        # Session summary\n        total = len(self.sessions)\n        active = sum(1 for s in self.sessions.values() if s.state == SessionState.ACTIVE)\n        report.append(f\"\\nTotal Sessions: {total}\")\n        report.append(f\"Active Sessions: {active}\")\n\n        # Active sessions detail\n        if self.active_sessions:\n            report.append(\"\\nACTIVE SESSIONS:\")\n            for sid, s in self.active_sessions.items():\n                report.append(f\"  [{sid[:8]}] {s.user_id} ({s.user_role})\")\n                report.append(f\"    Target: {s.target_system} ({s.target_ip})\")\n                report.append(f\"    Started: {s.started_at}\")\n                report.append(f\"    MFA: {'Verified' if s.mfa_verified else 'NOT VERIFIED'}\")\n\n        return \"\\n\".join(report)\n\n\nif __name__ == \"__main__\":\n    manager = OTRemoteAccessManager()\n\n    # Define policies\n    manager.define_access_policy(\n        UserRole.OT_ENGINEER,\n        [\"HMI-01\", \"HMI-02\", \"EWS-01\", \"HISTORIAN-01\"],\n        [\"RDP\", \"SSH\"],\n        max_duration=240,\n    )\n    manager.define_access_policy(\n        UserRole.VENDOR,\n        [\"DCS-EWS-01\"],\n        [\"RDP\"],\n        max_duration=120,\n    )\n\n    # Request vendor session\n    sid, msg = manager.request_session(\n        \"vendor_honeywell_01\", UserRole.VENDOR,\n        \"203.0.113.50\", \"DCS-EWS-01\", \"10.30.1.20\",\n        \"RDP\", \"DCS firmware update per change request CR-2026-0045\")\n    print(f\"Session request: {msg} ({sid})\")\n\n    if sid:\n        manager.approve_session(sid, \"ot_manager_01\")\n        manager.activate_session(sid, \"123456\")\n        print(manager.generate_report())\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Intermediate System | System in the DMZ that terminates external connections and brokers new connections to OT, preventing direct network access per CIP-005 |\n| Jump Server | Hardened bastion host in the DMZ used for remote access sessions to OT systems with session recording and access controls |\n| Session Recording | Capture of all remote access session activity (screen, keystrokes, commands) for security audit and incident investigation |\n| Privileged Access Management (PAM) | System for vaulting credentials, controlling access, and auditing privileged sessions to critical OT systems |\n| Co-Attendance | Requirement for an OT operator to monitor vendor remote access sessions in real time |\n| Time-Limited Access | Vendor accounts enabled only for specific maintenance windows and automatically disabled after the window closes |\n\n## Tools & Systems\n\n- **CyberArk Privileged Access Security**: Enterprise PAM with session management, credential vaulting, and recording for OT remote access\n- **BeyondTrust Privileged Remote Access**: Purpose-built remote access solution with session recording and granular access policies\n- **Claroty Secure Remote Access (SRA)**: OT-specific remote access solution with protocol-aware session controls\n- **Duo Security**: MFA provider supporting push notifications, hardware tokens, and biometrics for OT access verification\n\n## Output Format\n\n```\nOT Remote Access Security Report\n===================================\nActive Sessions: [N]\nPending Approval: [N]\nSessions Today: [N]\n\nMFA COMPLIANCE:\n  All sessions MFA verified: [Yes\u002FNo]\n  Sessions without MFA: [N]\n\nVENDOR ACCESS:\n  Active vendor sessions: [N]\n  Co-attended: [N]\n  Recorded: [N]\n```\n","# Securing Remote Access to OT Environment\n\n## When to Use\n\n- When implementing or upgrading remote access architecture for OT environments\n- When onboarding vendors who require remote access to OT systems for support and maintenance\n- When implementing CIP-005-7 R2 requirements for remote access management including MFA\n- When replacing legacy direct VPN access to OT networks with a secure jump server architecture\n- When responding to an incident involving unauthorized remote access to industrial control systems\n\n**Do not use** for securing IT-only remote access without OT components, for configuring VPN for corporate workers (see general VPN guides), or for physical access control to OT facilities.\n\n## Prerequisites\n\n- DMZ infrastructure (Level 3.5) between corporate IT and OT networks\n- Jump server\u002Fbastion host platform (CyberArk, BeyondTrust, or hardened Windows\u002FLinux server)\n- Multi-factor authentication solution (Duo, RSA SecurID, YubiKey, smart cards)\n- Session recording capability for audit trail compliance\n- Firewall rules permitting remote access only through the DMZ intermediate system\n\n## Workflow\n\n### Step 1: Design Secure Remote Access Architecture\n\nImplement a defense-in-depth remote access architecture with an intermediate system in the DMZ that prevents any direct network connectivity between external users and OT systems.\n\n```yaml\n# OT Remote Access Architecture\n# Key principle: NO direct connection from external networks to OT systems\n\narchitecture:\n  external_access_point:\n    location: \"Internet-facing firewall\"\n    service: \"VPN gateway (IKEv2\u002FIPsec or SSL VPN)\"\n    authentication: \"Certificate + MFA (CIP-005-7 R2.4)\"\n    controls:\n      - \"Source IP allowlisting for vendor access\"\n      - \"Time-based access windows\"\n      - \"Bandwidth rate limiting\"\n\n  dmz_intermediate_system:\n    location: \"Level 3.5 DMZ\"\n    platform: \"CyberArk Privileged Access Security or hardened jump server\"\n    function: \"Session broker - terminates external connection, initiates new internal connection\"\n    controls:\n      - \"All sessions terminate at jump server (no pass-through)\"\n      - \"Session recording with keystroke logging\"\n      - \"Clipboard and file transfer restrictions\"\n      - \"Session timeout after 30 minutes inactivity\"\n      - \"Concurrent session limits per user\"\n\n  ot_internal_access:\n    location: \"Level 3 \u002F Level 2 OT network\"\n    method: \"Jump server initiates RDP\u002FSSH\u002FVNC to OT systems\"\n    controls:\n      - \"Firewall allows only jump server IP to reach OT\"\n      - \"Protocol restricted (RDP 3389, SSH 22, VNC 5900)\"\n      - \"Destination-specific per user role\"\n\n  vendor_access:\n    description: \"Third-party vendor remote access\"\n    additional_controls:\n      - \"Vendor account disabled by default; enabled on request\"\n      - \"Time-limited access windows (enable\u002Fdisable per session)\"\n      - \"OT operator must co-attend vendor sessions\"\n      - \"Real-time session monitoring by OT security\"\n      - \"No persistent credentials - one-time access tokens\"\n\n# Network flow:\n# User -> VPN -> Firewall -> DMZ Jump Server -> Internal FW -> OT System\n# (Two separate authenticated connections; no direct routing)\n```\n\n### Step 2: Configure Jump Server with Privileged Access Management\n\nDeploy and harden the jump server in the DMZ with session management, recording, and role-based access controls.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"OT Remote Access Session Manager.\n\nManages authorized remote access sessions to OT environments\nincluding session creation, monitoring, recording, and termination.\nIntegrates with PAM solutions for credential vaulting.\n\"\"\"\n\nimport json\nimport hashlib\nimport sys\nfrom dataclasses import dataclass, field, asdict\nfrom datetime import datetime, timedelta\nfrom enum import Enum\n\n\nclass SessionState(str, Enum):\n    PENDING_APPROVAL = \"pending_approval\"\n    APPROVED = \"approved\"\n    ACTIVE = \"active\"\n    TERMINATED = \"terminated\"\n    EXPIRED = \"expired\"\n    DENIED = \"denied\"\n\n\nclass UserRole(str, Enum):\n    OT_OPERATOR = \"ot_operator\"\n    OT_ENGINEER = \"ot_engineer\"\n    VENDOR = \"vendor\"\n    SECURITY_ANALYST = \"security_analyst\"\n\n\n@dataclass\nclass RemoteAccessSession:\n    session_id: str\n    user_id: str\n    user_role: str\n    source_ip: str\n    target_system: str\n    target_ip: str\n    protocol: str\n    purpose: str\n    state: str = SessionState.PENDING_APPROVAL\n    mfa_verified: bool = False\n    approved_by: str = \"\"\n    created_at: str = \"\"\n    started_at: str = \"\"\n    ended_at: str = \"\"\n    max_duration_minutes: int = 120\n    recording_path: str = \"\"\n    actions_logged: list = field(default_factory=list)\n\n\nclass OTRemoteAccessManager:\n    \"\"\"Manages remote access sessions to OT environment.\"\"\"\n\n    def __init__(self):\n        self.sessions = {}\n        self.active_sessions = {}\n        self.access_policies = {}\n        self.audit_log = []\n\n    def define_access_policy(self, role, allowed_targets, protocols, max_duration):\n        \"\"\"Define access policy for a user role.\"\"\"\n        self.access_policies[role] = {\n            \"allowed_targets\": allowed_targets,\n            \"allowed_protocols\": protocols,\n            \"max_duration_minutes\": max_duration,\n            \"requires_co_attendance\": role == UserRole.VENDOR,\n            \"requires_approval\": role == UserRole.VENDOR,\n        }\n\n    def request_session(self, user_id, user_role, source_ip,\n                        target_system, target_ip, protocol, purpose):\n        \"\"\"Request a new remote access session.\"\"\"\n        # Generate unique session ID\n        session_id = hashlib.sha256(\n            f\"{user_id}{target_ip}{datetime.now().isoformat()}\".encode()\n        ).hexdigest()[:16]\n\n        # Check access policy\n        policy = self.access_policies.get(user_role)\n        if not policy:\n            return None, \"No access policy defined for role\"\n\n        if target_system not in policy[\"allowed_targets\"]:\n            self._audit(\"ACCESS_DENIED\", user_id, target_system,\n                       f\"Target not in allowed list for role {user_role}\")\n            return None, f\"Target {target_system} not authorized for role {user_role}\"\n\n        if protocol not in policy[\"allowed_protocols\"]:\n            self._audit(\"ACCESS_DENIED\", user_id, target_system,\n                       f\"Protocol {protocol} not allowed for role {user_role}\")\n            return None, f\"Protocol {protocol} not authorized\"\n\n        session = RemoteAccessSession(\n            session_id=session_id,\n            user_id=user_id,\n            user_role=user_role,\n            source_ip=source_ip,\n            target_system=target_system,\n            target_ip=target_ip,\n            protocol=protocol,\n            purpose=purpose,\n            max_duration_minutes=policy[\"max_duration_minutes\"],\n            created_at=datetime.now().isoformat(),\n        )\n\n        # Vendor sessions require approval\n        if policy.get(\"requires_approval\"):\n            session.state = SessionState.PENDING_APPROVAL\n        else:\n            session.state = SessionState.APPROVED\n\n        self.sessions[session_id] = session\n        self._audit(\"SESSION_REQUESTED\", user_id, target_system, purpose)\n\n        return session_id, \"Session created\"\n\n    def approve_session(self, session_id, approver_id):\n        \"\"\"Approve a pending vendor session.\"\"\"\n        session = self.sessions.get(session_id)\n        if not session:\n            return False, \"Session not found\"\n        if session.state != SessionState.PENDING_APPROVAL:\n            return False, \"Session not in pending approval state\"\n\n        session.state = SessionState.APPROVED\n        session.approved_by = approver_id\n        self._audit(\"SESSION_APPROVED\", approver_id, session.target_system,\n                    f\"Approved session {session_id} for {session.user_id}\")\n        return True, \"Session approved\"\n\n    def activate_session(self, session_id, mfa_token):\n        \"\"\"Activate an approved session after MFA verification.\"\"\"\n        session = self.sessions.get(session_id)\n        if not session or session.state != SessionState.APPROVED:\n            return False, \"Session not approved\"\n\n        # Verify MFA (simplified - real implementation calls MFA provider)\n        session.mfa_verified = True\n        session.state = SessionState.ACTIVE\n        session.started_at = datetime.now().isoformat()\n        session.recording_path = f\"\u002Frecordings\u002F{session_id}_{datetime.now().strftime('%Y%m%d')}.mp4\"\n\n        self.active_sessions[session_id] = session\n        self._audit(\"SESSION_ACTIVATED\", session.user_id, session.target_system,\n                    f\"MFA verified, recording to {session.recording_path}\")\n\n        return True, \"Session active\"\n\n    def terminate_session(self, session_id, reason=\"manual\"):\n        \"\"\"Terminate an active session.\"\"\"\n        session = self.active_sessions.pop(session_id, None)\n        if not session:\n            session = self.sessions.get(session_id)\n        if not session:\n            return False\n\n        session.state = SessionState.TERMINATED\n        session.ended_at = datetime.now().isoformat()\n        self._audit(\"SESSION_TERMINATED\", session.user_id, session.target_system, reason)\n        return True\n\n    def check_expired_sessions(self):\n        \"\"\"Terminate sessions that have exceeded their maximum duration.\"\"\"\n        now = datetime.now()\n        expired = []\n        for sid, session in list(self.active_sessions.items()):\n            started = datetime.fromisoformat(session.started_at)\n            if (now - started).total_seconds() > session.max_duration_minutes * 60:\n                self.terminate_session(sid, \"maximum_duration_exceeded\")\n                expired.append(sid)\n        return expired\n\n    def _audit(self, event_type, user_id, target, detail):\n        \"\"\"Write to audit log.\"\"\"\n        self.audit_log.append({\n            \"timestamp\": datetime.now().isoformat(),\n            \"event\": event_type,\n            \"user\": user_id,\n            \"target\": target,\n            \"detail\": detail,\n        })\n\n    def generate_report(self):\n        \"\"\"Generate remote access session report.\"\"\"\n        report = []\n        report.append(\"=\" * 70)\n        report.append(\"OT REMOTE ACCESS SESSION REPORT\")\n        report.append(f\"Date: {datetime.now().isoformat()}\")\n        report.append(\"=\" * 70)\n\n        # Session summary\n        total = len(self.sessions)\n        active = sum(1 for s in self.sessions.values() if s.state == SessionState.ACTIVE)\n        report.append(f\"\\nTotal Sessions: {total}\")\n        report.append(f\"Active Sessions: {active}\")\n\n        # Active sessions detail\n        if self.active_sessions:\n            report.append(\"\\nACTIVE SESSIONS:\")\n            for sid, s in self.active_sessions.items():\n                report.append(f\"  [{sid[:8]}] {s.user_id} ({s.user_role})\")\n                report.append(f\"    Target: {s.target_system} ({s.target_ip})\")\n                report.append(f\"    Started: {s.started_at}\")\n                report.append(f\"    MFA: {'Verified' if s.mfa_verified else 'NOT VERIFIED'}\")\n\n        return \"\\n\".join(report)\n\n\nif __name__ == \"__main__\":\n    manager = OTRemoteAccessManager()\n\n    # Define policies\n    manager.define_access_policy(\n        UserRole.OT_ENGINEER,\n        [\"HMI-01\", \"HMI-02\", \"EWS-01\", \"HISTORIAN-01\"],\n        [\"RDP\", \"SSH\"],\n        max_duration=240,\n    )\n    manager.define_access_policy(\n        UserRole.VENDOR,\n        [\"DCS-EWS-01\"],\n        [\"RDP\"],\n        max_duration=120,\n    )\n\n    # Request vendor session\n    sid, msg = manager.request_session(\n        \"vendor_honeywell_01\", UserRole.VENDOR,\n        \"203.0.113.50\", \"DCS-EWS-01\", \"10.30.1.20\",\n        \"RDP\", \"DCS firmware update per change request CR-2026-0045\")\n    print(f\"Session request: {msg} ({sid})\")\n\n    if sid:\n        manager.approve_session(sid, \"ot_manager_01\")\n        manager.activate_session(sid, \"123456\")\n        print(manager.generate_report())\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Intermediate System | System in the DMZ that terminates external connections and brokers new connections to OT, preventing direct network access per CIP-005 |\n| Jump Server | Hardened bastion host in the DMZ used for remote access sessions to OT systems with session recording and access controls |\n| Session Recording | Capture of all remote access session activity (screen, keystrokes, commands) for security audit and incident investigation |\n| Privileged Access Management (PAM) | System for vaulting credentials, controlling access, and auditing privileged sessions to critical OT systems |\n| Co-Attendance | Requirement for an OT operator to monitor vendor remote access sessions in real time |\n| Time-Limited Access | Vendor accounts enabled only for specific maintenance windows and automatically disabled after the window closes |\n\n## Tools & Systems\n\n- **CyberArk Privileged Access Security**: Enterprise PAM with session management, credential vaulting, and recording for OT remote access\n- **BeyondTrust Privileged Remote Access**: Purpose-built remote access solution with session recording and granular access policies\n- **Claroty Secure Remote Access (SRA)**: OT-specific remote access solution with protocol-aware session controls\n- **Duo Security**: MFA provider supporting push notifications, hardware tokens, and biometrics for OT access verification\n\n## Output Format\n\n```\nOT Remote Access Security Report\n===================================\nActive Sessions: [N]\nPending Approval: [N]\nSessions Today: [N]\n\nMFA COMPLIANCE:\n  All sessions MFA verified: [Yes\u002FNo]\n  Sessions without MFA: [N]\n\nVENDOR ACCESS:\n  Active vendor sessions: [N]\n  Co-attended: [N]\n  Recorded: [N]\n```\n",{"name":5,"tags":25,"author":34,"domain":35,"license":15,"version":36,"subdomain":37,"description":38},[26,27,28,29,30,31,32,33],"ot-security","ics","scada","industrial-control","iec62443","remote-access","jump-server","mfa","mahipal","cybersecurity","1.0.0","ot-ics-security","This skill covers implementing secure remote access to OT\u002FICS environments for operators, engineers, and vendors while preventing unauthorized access that could compromise industrial operations. It addresses jump server architecture, multi-factor authentication, session recording, privileged access management, vendor remote access controls, and compliance with IEC 62443 and NERC CIP-005 remote access requirements.\n","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill securing-remote-access-to-ot-environment",{"tool":51,"command":52},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill securing-remote-access-to-ot-environment",{"tool":54,"command":55},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill securing-remote-access-to-ot-environment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fsecuring-remote-access-to-ot-environment\u002FSKILL.md",true,[59,63,69],{"path":60,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fapi-reference.md","REFERENCE","参考文档",1737,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fsecuring-remote-access-to-ot-environment\u002Freferences\u002Fapi-reference.md",{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"scripts\u002Fagent.py","SCRIPT","脚本",7218,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fsecuring-remote-access-to-ot-environment\u002Fscripts\u002Fagent.py",[76,84,91,98,105,112],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":20},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":20},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]