Security & IdentitySection 148 min read8 questions

Security & Compliance

Shield, WAF, KMS, GuardDuty & more

รวมบริการด้านความปลอดภัยของ AWS — ตั้งแต่การป้องกัน DDoS (Shield, WAF), การเข้ารหัสข้อมูล (KMS, CloudHSM, ACM), การจัดการความลับ (Secrets Manager), การตรวจจับภัยคุกคาม (GuardDuty, Inspector, Macie, Detective) ไปจนถึงการรวมศูนย์ความปลอดภัย (Security Hub) และเอกสาร compliance (Artifact) — พร้อม Shared Responsibility Model ที่เป็นหัวใจของการใช้งาน AWS อย่างปลอดภัย

ในหน้านี้19 sections
  1. 01Shared Responsibility Model (Deep Dive)
  2. 02DDoS Protection on AWS
  3. 03AWS WAF (Web Application Firewall)
  4. 04Penetration Testing on AWS
  5. 05Encryption: At Rest vs In Transit
  6. 06AWS KMS (Key Management Service)
  7. 07AWS CloudHSM
  8. 08AWS Certificate Manager (ACM)
  9. 09AWS Secrets Manager
  10. 10AWS Artifact
  11. 11Amazon GuardDuty
  12. 12Amazon Inspector
  13. 13AWS Config
  14. 14Amazon Macie
  15. 15AWS Security Hub
  16. 16Amazon Detective
  17. 17AWS Abuse
  18. 18Root User Privileges
  19. 19Summary
01

Shared Responsibility Model (Deep Dive)

AWS ใช้โมเดล Shared Responsibility — แบ่งความรับผิดชอบระหว่าง AWS กับลูกค้าอย่างชัดเจน เพื่อไม่ให้เกิดช่องว่างด้านความปลอดภัย

AWS — Security OF the Cloud

ดูแล infrastructure ทั้งหมด: hardware, software, facilities (data center), networking ของภูมิภาค/AZ และ managed services เช่น S3, DynamoDB, RDS — รับประกัน availability, durability ของบริการ

Customer — Security IN the Cloud

ดูแลทุกอย่างที่อยู่ บน cloud: guest OS patching ของ EC2, firewall + network config, IAM users/roles/policies, การเข้ารหัสข้อมูลของแอป, classify ข้อมูล

Shared Controls

Patch Management (AWS patch infra, คุณ patch OS), Configuration Management (AWS config infra, คุณ config service), Awareness + Training (ทั้งสองฝ่ายฝึกอบรมพนักงาน)

ตัวอย่าง: RDS

AWS: จัดการ EC2 ที่อยู่เบื้องหลัง, auto patching ของ DB engine, automated backup infra. You: Security Group / IP rules, สร้าง DB users + permission, เปิด encryption at rest, ตั้ง public access

ตัวอย่าง: S3

AWS: infrastructure, durability 99.999999999%, แยกข้อมูลพนักงาน AWS ออกจากข้อมูลลูกค้า. You: bucket configuration, bucket policy, IAM permission, encryption settings (SSE), versioning, replication

02

DDoS Protection on AWS

AWS ป้องกัน DDoS แบบ multi-layered — ผสมหลายบริการเพื่อป้องกันทั้ง network layer และ application layer

AWS Shield Standard

FREE สำหรับลูกค้า AWS ทุกคน เปิดอัตโนมัติ — ป้องกัน SYN/UDP floods, reflection attacks และ DDoS ระดับ Layer 3/4 อื่นๆ

AWS Shield Advanced

$3,000/เดือน/องค์กร — มี 24/7 DDoS Response Team (DRT), ป้องกัน EC2 / ELB / CloudFront / Global Accelerator / Route 53 จากการโจมตีที่ซับซ้อน + ป้องกันค่าใช้จ่ายที่พุ่งสูงจาก DDoS (DDoS cost protection)

AWS WAF

Web Application Firewall — กรอง request ตามกฎ (rules) ที่กำหนด ป้องกัน SQL injection, XSS, geo-blocking ฯลฯ

CloudFront + Route 53

