[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECNJFAVM15NB0RHW32MD73":3,"skill-same:01M7ECNJFAVM15NB0RHW32MD73":77},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M7ECNJFAVM15NB0RHW32MD73","implementing-nerc-cip-compliance-controls",null,"Implements NERC CIP controls for Bulk Electric System (BES) cyber systems: asset categorization (CIP-002), electronic security perimeters (CIP-005), system security management (CIP-007), configuration management (CIP-010), and supply chain risk (CIP-013), including 2025 MFA updates. Use when a registered entity must achieve or maintain NERC CIP compliance, prepare for a Regional Entity audit, or categorize newly commissioned BES cyber systems.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Fimplementing-nerc-cip-compliance-controls\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-nerc-cip-compliance-controls\ndescription: 'Implements NERC CIP controls for Bulk Electric System (BES) cyber systems: asset\n  categorization (CIP-002), electronic security perimeters (CIP-005), system security\n  management (CIP-007), configuration management (CIP-010), and supply chain risk\n  (CIP-013), including 2025 MFA updates. Use when a registered entity must achieve\n  or maintain NERC CIP compliance, prepare for a Regional Entity audit, or categorize\n  newly commissioned BES cyber systems.\n\n  '\ndomain: cybersecurity\nsubdomain: ot-ics-security\ntags:\n- ot-security\n- ics\n- scada\n- industrial-control\n- iec62443\n- nerc-cip\n- power-grid\n- compliance\nversion: 1.0.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- T1195\n- T1554\n---\n\n# Implementing NERC CIP Compliance Controls\n\n## When to Use\n\n- When a registered entity must achieve or maintain NERC CIP compliance for BES cyber systems\n- When preparing for a NERC CIP compliance audit by the Regional Entity\n- When implementing the 2025 CIP standard updates (CIP-003-9, CIP-005-7, CIP-010-4, CIP-013-2)\n- When categorizing BES cyber systems after commissioning new generation, transmission, or control center assets\n- When developing a compliance monitoring and evidence collection program\n\n**Do not use** for non-BES industrial systems (see implementing-iec-62443-security-zones), for general IT compliance frameworks (see auditing-cloud-with-cis-benchmarks), or for physical security of substations without cyber components.\n\n## Prerequisites\n\n- Understanding of NERC CIP standards (CIP-002 through CIP-014)\n- BES cyber system inventory with impact ratings (high, medium, low)\n- Access to Electronic Security Perimeter (ESP) network diagrams and firewall configurations\n- Compliance management system for evidence collection and audit documentation\n- Familiarity with NERC Glossary of Terms (BES Cyber Asset, BES Cyber System, Electronic Access Point)\n\n## Workflow\n\n### Step 1: Categorize BES Cyber Systems (CIP-002-5.1a)\n\nIdentify and categorize all BES cyber systems based on their impact to the reliable operation of the Bulk Electric System.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"NERC CIP BES Cyber System Categorization Tool.\n\nImplements CIP-002-5.1a categorization criteria to classify\nBES cyber systems as high, medium, or low impact.\n\"\"\"\n\nimport json\nimport sys\nfrom dataclasses import dataclass, field, asdict\nfrom datetime import datetime\n\n\n@dataclass\nclass BESCyberSystem:\n    \"\"\"Represents a BES Cyber System for CIP-002 categorization.\"\"\"\n    system_id: str\n    name: str\n    description: str\n    location: str\n    asset_type: str  # control_center, generation, transmission, distribution\n    connected_mw: float = 0\n    transmission_kv: float = 0\n    is_control_center: bool = False\n    is_backup_control_center: bool = False\n    has_cranking_path: bool = False\n    has_blackstart: bool = False\n    is_sps_ras: bool = False  # Special Protection System \u002F Remedial Action Scheme\n    impact_rating: str = \"\"  # high, medium, low\n    categorization_basis: str = \"\"\n    cyber_assets: list = field(default_factory=list)\n\n\nclass CIP002Categorizer:\n    \"\"\"NERC CIP-002-5.1a BES Cyber System categorization engine.\"\"\"\n\n    def __init__(self):\n        self.systems = []\n        self.categorization_date = datetime.now().isoformat()\n\n    def add_system(self, system: BESCyberSystem):\n        self.systems.append(system)\n\n    def categorize_all(self):\n        \"\"\"Apply CIP-002 Attachment 1 criteria to all systems.\"\"\"\n        for system in self.systems:\n            self._categorize_system(system)\n\n    def _categorize_system(self, sys):\n        \"\"\"Apply high, medium, low impact criteria per CIP-002 Attachment 1.\"\"\"\n\n        # HIGH IMPACT criteria (CIP-002 Attachment 1, Criterion 1)\n        if sys.is_control_center and sys.asset_type == \"control_center\":\n            # Control Centers that perform the functional obligations\n            # of a Reliability Coordinator, Balancing Authority, or TOP\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 1.1: Control Center performing \"\n                \"RC\u002FBA\u002FTOP functional obligations\"\n            )\n            return\n\n        if sys.is_backup_control_center and sys.asset_type == \"control_center\":\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 1.2: Backup Control Center performing \"\n                \"RC\u002FBA\u002FTOP functional obligations\"\n            )\n            return\n\n        if sys.connected_mw >= 3000:\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 1.3: Generation >= 3000 MW \"\n                f\"(actual: {sys.connected_mw} MW)\"\n            )\n            return\n\n        # MEDIUM IMPACT criteria (CIP-002 Attachment 1, Criterion 2)\n        if sys.connected_mw >= 1500 and sys.asset_type == \"generation\":\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 2.1: Generation >= 1500 MW \"\n                f\"(actual: {sys.connected_mw} MW)\"\n            )\n            return\n\n        if sys.transmission_kv >= 500:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 2.5: Transmission >= 500 kV \"\n                f\"(actual: {sys.transmission_kv} kV)\"\n            )\n            return\n\n        if sys.has_cranking_path:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.6: Cranking path element\"\n            )\n            return\n\n        if sys.has_blackstart:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.7: Blackstart resource\"\n            )\n            return\n\n        if sys.is_sps_ras:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.9: SPS\u002FRAS component\"\n            )\n            return\n\n        if sys.is_control_center and sys.asset_type == \"generation\":\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.11: Generation control center \"\n                \"for medium impact generation\"\n            )\n            return\n\n        # LOW IMPACT - all other BES Cyber Systems\n        sys.impact_rating = \"low\"\n        sys.categorization_basis = (\n            \"CIP-002 Att.1 Criterion 3: BES Cyber System not meeting \"\n            \"high or medium impact criteria\"\n        )\n\n    def generate_report(self):\n        \"\"\"Generate CIP-002 categorization report.\"\"\"\n        high = [s for s in self.systems if s.impact_rating == \"high\"]\n        medium = [s for s in self.systems if s.impact_rating == \"medium\"]\n        low = [s for s in self.systems if s.impact_rating == \"low\"]\n\n        report = []\n        report.append(\"=\" * 70)\n        report.append(\"NERC CIP-002-5.1a BES CYBER SYSTEM CATEGORIZATION\")\n        report.append(f\"Date: {self.categorization_date}\")\n        report.append(\"=\" * 70)\n        report.append(f\"\\nTotal BES Cyber Systems: {len(self.systems)}\")\n        report.append(f\"  High Impact: {len(high)}\")\n        report.append(f\"  Medium Impact: {len(medium)}\")\n        report.append(f\"  Low Impact: {len(low)}\")\n\n        for category, systems in [(\"HIGH\", high), (\"MEDIUM\", medium), (\"LOW\", low)]:\n            if systems:\n                report.append(f\"\\n--- {category} IMPACT SYSTEMS ---\")\n                for s in systems:\n                    report.append(f\"  [{s.system_id}] {s.name}\")\n                    report.append(f\"    Location: {s.location}\")\n                    report.append(f\"    Type: {s.asset_type}\")\n                    report.append(f\"    Basis: {s.categorization_basis}\")\n                    report.append(f\"    Cyber Assets: {len(s.cyber_assets)}\")\n\n        return \"\\n\".join(report)\n\n    def export_json(self, output_file):\n        \"\"\"Export categorization to JSON for compliance evidence.\"\"\"\n        data = {\n            \"categorization_date\": self.categorization_date,\n            \"standard\": \"CIP-002-5.1a\",\n            \"systems\": [asdict(s) for s in self.systems],\n        }\n        with open(output_file, \"w\") as f:\n            json.dump(data, f, indent=2)\n\n\nif __name__ == \"__main__\":\n    categorizer = CIP002Categorizer()\n\n    # Example BES Cyber Systems\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-001\", name=\"Main Energy Control Center EMS\",\n        description=\"Energy Management System for BA operations\",\n        location=\"Control Center Alpha\", asset_type=\"control_center\",\n        is_control_center=True))\n\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-002\", name=\"Wind Farm SCADA\",\n        description=\"SCADA for 500MW wind generation facility\",\n        location=\"Wind Farm Delta\", asset_type=\"generation\",\n        connected_mw=500))\n\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-003\", name=\"Substation Alpha RTU\",\n        description=\"345kV transmission substation\",\n        location=\"Substation Alpha\", asset_type=\"transmission\",\n        transmission_kv=345))\n\n    categorizer.categorize_all()\n    print(categorizer.generate_report())\n```\n\n### Step 2: Implement Electronic Security Perimeters (CIP-005-7)\n\nDefine and enforce Electronic Security Perimeters (ESP) around high and medium impact BES cyber systems with Electronic Access Points (EAP) at all boundary crossing points.\n\n```bash\n# Electronic Security Perimeter - Firewall Configuration\n# CIP-005-7 R1: Electronic Security Perimeter\n\n# Define ESP boundary for Control Center EMS (High Impact)\n# All BES Cyber Assets within the ESP boundary\n\n# Palo Alto PA-3260 - ESP Boundary Firewall\n\n# Inbound rules - strictly limit what enters the ESP\n# CIP-005-7 R1.3: All inbound\u002Foutbound access permissions documented\n\n# Allow ICCP (Inter-Control Center Communications Protocol) from neighbor BA\nset rulebase security rules ICCP-Inbound from Corporate-Zone to ESP-Zone\nset rulebase security rules ICCP-Inbound source 192.168.100.10\nset rulebase security rules ICCP-Inbound destination 10.20.1.50\nset rulebase security rules ICCP-Inbound application iccp\nset rulebase security rules ICCP-Inbound service application-default\nset rulebase security rules ICCP-Inbound action allow\nset rulebase security rules ICCP-Inbound log-setting CIP-Audit-Log\n\n# Allow NTP for time synchronization (CIP-007 R5.7)\nset rulebase security rules NTP-Inbound from Corporate-Zone to ESP-Zone\nset rulebase security rules NTP-Inbound source 192.168.100.1\nset rulebase security rules NTP-Inbound destination 10.20.1.1\nset rulebase security rules NTP-Inbound application ntp\nset rulebase security rules NTP-Inbound action allow\n\n# CIP-005-7 R2: Remote Access Management\n# Require Intermediate System for all remote access sessions\n# CIP-005-7 R2.4: Multi-factor authentication required (2025 update)\n\nset rulebase security rules RemoteAccess from External to DMZ-Zone\nset rulebase security rules RemoteAccess destination 172.16.1.10\nset rulebase security rules RemoteAccess application ssl-vpn\nset rulebase security rules RemoteAccess action allow\n# MFA enforced on Intermediate System (jump server)\n\n# Default deny all other traffic\nset rulebase security rules ESP-Default-Deny from any to ESP-Zone\nset rulebase security rules ESP-Default-Deny action deny\nset rulebase security rules ESP-Default-Deny log-setting CIP-Audit-Log\n```\n\n### Step 3: Implement System Security Management (CIP-007-6)\n\nConfigure security controls for BES cyber assets including port management, security patching, malicious code prevention, and security event monitoring.\n\n```yaml\n# CIP-007-6 Implementation Checklist\n\ncip_007_controls:\n  R1_ports_services:\n    description: \"Ports and Services Management\"\n    requirements:\n      - \"Disable or restrict all unnecessary physical ports (USB, serial)\"\n      - \"Disable all unnecessary logical ports and services\"\n      - \"Document all enabled ports\u002Fservices with business justification\"\n    implementation:\n      windows_servers: |\n        # Disable unnecessary services on Windows BES Cyber Assets\n        Set-Service -Name \"RemoteRegistry\" -StartupType Disabled\n        Set-Service -Name \"WinRM\" -StartupType Disabled\n        Set-Service -Name \"Spooler\" -StartupType Disabled\n        # Disable USB storage via Group Policy\n        # Computer Config > Admin Templates > System > Removable Storage Access\n      linux_servers: |\n        # Disable unnecessary services\n        systemctl disable cups bluetooth avahi-daemon\n        systemctl mask cups bluetooth avahi-daemon\n        # Disable USB storage\n        echo \"blacklist usb-storage\" > \u002Fetc\u002Fmodprobe.d\u002Fdisable-usb.conf\n\n  R2_security_patches:\n    description: \"Security Patch Management\"\n    requirements:\n      - \"Track security patches for all BES Cyber Systems\"\n      - \"Evaluate patches within 35 days of availability\"\n      - \"Apply patches or document mitigation plan\"\n      - \"Test patches in non-production before deployment\"\n    implementation:\n      tracking: \"Use WSUS\u002FSCCM for Windows; yum\u002Fdnf for Linux\"\n      testing: \"Maintain staging environment mirroring production\"\n      evidence: \"Document patch evaluation in compliance tracking system\"\n\n  R3_malicious_code:\n    description: \"Malicious Code Prevention\"\n    requirements:\n      - \"Deploy anti-malware on all applicable BES Cyber Assets\"\n      - \"Update signatures or use application allowlisting\"\n      - \"Mitigate threats from transient cyber assets\"\n    implementation:\n      servers: \"CrowdFalcon or Carbon Black with OT-optimized policy\"\n      hmi_stations: \"Application allowlisting (Carbon Black App Control)\"\n      transient_devices: \"Scan all removable media before connection to BCA\"\n\n  R4_security_event_monitoring:\n    description: \"Security Event Monitoring\"\n    requirements:\n      - \"Log security events on all high\u002Fmedium impact BCS\"\n      - \"Generate alerts for detected security events\"\n      - \"Retain logs for minimum 90 days (CIP-007-6 R4.3)\"\n      - \"Review logs at minimum every 15 days\"\n    implementation:\n      siem: \"Splunk Enterprise Security with CIP content pack\"\n      log_sources:\n        - \"ESP boundary firewall logs\"\n        - \"EAP authentication logs\"\n        - \"BES Cyber Asset authentication success\u002Ffailure\"\n        - \"Remote access session logs\"\n        - \"Malicious code detection events\"\n      retention: \"90 days online, 3 years archived\"\n\n  R5_system_access:\n    description: \"System Access Control\"\n    requirements:\n      - \"Enforce authentication for all interactive access\"\n      - \"Implement least-privilege access control\"\n      - \"Change default passwords\"\n      - \"Enforce password complexity (CIP-007-6 R5.5)\"\n      - \"Limit unsuccessful login attempts\"\n    implementation:\n      password_policy:\n        min_length: 8\n        complexity: \"Mixed case + numbers + special characters\"\n        max_age_days: 365\n        lockout_threshold: 5\n        lockout_duration_minutes: 30\n      shared_accounts: \"Document all shared\u002Fservice accounts with authorization\"\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| BES Cyber System | Group of one or more BES Cyber Assets that perform a reliability function for the Bulk Electric System |\n| Electronic Security Perimeter (ESP) | Logical border surrounding a network containing BES Cyber Systems, with all traffic flowing through Electronic Access Points |\n| Electronic Access Point (EAP) | Interface on the ESP boundary that controls traffic flowing in and out of the ESP |\n| Intermediate System | System used for remote access that prevents direct connectivity to BES Cyber Assets (jump server) |\n| Transient Cyber Asset | Device that is directly connected to a BES Cyber System for less than 30 consecutive calendar days (laptops, USB drives) |\n| NERC Glossary | Official definitions used in CIP standards; precise terminology required for compliance |\n\n## Tools & Systems\n\n- **Tripwire Enterprise**: Configuration compliance monitoring and file integrity monitoring for CIP-010 baseline management\n- **Splunk with CIP Content Pack**: SIEM with pre-built CIP-007 security event monitoring dashboards and alerts\n- **Carbon Black App Control**: Application allowlisting for HMI stations and BES cyber assets (CIP-007 R3)\n- **Trellix\u002FMcAfee ePO**: Endpoint protection with OT-optimized scanning policies for BES cyber assets\n\n## Output Format\n\n```\nNERC CIP Compliance Assessment Report\n=======================================\nEntity: [Registered Entity Name]\nDate: YYYY-MM-DD\nStandards: CIP-002 through CIP-014\n\nBES CYBER SYSTEM CATEGORIZATION:\n  High Impact: [N] systems\n  Medium Impact: [N] systems\n  Low Impact: [N] systems\n\nCOMPLIANCE STATUS BY STANDARD:\n  CIP-002: [Compliant\u002FPartial\u002FNon-Compliant]\n  CIP-005: [Status] - [N] gaps identified\n  CIP-007: [Status] - [N] gaps identified\n  CIP-010: [Status] - [N] gaps identified\n  CIP-013: [Status] - [N] gaps identified\n```\n","# Implementing NERC CIP Compliance Controls\n\n## When to Use\n\n- When a registered entity must achieve or maintain NERC CIP compliance for BES cyber systems\n- When preparing for a NERC CIP compliance audit by the Regional Entity\n- When implementing the 2025 CIP standard updates (CIP-003-9, CIP-005-7, CIP-010-4, CIP-013-2)\n- When categorizing BES cyber systems after commissioning new generation, transmission, or control center assets\n- When developing a compliance monitoring and evidence collection program\n\n**Do not use** for non-BES industrial systems (see implementing-iec-62443-security-zones), for general IT compliance frameworks (see auditing-cloud-with-cis-benchmarks), or for physical security of substations without cyber components.\n\n## Prerequisites\n\n- Understanding of NERC CIP standards (CIP-002 through CIP-014)\n- BES cyber system inventory with impact ratings (high, medium, low)\n- Access to Electronic Security Perimeter (ESP) network diagrams and firewall configurations\n- Compliance management system for evidence collection and audit documentation\n- Familiarity with NERC Glossary of Terms (BES Cyber Asset, BES Cyber System, Electronic Access Point)\n\n## Workflow\n\n### Step 1: Categorize BES Cyber Systems (CIP-002-5.1a)\n\nIdentify and categorize all BES cyber systems based on their impact to the reliable operation of the Bulk Electric System.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"NERC CIP BES Cyber System Categorization Tool.\n\nImplements CIP-002-5.1a categorization criteria to classify\nBES cyber systems as high, medium, or low impact.\n\"\"\"\n\nimport json\nimport sys\nfrom dataclasses import dataclass, field, asdict\nfrom datetime import datetime\n\n\n@dataclass\nclass BESCyberSystem:\n    \"\"\"Represents a BES Cyber System for CIP-002 categorization.\"\"\"\n    system_id: str\n    name: str\n    description: str\n    location: str\n    asset_type: str  # control_center, generation, transmission, distribution\n    connected_mw: float = 0\n    transmission_kv: float = 0\n    is_control_center: bool = False\n    is_backup_control_center: bool = False\n    has_cranking_path: bool = False\n    has_blackstart: bool = False\n    is_sps_ras: bool = False  # Special Protection System \u002F Remedial Action Scheme\n    impact_rating: str = \"\"  # high, medium, low\n    categorization_basis: str = \"\"\n    cyber_assets: list = field(default_factory=list)\n\n\nclass CIP002Categorizer:\n    \"\"\"NERC CIP-002-5.1a BES Cyber System categorization engine.\"\"\"\n\n    def __init__(self):\n        self.systems = []\n        self.categorization_date = datetime.now().isoformat()\n\n    def add_system(self, system: BESCyberSystem):\n        self.systems.append(system)\n\n    def categorize_all(self):\n        \"\"\"Apply CIP-002 Attachment 1 criteria to all systems.\"\"\"\n        for system in self.systems:\n            self._categorize_system(system)\n\n    def _categorize_system(self, sys):\n        \"\"\"Apply high, medium, low impact criteria per CIP-002 Attachment 1.\"\"\"\n\n        # HIGH IMPACT criteria (CIP-002 Attachment 1, Criterion 1)\n        if sys.is_control_center and sys.asset_type == \"control_center\":\n            # Control Centers that perform the functional obligations\n            # of a Reliability Coordinator, Balancing Authority, or TOP\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 1.1: Control Center performing \"\n                \"RC\u002FBA\u002FTOP functional obligations\"\n            )\n            return\n\n        if sys.is_backup_control_center and sys.asset_type == \"control_center\":\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 1.2: Backup Control Center performing \"\n                \"RC\u002FBA\u002FTOP functional obligations\"\n            )\n            return\n\n        if sys.connected_mw >= 3000:\n            sys.impact_rating = \"high\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 1.3: Generation >= 3000 MW \"\n                f\"(actual: {sys.connected_mw} MW)\"\n            )\n            return\n\n        # MEDIUM IMPACT criteria (CIP-002 Attachment 1, Criterion 2)\n        if sys.connected_mw >= 1500 and sys.asset_type == \"generation\":\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 2.1: Generation >= 1500 MW \"\n                f\"(actual: {sys.connected_mw} MW)\"\n            )\n            return\n\n        if sys.transmission_kv >= 500:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                f\"CIP-002 Att.1 Criterion 2.5: Transmission >= 500 kV \"\n                f\"(actual: {sys.transmission_kv} kV)\"\n            )\n            return\n\n        if sys.has_cranking_path:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.6: Cranking path element\"\n            )\n            return\n\n        if sys.has_blackstart:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.7: Blackstart resource\"\n            )\n            return\n\n        if sys.is_sps_ras:\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.9: SPS\u002FRAS component\"\n            )\n            return\n\n        if sys.is_control_center and sys.asset_type == \"generation\":\n            sys.impact_rating = \"medium\"\n            sys.categorization_basis = (\n                \"CIP-002 Att.1 Criterion 2.11: Generation control center \"\n                \"for medium impact generation\"\n            )\n            return\n\n        # LOW IMPACT - all other BES Cyber Systems\n        sys.impact_rating = \"low\"\n        sys.categorization_basis = (\n            \"CIP-002 Att.1 Criterion 3: BES Cyber System not meeting \"\n            \"high or medium impact criteria\"\n        )\n\n    def generate_report(self):\n        \"\"\"Generate CIP-002 categorization report.\"\"\"\n        high = [s for s in self.systems if s.impact_rating == \"high\"]\n        medium = [s for s in self.systems if s.impact_rating == \"medium\"]\n        low = [s for s in self.systems if s.impact_rating == \"low\"]\n\n        report = []\n        report.append(\"=\" * 70)\n        report.append(\"NERC CIP-002-5.1a BES CYBER SYSTEM CATEGORIZATION\")\n        report.append(f\"Date: {self.categorization_date}\")\n        report.append(\"=\" * 70)\n        report.append(f\"\\nTotal BES Cyber Systems: {len(self.systems)}\")\n        report.append(f\"  High Impact: {len(high)}\")\n        report.append(f\"  Medium Impact: {len(medium)}\")\n        report.append(f\"  Low Impact: {len(low)}\")\n\n        for category, systems in [(\"HIGH\", high), (\"MEDIUM\", medium), (\"LOW\", low)]:\n            if systems:\n                report.append(f\"\\n--- {category} IMPACT SYSTEMS ---\")\n                for s in systems:\n                    report.append(f\"  [{s.system_id}] {s.name}\")\n                    report.append(f\"    Location: {s.location}\")\n                    report.append(f\"    Type: {s.asset_type}\")\n                    report.append(f\"    Basis: {s.categorization_basis}\")\n                    report.append(f\"    Cyber Assets: {len(s.cyber_assets)}\")\n\n        return \"\\n\".join(report)\n\n    def export_json(self, output_file):\n        \"\"\"Export categorization to JSON for compliance evidence.\"\"\"\n        data = {\n            \"categorization_date\": self.categorization_date,\n            \"standard\": \"CIP-002-5.1a\",\n            \"systems\": [asdict(s) for s in self.systems],\n        }\n        with open(output_file, \"w\") as f:\n            json.dump(data, f, indent=2)\n\n\nif __name__ == \"__main__\":\n    categorizer = CIP002Categorizer()\n\n    # Example BES Cyber Systems\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-001\", name=\"Main Energy Control Center EMS\",\n        description=\"Energy Management System for BA operations\",\n        location=\"Control Center Alpha\", asset_type=\"control_center\",\n        is_control_center=True))\n\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-002\", name=\"Wind Farm SCADA\",\n        description=\"SCADA for 500MW wind generation facility\",\n        location=\"Wind Farm Delta\", asset_type=\"generation\",\n        connected_mw=500))\n\n    categorizer.add_system(BESCyberSystem(\n        system_id=\"BCS-003\", name=\"Substation Alpha RTU\",\n        description=\"345kV transmission substation\",\n        location=\"Substation Alpha\", asset_type=\"transmission\",\n        transmission_kv=345))\n\n    categorizer.categorize_all()\n    print(categorizer.generate_report())\n```\n\n### Step 2: Implement Electronic Security Perimeters (CIP-005-7)\n\nDefine and enforce Electronic Security Perimeters (ESP) around high and medium impact BES cyber systems with Electronic Access Points (EAP) at all boundary crossing points.\n\n```bash\n# Electronic Security Perimeter - Firewall Configuration\n# CIP-005-7 R1: Electronic Security Perimeter\n\n# Define ESP boundary for Control Center EMS (High Impact)\n# All BES Cyber Assets within the ESP boundary\n\n# Palo Alto PA-3260 - ESP Boundary Firewall\n\n# Inbound rules - strictly limit what enters the ESP\n# CIP-005-7 R1.3: All inbound\u002Foutbound access permissions documented\n\n# Allow ICCP (Inter-Control Center Communications Protocol) from neighbor BA\nset rulebase security rules ICCP-Inbound from Corporate-Zone to ESP-Zone\nset rulebase security rules ICCP-Inbound source 192.168.100.10\nset rulebase security rules ICCP-Inbound destination 10.20.1.50\nset rulebase security rules ICCP-Inbound application iccp\nset rulebase security rules ICCP-Inbound service application-default\nset rulebase security rules ICCP-Inbound action allow\nset rulebase security rules ICCP-Inbound log-setting CIP-Audit-Log\n\n# Allow NTP for time synchronization (CIP-007 R5.7)\nset rulebase security rules NTP-Inbound from Corporate-Zone to ESP-Zone\nset rulebase security rules NTP-Inbound source 192.168.100.1\nset rulebase security rules NTP-Inbound destination 10.20.1.1\nset rulebase security rules NTP-Inbound application ntp\nset rulebase security rules NTP-Inbound action allow\n\n# CIP-005-7 R2: Remote Access Management\n# Require Intermediate System for all remote access sessions\n# CIP-005-7 R2.4: Multi-factor authentication required (2025 update)\n\nset rulebase security rules RemoteAccess from External to DMZ-Zone\nset rulebase security rules RemoteAccess destination 172.16.1.10\nset rulebase security rules RemoteAccess application ssl-vpn\nset rulebase security rules RemoteAccess action allow\n# MFA enforced on Intermediate System (jump server)\n\n# Default deny all other traffic\nset rulebase security rules ESP-Default-Deny from any to ESP-Zone\nset rulebase security rules ESP-Default-Deny action deny\nset rulebase security rules ESP-Default-Deny log-setting CIP-Audit-Log\n```\n\n### Step 3: Implement System Security Management (CIP-007-6)\n\nConfigure security controls for BES cyber assets including port management, security patching, malicious code prevention, and security event monitoring.\n\n```yaml\n# CIP-007-6 Implementation Checklist\n\ncip_007_controls:\n  R1_ports_services:\n    description: \"Ports and Services Management\"\n    requirements:\n      - \"Disable or restrict all unnecessary physical ports (USB, serial)\"\n      - \"Disable all unnecessary logical ports and services\"\n      - \"Document all enabled ports\u002Fservices with business justification\"\n    implementation:\n      windows_servers: |\n        # Disable unnecessary services on Windows BES Cyber Assets\n        Set-Service -Name \"RemoteRegistry\" -StartupType Disabled\n        Set-Service -Name \"WinRM\" -StartupType Disabled\n        Set-Service -Name \"Spooler\" -StartupType Disabled\n        # Disable USB storage via Group Policy\n        # Computer Config > Admin Templates > System > Removable Storage Access\n      linux_servers: |\n        # Disable unnecessary services\n        systemctl disable cups bluetooth avahi-daemon\n        systemctl mask cups bluetooth avahi-daemon\n        # Disable USB storage\n        echo \"blacklist usb-storage\" > \u002Fetc\u002Fmodprobe.d\u002Fdisable-usb.conf\n\n  R2_security_patches:\n    description: \"Security Patch Management\"\n    requirements:\n      - \"Track security patches for all BES Cyber Systems\"\n      - \"Evaluate patches within 35 days of availability\"\n      - \"Apply patches or document mitigation plan\"\n      - \"Test patches in non-production before deployment\"\n    implementation:\n      tracking: \"Use WSUS\u002FSCCM for Windows; yum\u002Fdnf for Linux\"\n      testing: \"Maintain staging environment mirroring production\"\n      evidence: \"Document patch evaluation in compliance tracking system\"\n\n  R3_malicious_code:\n    description: \"Malicious Code Prevention\"\n    requirements:\n      - \"Deploy anti-malware on all applicable BES Cyber Assets\"\n      - \"Update signatures or use application allowlisting\"\n      - \"Mitigate threats from transient cyber assets\"\n    implementation:\n      servers: \"CrowdFalcon or Carbon Black with OT-optimized policy\"\n      hmi_stations: \"Application allowlisting (Carbon Black App Control)\"\n      transient_devices: \"Scan all removable media before connection to BCA\"\n\n  R4_security_event_monitoring:\n    description: \"Security Event Monitoring\"\n    requirements:\n      - \"Log security events on all high\u002Fmedium impact BCS\"\n      - \"Generate alerts for detected security events\"\n      - \"Retain logs for minimum 90 days (CIP-007-6 R4.3)\"\n      - \"Review logs at minimum every 15 days\"\n    implementation:\n      siem: \"Splunk Enterprise Security with CIP content pack\"\n      log_sources:\n        - \"ESP boundary firewall logs\"\n        - \"EAP authentication logs\"\n        - \"BES Cyber Asset authentication success\u002Ffailure\"\n        - \"Remote access session logs\"\n        - \"Malicious code detection events\"\n      retention: \"90 days online, 3 years archived\"\n\n  R5_system_access:\n    description: \"System Access Control\"\n    requirements:\n      - \"Enforce authentication for all interactive access\"\n      - \"Implement least-privilege access control\"\n      - \"Change default passwords\"\n      - \"Enforce password complexity (CIP-007-6 R5.5)\"\n      - \"Limit unsuccessful login attempts\"\n    implementation:\n      password_policy:\n        min_length: 8\n        complexity: \"Mixed case + numbers + special characters\"\n        max_age_days: 365\n        lockout_threshold: 5\n        lockout_duration_minutes: 30\n      shared_accounts: \"Document all shared\u002Fservice accounts with authorization\"\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| BES Cyber System | Group of one or more BES Cyber Assets that perform a reliability function for the Bulk Electric System |\n| Electronic Security Perimeter (ESP) | Logical border surrounding a network containing BES Cyber Systems, with all traffic flowing through Electronic Access Points |\n| Electronic Access Point (EAP) | Interface on the ESP boundary that controls traffic flowing in and out of the ESP |\n| Intermediate System | System used for remote access that prevents direct connectivity to BES Cyber Assets (jump server) |\n| Transient Cyber Asset | Device that is directly connected to a BES Cyber System for less than 30 consecutive calendar days (laptops, USB drives) |\n| NERC Glossary | Official definitions used in CIP standards; precise terminology required for compliance |\n\n## Tools & Systems\n\n- **Tripwire Enterprise**: Configuration compliance monitoring and file integrity monitoring for CIP-010 baseline management\n- **Splunk with CIP Content Pack**: SIEM with pre-built CIP-007 security event monitoring dashboards and alerts\n- **Carbon Black App Control**: Application allowlisting for HMI stations and BES cyber assets (CIP-007 R3)\n- **Trellix\u002FMcAfee ePO**: Endpoint protection with OT-optimized scanning policies for BES cyber assets\n\n## Output Format\n\n```\nNERC CIP Compliance Assessment Report\n=======================================\nEntity: [Registered Entity Name]\nDate: YYYY-MM-DD\nStandards: CIP-002 through CIP-014\n\nBES CYBER SYSTEM CATEGORIZATION:\n  High Impact: [N] systems\n  Medium Impact: [N] systems\n  Low Impact: [N] systems\n\nCOMPLIANCE STATUS BY STANDARD:\n  CIP-002: [Compliant\u002FPartial\u002FNon-Compliant]\n  CIP-005: [Status] - [N] gaps identified\n  CIP-007: [Status] - [N] gaps identified\n  CIP-010: [Status] - [N] gaps identified\n  CIP-013: [Status] - [N] gaps identified\n```\n",{"name":5,"tags":24,"author":33,"domain":34,"license":15,"version":35,"nist_csf":36,"subdomain":41,"description":42,"mitre_attack":43},[25,26,27,28,29,30,31,32],"ot-security","ics","scada","industrial-control","iec62443","nerc-cip","power-grid","compliance","mahipal","cybersecurity","1.0.0",[37,38,39,40],"PR.IR-01","DE.CM-01","ID.AM-05","GV.OC-02","ot-ics-security","Implements NERC CIP controls for Bulk Electric System (BES) cyber systems: asset categorization (CIP-002), electronic security perimeters (CIP-005), system security management (CIP-007), configuration management (CIP-010), and supply chain risk (CIP-013), including 2025 MFA updates. Use when a registered entity must achieve or maintain NERC CIP compliance, prepare for a Regional Entity audit, or categorize newly commissioned BES cyber systems.\n",[44,45,46,47,48],"T1078","T1190","T1059","T1195","T1554","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","03-逆向工程\u002Fimplementing-nerc-cip-compliance-controls",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill implementing-nerc-cip-compliance-controls",{"tool":63,"command":64},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill implementing-nerc-cip-compliance-controls",{"tool":66,"command":67},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill implementing-nerc-cip-compliance-controls","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Fimplementing-nerc-cip-compliance-controls\u002FSKILL.md",true,[71],{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fapi-reference.md","REFERENCE","参考文档",1534,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Fimplementing-nerc-cip-compliance-controls\u002Freferences\u002Fapi-reference.md",[78,87,92,99,106,113],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":88,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":86},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":86},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":86},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":86},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":86},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]