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)
- กด Win + R พิมพ์
services.mscกด Enter - หา Network Access Protection Agent (Service name:
napagent) - คลิกขวา > Properties
- Startup type: เลือก Automatic (เปิดอัตโนมัติตอนบูท) หรือ Manual (เริ่มเมื่อถูกขอ) หรือ Disabled (ปิดใช้งาน)
- ถ้าเลือก Automatic/Manual: กด Start เพื่อเริ่มทันที
- กด 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)
- เปิด
gpmc.msc(Group Policy Management) - สร้าง/แก้ไข GPO ที่ Link ไป OU ของ Client Computers
- ไป: Computer Configuration > Policies > Windows Settings > Security Settings > Network Access Protection > NAP Client Configuration > Enforcement Clients
- Enable/Disable Enforcement Clients ตามต้องการ (DHCP, VPN, 802.1X, IPsec)
- ตั้งค่า NAP Agent Service Startup ผ่าน Computer Configuration > Preferences > Control Panel Settings > Services (New > Service > napagent)
วิธีตรวจสอบสถานะ NAP Client
- PowerShell (Admin):
Get-NapClientConfiguration(ต้องมี RSAT/NAP Module) - Command:
netsh nap client show state - Event Viewer: Applications and Services Logs > Microsoft > Windows > Network Access Protection > Operational
- NAP Tracing:
netsh nap client set tracing enable-> Logs ที่%windir%\tracing\nap.log
NAP Enforcement Methods (วิธีการบังคับใช้ NAP)
| Method | คำอธิบาย | ใช้กับ |
|---|---|---|
| DHCP Enforcement | NPS ตรวจสอบ 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 Enforcement | Switch/AP (Authenticator) + NPS (Radius) + NAP Client -> VLAN Assignment (Quarantine/Full) | Wired (802.1X Ports), Wireless (WPA2/WPA3-Enterprise) |
| IPsec Enforcement | Health Certificate (HRA) Required for IPsec Auth -> Isolate Non-compliant | Server/Device Isolation, Domain Isolation |
การแก้ไขปัญหา NAP Agent (Troubleshooting)
- Service ไม่เริ่ม: ตรวจสอบ Dependencies (
NSI- Network Store Interface,EventLog), Event Viewer (NAP Operational Log), RegistryHKLM\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) - สำคัญมาก
- Assess: ระบุ NAP Policies, SHVs, Enforcement Methods, Client OS Versions
- Plan: เลือก Target: Microsoft Entra Conditional Access + Intune (Recommended) หรือ Third-party NAC (Cisco ISE, Aruba ClearPass, FortiNAC)
- Pilot: ทดสอบ Conditional Access Policies (Device Compliance, App Protection, Risk-based) กับกลุ่มผู้ใช้เล็ก
- Migrate: แทนที่ NAP Policies ด้วย Compliance Policies (Intune) + Conditional Access (Entra ID) แบบขั้นตอน
- Decommission: ปิด NPS NAP Role, Disable NAP Agent via GPO, Remove NAP-related GPOs, Cleanup Health Certificates (HRA)
- 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) ได้ดีกว่ามาก