Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> ความปลอดภัยเครือข่าย

เปิดใช้งาน Network Access Protection (NAP) Agent บน Windows 8 / 8.1

Network Access Protection (NAP) Agent คืออะไร?

Network Access Protection (NAP) เป็นเทคโนโลยีของ Microsoft (Deprecated since Windows 10/Server 2016) ที่ช่วยให้ผู้ดูแลระบบบังคับนโยบายสุขภาพระบบ (System Health Policy) ให้กับ Client Computers ก่อนอนุญาตให้เข้าถึงเครือข่ายองค์กร (Corporate Network) NAP Agent เป็น Service ที่รันบน Client เพื่อเก็บข้อมูลสุขภาพ (Health Information) และส่งให้ NAP Server (NPS - Network Policy Server) ประเมิน

⚠️ สำคัญ: NAP ถูก Deprecated (เลิกพัฒนา) และถูกแทนที่ด้วย Conditional Access (Azure AD / Microsoft Entra ID) และ Microsoft Intune / Endpoint Manager สำหรับการจัดการอุปกรณ์และการเข้าถึงแบบสมัยใหม่ ไม่ควรใช้ NAP สำหรับการติดตั้งใหม่

ควรเปิด NAP Agent หรือไม่? (Should I Enable It?)

  • สำหรับ Home/Personal Use: ไม่ควรเปิด - ไม่มี NAP Server (NPS) ให้ตรวจสอบ ไม่มีประโยชน์ แตกินทรัพยากรระบบ
  • สำหรับ Enterprise (Domain-joined) ที่ยังใช้ NPS/NAP Legacy: อาจจำเป็นต้องเปิด ถ้าองค์กรยังไม่ได้ Migrate ไป Conditional Access/Intune
  • Default ใน Windows 8/8.1: NAP Agent Service (napagent) ตั้งค่าเป็น Manual (Trigger Start) - จะเริ่มทำงานเมื่อมี NAP Enforcement Client (เช่น DHCP, VPN, 802.1X, IPsec) ขอการตรวจสอบ

วิธีเปิด/ปิด NAP Agent Service (Windows 8 / 8.1)

วิธีที่ 1: ผ่าน Services.msc (GUI)

  1. กด Win + R พิมพ์ services.msc กด Enter
  2. หา Network Access Protection Agent (Service name: napagent)
  3. คลิกขวา > Properties
  4. Startup type: เลือก Automatic (เปิดอัตโนมัติตอนบูท) หรือ Manual (เริ่มเมื่อถูกขอ) หรือ Disabled (ปิดใช้งาน)
  5. ถ้าเลือก Automatic/Manual: กด Start เพื่อเริ่มทันที
  6. กด OK

วิธีที่ 2: ผ่าน Command Line (CMD / PowerShell Admin)

REM Enable & Start
sc config napagent start= auto
net start napagent

REM Disable & Stop
net stop napagent
sc config napagent start= disabled
# PowerShell
Set-Service -Name napagent -StartupType Automatic -Status Running  # Enable
Set-Service -Name napagent -StartupType Disabled -Status Stopped   # Disable

วิธีที่ 3: ผ่าน Group Policy (สำหรับ Domain Environment)

  1. เปิด gpmc.msc (Group Policy Management)
  2. สร้าง/แก้ไข GPO ที่ Link ไป OU ของ Client Computers
  3. ไป: Computer Configuration > Policies > Windows Settings > Security Settings > Network Access Protection > NAP Client Configuration > Enforcement Clients
  4. Enable/Disable Enforcement Clients ตามต้องการ (DHCP, VPN, 802.1X, IPsec)
  5. ตั้งค่า NAP Agent Service Startup ผ่าน Computer Configuration > Preferences > Control Panel Settings > Services (New > Service > napagent)

วิธีตรวจสอบสถานะ NAP Client

  1. PowerShell (Admin): Get-NapClientConfiguration (ต้องมี RSAT/NAP Module)
  2. Command: netsh nap client show state
  3. Event Viewer: Applications and Services Logs > Microsoft > Windows > Network Access Protection > Operational
  4. NAP Tracing: netsh nap client set tracing enable -> Logs ที่ %windir%\tracing\nap.log

NAP Enforcement Methods (วิธีการบังคับใช้ NAP)

Methodคำอธิบายใช้กับ
DHCP EnforcementNPS ตรวจสอบ Health ก่อนให้ DHCP Lease (Full/Restricted)Wired/Wireless Clients (IPv4)
VPN Enforcement (RRAS)NPS ตรวจสอบ Health ก่อนอนุญาต VPN Connection (IPsec, SSTP, IKEv2)Remote Access VPN Clients
802.1X EnforcementSwitch/AP (Authenticator) + NPS (Radius) + NAP Client -> VLAN Assignment (Quarantine/Full)Wired (802.1X Ports), Wireless (WPA2/WPA3-Enterprise)
IPsec EnforcementHealth Certificate (HRA) Required for IPsec Auth -> Isolate Non-compliantServer/Device Isolation, Domain Isolation

การแก้ไขปัญหา NAP Agent (Troubleshooting)

  • Service ไม่เริ่ม: ตรวจสอบ Dependencies (NSI - Network Store Interface, EventLog), Event Viewer (NAP Operational Log), Registry HKLM\SYSTEM\CurrentControlSet\Services\napagent
  • Health Policy ไม่ Match: ตรวจสอบ SHV (System Health Validator) บน NPS และ SHA (System Health Agent) บน Client (Windows Update, Firewall, Antivirus, Spyware, Custom SHV)
  • Client ไม่ได้รับ IP / VPN Fail / 802.1X Fail: ตรวจสอบ NPS Event Logs (Event ID 4402, 4403, 4404, 4405), Client NAP Logs, Network Traces (Netsh Trace)
  • Performance Issue: NAP Agent ใช้ Resource น้อยมาก หากสูงตรวจสอบ SHV Custom หรือ Malware Scan

เส้นทางการย้ายถิ่น (Migration Path) - สำคัญมาก

  1. Assess: ระบุ NAP Policies, SHVs, Enforcement Methods, Client OS Versions
  2. Plan: เลือก Target: Microsoft Entra Conditional Access + Intune (Recommended) หรือ Third-party NAC (Cisco ISE, Aruba ClearPass, FortiNAC)
  3. Pilot: ทดสอบ Conditional Access Policies (Device Compliance, App Protection, Risk-based) กับกลุ่มผู้ใช้เล็ก
  4. Migrate: แทนที่ NAP Policies ด้วย Compliance Policies (Intune) + Conditional Access (Entra ID) แบบขั้นตอน
  5. Decommission: ปิด NPS NAP Role, Disable NAP Agent via GPO, Remove NAP-related GPOs, Cleanup Health Certificates (HRA)
  6. Validate: ตรวจสอบว่า Clients ทุกเครื่อง Compliant ตามนโยบายใหม่ และเข้าถึงทรัพยากรได้ตามปกติ

สรุป

NAP Agent ใน Windows 8/8.1 เป็น Legacy Technology สำหรับ Enterprise Network Access Control ที่ใช้ NPS/Health Policies ไม่เหมาะสำหรับการใช้งานใหม่หรือ Home Use องค์กรควรวางแผนย้ายไป Microsoft Entra Conditional Access + Intune (Zero Trust) ซึ่งให้ความปลอดภัย ดูแลง่ายกว่า และรองรับ Modern Work (Cloud, Mobile, Remote) ได้ดีกว่ามาก