security logging และ monitoring ช่วยให้สามารถตรวจจับและตอบสนองต่อภัยคุกคามและเหตุการณ์ด้านความปลอดภัยได้ หากไม่มีการ logging/monitoring ที่เพียงพอ การโจมตีจะไม่ถูกสังเกตเห็น ซึ่งเป็นเหตุผลที่ "การ logging และ monitoring ที่ไม่เพียงพอ" ได้รับการยอมรับว่าเป็นความเสี่ยงด้านความปลอดภัย (OWASP)
ทำไม logging และ monitoring จึงสำคัญต่อความปลอดภัย
You can't respond to (or even know about) attacks you can't DETECT:
→ without logging/monitoring, breaches go UNNOTICED (often for months) → far more damage
→ "Security Logging and Monitoring Failures" is an OWASP Top 10 risk
→ detection is essential — you can't stop every attack, but you must DETECT and respond.
สิ่งที่ควร log และ monitor
✓ AUTHENTICATION events → logins, failures, lockouts (detect brute force/credential stuffing)
✓ ACCESS to sensitive data/actions → audit trail (who did what, when)
✓ AUTHORIZATION failures → repeated denied access (probing/attacks)
✓ Anomalies → unusual patterns, spikes, suspicious behavior, errors
✓ ADMINISTRATIVE/privileged actions; config changes; security-relevant events
⚠️ but DON'T log sensitive data (passwords, full card numbers, secrets) — that's a risk itself