ใช้ edge network ของ AWS กระจายโหลดทั่วโลก — ช่วย absorb traffic spike และเป็น first line of defense

03

AWS WAF (Web Application Firewall)

AWS WAF ปกป้องเว็บแอปพลิเคชันจากช่องโหว่ Layer 7 (HTTP) — เช่น SQL injection, XSS, bot attack

  • Deploy บน Application Load Balancer (ALB), API Gateway, หรือ CloudFront
  • กำหนด Web ACL (Access Control List) ที่มี rules ตามต้องการ
  • ปกป้องเฉพาะ Layer 7 (HTTP) — ไม่ใช่ Layer 3/4 (DDoS ใช้ Shield)

Rules ที่ใช้บ่อย

IP addresses, HTTP headers, HTTP body, URI strings — match แบบ exact หรือ regex

Attack Protection

SQL injection, Cross-Site Scripting (XSS), common web exploits

Size Constraints

จำกัดขนาด request — ป้องกันการส่ง payload ใหญ่ผิดปกติ

Geo-match

บล็อกหรืออนุญาต traffic จากบางประเทศ (geo-blocking)

Rate-based Rules

จำกัดจำนวน request ต่อ IP ในช่วงเวลา — ป้องกัน brute force, scraping

04

Penetration Testing on AWS

AWS อนุญาตให้ทำ penetration testing โดยไม่ต้องขออนุญาตล่วงหน้า สำหรับ 8 services เท่านั้น

Services ที่อนุญาต

EC2 / NAT Gateway / ELB, RDS, CloudFront, Aurora, API Gateway, Lambda + Lambda@Edge, Lightsail, Elastic Beanstalk

กิจกรรมที่ห้าม

DNS zone walking ผ่าน Route 53, DoS / DDoS / simulated DDoS, port flooding, protocol flooding, request flooding (login flooding, API flooding)

05

Encryption: At Rest vs In Transit

Encryption At Rest

ข้อมูลที่ เก็บอยู่บน disk — เช่น Hard Disk, RDS database, S3 Glacier — เข้ารหัสด้วย encryption key เพื่อกันคนเอา disk ไปอ่าน

Encryption In Transit (in flight)

ข้อมูลที่ กำลังเดินทางผ่าน network — เช่น on-premise → AWS, EC2 → DynamoDB — ใช้ TLS/SSL กันการดักฟัง (eavesdropping, MITM)

06

AWS KMS (Key Management Service)

AWS KMS เป็นบริการที่ให้ AWS ช่วยจัดการ encryption keys — ใช้ผสานกับบริการอื่นๆ เพื่อเข้ารหัสข้อมูลได้ง่าย

Encryption Opt-in (เลือกเปิดเอง)

EBS volumes, S3 (SSE), Redshift, RDS, EFS — default ไม่ได้เข้ารหัส ต้องเปิดเอง

Encryption Automatic (เปิดให้เลย)

CloudTrail Logs, S3 Glacier, Storage Gateway — AWS เข้ารหัสอัตโนมัติทุกบริการเลย ปิดไม่ได้

KMS มี CMK (Customer Master Keys) 4 ประเภท:

Customer Managed CMK

คุณสร้างเอง + กำหนด policy + rotate ได้เอง — ควบคุมเต็มที่ (มีค่าใช้จ่าย $1/เดือน/key)

AWS Managed CMK

AWS สร้างให้สำหรับใช้กับ service ของ AWS — เช่น aws/s3, aws/ebs, aws/rds (ฟรี)

AWS Owned CMK

AWS เป็นเจ้าของ ใช้ภายในของ AWS เอง — คุณ ดูไม่ได้ และไม่ต้องจัดการ (ฟรี)

CloudHSM Keys

Custom keystore ที่เชื่อมไปยัง CloudHSM cluster ของคุณ — สำหรับงานที่ต้อง FIPS 140-2 Level 3

07

AWS CloudHSM

