

Server Hardening คืออะไร? ทำไมต้อง Harden Server
Server Hardening คือ กระบวนการลดพื้นที่โจมตี (Attack Surface) ของ Server โดยการปิด Service ที่ไม่จำเป็น ลบ Software ที่ไม่ใช้ ตั้งค่า Security ให้เข้มงวด และ Patch สม่ำเสมอ Server ที่ติดตั้งใหม่มี Default Setting ที่ไม่ปลอดภัย Service เปิดเยอะ Password ง่าย Permission กว้าง Hardening ทำให้ Server ปลอดภัยขึ้นมาก
CIS Benchmark — มาตรฐาน Hardening
- CIS คืออะไร: Center for Internet Security ออก Benchmark สำหรับ Harden ทุก OS
- CIS Benchmark: คู่มือ Hardening ที่ละเอียดที่สุด มีทุก OS (Windows, Linux, Cloud)
- Level 1: พื้นฐาน ทุก Server ควรทำ ไม่กระทบ Functionality
- Level 2: เข้มงวดกว่า อาจกระทบ Functionality บางอย่าง สำหรับ Server สำคัญ
- ดาวน์โหลดฟรี: cisecurity.org/cis-benchmarks
Windows Server Hardening
| หมวด | สิ่งที่ต้องทำ |
|---|---|
| Account | Rename Administrator, Disable Guest, Password Policy 12+ ตัว, Account Lockout |
| Patch | Windows Update สม่ำเสมอ ใช้ WSUS/SCCM |
| Service | ปิด Service ที่ไม่ใช้ (Print Spooler, Remote Registry, SMBv1) |
| Firewall | เปิด Windows Firewall อนุญาตเฉพาะ Port ที่ต้องการ |
| RDP | ใช้ NLA, เปลี่ยน Port, จำกัด IP, ใช้ VPN |
| Audit | เปิด Audit Policy Log Logon, Account Management, Object Access |
| BitLocker | เข้ารหัส Drive ด้วย BitLocker |
| LAPS | Deploy LAPS สำหรับ Local Admin Password |
| GPO | ใช้ GPO บังคับ Security Setting ทุก Server |
Linux Server Hardening
| หมวด | สิ่งที่ต้องทำ |
|---|---|
| Account | ปิด Root SSH, ใช้ SSH Key, ไม่ใช้ Password |
| Patch | apt update / yum update สม่ำเสมอ, Unattended Upgrades |
| Service | ปิด Service ที่ไม่ใช้ (systemctl disable) |
| Firewall | ตั้ง iptables/nftables/ufw อนุญาตเฉพาะ Port ที่ต้องการ |
| SSH | เปลี่ยน Port, ปิด Root Login, ใช้ Key Auth, Fail2ban |
| Permission | ตรวจ SUID SGID, Permission ไฟล์สำคัญ (/etc/shadow 640) |
| SELinux/AppArmor | เปิด SELinux (RHEL) หรือ AppArmor (Ubuntu) |
| Audit | เปิด auditd Log การเข้าถึงไฟล์สำคัญ |
| Disk Encryption | เข้ารหัส Disk ด้วย LUKS |
Hardening Checklist ทั่วไป (ทุก OS)
- Patch: อัปเดต OS และ Software ทุกตัว ปิดช่องโหว่
- ลบ Software ไม่ใช้: ลบ Software ที่ไม่จำเป็น ลด Attack Surface
- ปิด Service ไม่ใช้: ปิด Service ที่ไม่ต้องการ
- Password Policy: กำหนด Password 12+ ตัว ซับซ้อน Lockout
- MFA: เปิด MFA สำหรับ Admin Account
- Firewall: เปิด Host Firewall อนุญาตเฉพาะ Port ที่ต้องการ
- Logging: เปิด Log ทุกอย่าง ส่งไป Central Log (SIEM)
- Backup: Backup สม่ำเสมอ ทดสอบ Restore
- Least Privilege: ให้สิทธิ์น้อยที่สุด
- Encrypt: เข้ารหัส Disk และ Data สำคัญ
Automation
- Ansible: ใช้ Ansible Playbook Harden Server อัตโนมัติ ทำซ้ำได้
- GPO: ใช้ GPO Harden Windows Server ทุกตัวพร้อมกัน
- CIS-CAT: ใช้ CIS-CAT ตรวจว่า Server Comply กับ CIS Benchmark หรือไม่
- Vulnerability Scanner: Scan Server หลัง Harden ยืนยันว่าปลอดภัย
สรุป Server Hardening — ลด Attack Surface ป้องกันก่อนถูกเจาะ
Server Hardening เป็นพื้นฐาน Security ที่ต้องทำทุก Server ใช้ CIS Benchmark Patch ปิด Service ไม่ใช้ Firewall Logging Least Privilege หากต้องการข้อมูลเพิ่มเติม ติดตามได้ที่ SiamLanCard.com