OSI Model และ TCP/IP กับ Network Security
OSI Model (7 Layers) และความปลอดภัย
OSI Model ช่วยให้เข้าใจว่า ภัยคุกคามแต่ละชนิดโจมตีเลเยอร์ไหน และ การป้องกันควรวางที่เลเยอร์ไหน
| Layer | ชื่อ | ภัยคุกคามหลัก | การป้องกัน/Security Controls |
|---|---|---|---|
| 7 | Application | SQLi, XSS, Malware, Phishing, DDoS App Layer | WAF, Secure Coding, Input Validation, API Security |
| 6 | Presentation | Encoding attacks, SSL/TLS exploits | TLS 1.3, Certificate Pinning, Encryption |
| 5 | Session | Session Hijacking, Fixation | Secure Session Management, HTTPS Only |
| 4 | Transport | TCP SYN Flood, UDP Flood, Port Scanning | Firewall, Rate Limiting, TCP Hardening |
| 3 | Network | IP Spoofing, Routing Attacks, ICMP Flood | IPsec, ACL, Router Hardening, BGP Security |
| 2 | Data Link | ARP Spoofing, MAC Flooding, VLAN Hopping, STP Attacks | Port Security, DAI, DHCP Snooping, BPDU Guard |
| 1 | Physical | Wiretapping, Cable Tapping, Hardware Implants | Physical Security, Fiber Monitoring, Port Locks |
TCP/IP Model (4/5 Layers) และความปลอดภัย
TCP/IP เป็นโมเดลปฏิบัติจริง (Practical) ใช้ใน Internet จริง
| TCP/IP Layer | เทียบ OSI | Security Focus |
|---|---|---|
| Application | L5-L7 | App Security, TLS, DNSSEC, Email Security (DMARC/DKIM/SPF) |
| Transport | L4 | TCP/UDP Security, TLS/SSL, QUIC |
| Internet (Network) | L3 | IPsec, IPv6 Security, Routing Security (RPKI) |
| Network Access | L1-L2 | Wi-Fi Security (WPA3), 802.1X, MACsec, Physical |
จุดสำคัญ: ทำไม TCP/IP "ไม่ปลอดภัย" ต้นฉบับ?
- ออกแบบมาเพื่อ Openness และ Interoperability ไม่ได้ออกแบบมาเพื่อ Security
- ไม่มี Authentication/Encryption ในตัว (IP, TCP, UDP, ICMP)
- IP Address Spoofing ง่าย เพราะไม่ verify source
- ต้องพึ่ง Add-on Protocols: TLS (L4), IPsec (L3), DNSSEC, SSH
TCP vs UDP ด้าน Security
- TCP: Reliable, Sequenced, มี Handshake → ใช้ทำ SYN Flood, Session Hijacking
- UDP: Stateless, ไม่มี Handshake → ใช้ทำ Amplification/Reflection DDoS (DNS, NTP, Memcached)
Security Layers (Defense in Depth)
ไม่ควรพึ่ง Layer เดียว ต้องมี:
- Perimeter: Firewall, IPS/IDS, WAF
- Network: Segmentation, VLAN, ACL, Zero Trust
- Endpoint: EDR, Antivirus, Hardening
- Application: Secure Code, WAF, API Gateway
- Data: Encryption (At rest/In transit), DLP
- Human: Security Awareness, Phishing Simulation
สรุป
- OSI ช่วย วิเคราะห์และออกแบบ** การป้องกันแบบครบวงจร
- TCP/IP เป็นความจริงในการทำงาน → ต้อง加固 (Harden) ทุก Layer
- Network Layer (L3) สำคัญที่สุดสำหรับ IPsec (VPN, Site-to-Site)
- Transport Layer (L4) สำคัญสำหรับ TLS/SSL (HTTPS, Secure API)