AWS CloudHSM = Hardware Security Module — ฮาร์ดแวร์เฉพาะ tamper-resistant ที่ใช้จัดเก็บ + ประมวลผล encryption keys

  • AWS จัดเตรียม hardware ให้ — แต่คุณเป็นคนจัดการ keys (ไม่ใช่ AWS)
  • ผ่านมาตรฐาน FIPS 140-2 Level 3 — สูงกว่า KMS
  • เหมาะกับ workload ที่กฎหมาย/compliance บังคับให้ใช้ HSM ฮาร์ดแวร์
  • สามารถ integrate กับ KMS ผ่าน custom keystore ได้

KMS

Software-based — AWS เป็นคนจัดการ underlying — ใช้ง่าย ราคาถูก เหมาะกับ workload ทั่วไป

CloudHSM

Hardware-based — คุณเป็นคนจัดการ keys — เหมาะกับ workload ที่ต้องการ compliance สูงและความเป็นส่วนตัวเต็มที่

08

AWS Certificate Manager (ACM)

AWS Certificate Manager (ACM) ช่วย provision, manage, deploy SSL/TLS certificates เพื่อทำ HTTPS (in-flight encryption)

  • รองรับทั้ง Public และ Private TLS certificates
  • ฟรี สำหรับ public TLS certificates
  • Auto-renewal — ต่ออายุให้อัตโนมัติ ไม่ต้องจัดการเอง
  • Integrate กับ Elastic Load Balancer (ELB), CloudFront, API Gateway
09

AWS Secrets Manager

AWS Secrets Manager เก็บความลับเช่น database password, API key — ดีกว่าฝังในโค้ดหรือ config

  • บังคับ rotation ทุก X วันได้
  • Auto-generate รหัสใหม่ผ่าน Lambda function
  • Integrate กับ RDS (MySQL, PostgreSQL, Aurora) โดยตรง
  • Secrets ถูกเข้ารหัสด้วย KMS เสมอ
10

AWS Artifact

AWS Artifact เป็น portal สำหรับดาวน์โหลดเอกสาร compliance ของ AWS — ไม่ใช่ "service" ในความหมายเทคนิค

Artifact Reports

ดาวน์โหลดรายงาน security + compliance ของ AWS เช่น ISO, PCI, SOC reports — สำหรับใช้ตรวจสอบกับ auditor ของคุณ

Artifact Agreements

ตรวจสอบ / ยอมรับ / ติดตาม agreements กับ AWS เช่น BAA (Business Associate Agreement สำหรับ HIPAA)

11

Amazon GuardDuty

Amazon GuardDuty ใช้ Machine Learning + anomaly detection + 3rd party threat intel เพื่อตรวจจับ threat ใน account อย่างชาญฉลาด — เปิดใช้แค่คลิกเดียว (มี 30-day trial)

CloudTrail Logs

ตรวจ API call ที่ผิดปกติ — เช่น user สร้าง resource ในประเทศที่ไม่เคยใช้

VPC Flow Logs

ตรวจ traffic / IP ที่ผิดปกติ — เช่น instance สื่อสารกับ malicious IP ที่ AWS รู้จัก

DNS Logs

ตรวจ EC2 ที่อาจถูก compromise แล้วใช้ DNS query ขโมยข้อมูลออกไป

12

Amazon Inspector

Amazon Inspector ทำ automated security assessment ให้ EC2 — วิเคราะห์ OS ที่กำลังรันว่ามี vulnerabilities หรือ unintended network exposure ไหม

  • Target = EC2 instances (รวม container image และ Lambda function ในเวอร์ชันใหม่)
  • ต้องติดตั้ง Inspector Agent บน OS ของ instance
  • วิเคราะห์ OS vulnerabilities และ network reachability
  • Output = vulnerability report เรียงตามความรุนแรง
13

AWS Config

AWS Config ใช้ audit + record compliance ของ resource ในบัญชีของคุณตลอดเวลา (รายละเอียดเต็มอยู่ในหัวข้อ Cloud Monitoring)

  • Track configuration changes ของแต่ละ resource ตามกาลเวลา
  • ทำงานต่อ region — แต่ aggregate ข้ามหลาย region / account ได้
  • Integrate กับ Security Hub ได้ (เป็น prerequisite ของ Security Hub)
14

Amazon Macie

