Windows Firewall ก็นับว่ามีส่วนช่วยในการป้องกันไวรัส ป้องกันการถูกโจมตีได้ดีในระดับหนึ่ง เนื่องจากช่วยในการปิดช่องทางการเข้าถึงระบบ อย่างน้อยก็ช่วยลดความเสี่ยงไปได้ ซึ่งวิธีการเปิด Firewall ด้วย Group Policy ก็ไม่ใช่เรื่องยาก
การเปิด Windows Firewall ด้วย GPO
เข้าไปยัง Group Policy Management จากนั้นเข้าไปตาม path ด้านล่างนี้
💻 Computer Configuration 📁 Policies 📁Windows Settings 📁Security Settings 📁Windows Firewall with Advanced Security
จากนั้นเลือกที่ Windows Firewall Properties

ในส่วนนี้ให้ตั้งค่าตาม tab ทั้ง Domain / Private / Public
ให้เลือก Firewall state เป็น On (recommended)

การ Allow Port Firewall ด้วย GPO
ยกตัวอย่างการ allow port ของ SQL Server คลิกขวาที่ Inbound Rule
» New Rule
จากนั้นเลือกไปที่ Port

เลือกเป็นแบบ TCP จากนั้นระบุ port ดังนี้ 1433,1434,135
รายละเอียด port สามารถดูจากลิงค์นี้ Ports Used By SQL Server

เลือก Allow the connection

ตรงนี้ถ้าเลือกแค่ใน Domain เครื่องอื่นที่ไม่ได้อยู่ใน domain ก็จะเข้าใช้งานไม่ได้ ดังนั้นต้องดูว่า client มีการ connect มารูปแบบไหนบ้าง

ระบุชื่อตามต้องการ เช่น Allow MSSQL
จากนั้นกด Finish

ถ้าต้องการ allow ที่ตัวโปรแกรม ก็เลือกที่ Program และเลือก path ตามรูปแบบด้านล่าง เนื่องจากการกำหนด GPO ไม่ได้กำหนดไว้ที่เครื่อง AD แต่เป็นการสั่งให้กับเครื่อง client ดังนั้นต้องอ้างอิงตาม %ProgramFiles%\path\program.exe

💻 Computer Configuration 📁 Policies 📁 Administrative Templates 📁 Network 📁 Network Connections 📁 Windows Firewall 📁 Domain Profile
จากนั้นเซ็ตค่า Protect all network connections = Enabled
, Prohibit notifications = Disabled

Result
เท่าที่ทดสอบหลังจากตั้ง Policy นี้แล้ว Windows 7, Windows 10, Windows Sever 2012 ใช้งานได้ไม่มีปัญหา Firewall ถูกตั้งค่าตาม GPO ดังรูป

Special Thank:
Abstract vector created by pch.vector – www.freepik.com
Design vector created by freepik – www.freepik.com