Amazon Macie เป็นบริการ fully managed data security + privacy — ใช้ Machine Learning + pattern matching ค้นหาและปกป้องข้อมูลละเอียดอ่อนใน S3

  • Specialized: ตรวจ PII (Personally Identifiable Information) ใน S3 buckets
  • ตรวจชื่อ ที่อยู่ เลขบัตรเครดิต เลขบัตรประชาชน ฯลฯ
  • แจ้งเตือนผ่าน CloudWatch Events / EventBridge
15

AWS Security Hub

AWS Security Hub = ศูนย์กลาง security ที่รวม alert จากหลายบริการ + หลาย account — ดูภาพรวมความปลอดภัยทั้งองค์กรได้จากที่เดียว

  • รวม alert จาก GuardDuty, Inspector, Macie, IAM Access Analyzer, Systems Manager, Firewall Manager และ partner products
  • ต้องเปิดใช้ AWS Config ก่อน (prerequisite)
  • เหมาะกับ multi-account environments (AWS Organizations)
16

Amazon Detective

GuardDuty / Macie / Security Hub ตรวจพบปัญหา — แต่ Amazon Detective ใช้ วิเคราะห์ + สอบสวน root cause ของปัญหานั้น

  • ใช้ Machine Learning + graph theory สร้างภาพความสัมพันธ์ของ event
  • ดึงข้อมูลจาก VPC Flow Logs + CloudTrail + GuardDuty
  • ช่วยให้ analyst ทำ root cause analysis ได้รวดเร็ว
17

AWS Abuse

ถ้าพบว่า resource ของ AWS ถูกใช้ในทางที่ผิด สามารถรายงานผ่าน AWS Abuse ได้

  • Spam — email spam ที่มาจาก IP ของ AWS
  • Port scanning, DoS / DDoS attack, intrusion attempt
  • Hosting copyrighted หรือ objectionable content
  • การแพร่กระจาย malware
18

Root User Privileges

Root user = เจ้าของ AWS account ที่มีสิทธิ์ เต็มที่ — ห้ามใช้ในงานประจำ ควร lock away access keys และเปิด MFA ทันที

งานต่อไปนี้ มีแต่ root user เท่านั้นที่ทำได้:

  • Change account settings (name, email, root password, root access keys)
  • View tax invoices
  • Close AWS account
  • Restore IAM permissions เมื่อ admin user เผลอ revoke ตัวเอง
  • Change/cancel AWS Support Plan
  • Register เป็น seller ใน Reserved Instance Marketplace
  • Configure S3 MFA Delete
  • Edit S3 bucket policy ที่มี invalid VPC ID
  • Sign up สำหรับ AWS GovCloud
19

Summary

Shield Standard / Advanced

ป้องกัน DDoS — Standard ฟรี, Advanced $3,000/เดือน + DRT 24/7

WAF

Layer 7 firewall — ป้องกัน SQL injection, XSS, geo-block

KMS

จัดการ encryption keys (software-based, AWS ช่วยจัดการ)

CloudHSM

Hardware HSM, FIPS 140-2 Level 3 — คุณจัดการ keys เอง

ACM

Provision SSL/TLS certificates — public ฟรี + auto-renewal

Secrets Manager

เก็บ + rotate secrets อัตโนมัติ (RDS integration)

Artifact

Portal โหลดเอกสาร compliance (ISO, PCI, SOC, BAA)

GuardDuty

Threat detection ด้วย ML จาก CloudTrail + VPC Flow + DNS Logs

Inspector

Vulnerability assessment สำหรับ EC2 (ต้อง install agent)

Macie

ค้นหา PII ใน S3 ด้วย ML

Security Hub

ศูนย์กลาง security ที่รวม alert จากบริการอื่นๆ

Detective

สอบสวน root cause ด้วย ML + graph

Config

Audit + record compliance per region

Abuse

รายงาน resource ที่ถูกใช้ในทางผิด

ทดสอบ

คำถามทบทวน

8 ข้อ — เลือกคำตอบเพื่อดูเฉลยและคำอธิบาย

ข้อ 1 / 8คะแนน 0

ข้อใดอธิบายความแตกต่างระหว่าง AWS Shield Standard และ AWS Shield Advanced ได้ถูกต้อง?