Security & IdentitySection 1410 min read28 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 อย่างปลอดภัย

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

  • Resources ที่ Shield Advanced ปกป้อง: Amazon CloudFront distributions, Amazon Route 53 hosted zones, AWS Global Accelerator accelerators, Elastic Load Balancing (ALB / NLB / CLB), Amazon EC2 Elastic IP addresses
  • Shield Standard เปิดอัตโนมัติบน edge services (CloudFront, Route 53, Global Accelerator) สำหรับลูกค้าทุกคน
  • Shield Advanced เพิ่ม L7 DDoS protection (ผ่าน WAF integration), DRT 24/7, และ DDoS cost protection ให้ resources ข้างต้น
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)
  • Services ที่ WAF ผูกได้ (attach points): Amazon CloudFront distributions, Application Load Balancer (ALB), Amazon API Gateway (REST APIs), AWS AppSync (GraphQL APIs), Amazon Cognito user pools
  • WAF ผูกที่ front door / load balancer เสมอ — ไม่ ผูกกับ EC2 instance โดยตรง (ไม่มี agent บน OS)
  • WAF ใช้ไม่ได้กับ Network Load Balancer (NLB) เพราะ NLB ทำงานที่ Layer 4 (TCP/UDP) ส่วน WAF เป็น Layer 7

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

AWS Firewall Manager

AWS Firewall Manager คือบริการ centralized policy management สำหรับจัดการกฎความปลอดภัยข้ามหลาย account ใน AWS Organizations — ใช้กำหนด WAF rules, Shield Advanced, Security Groups, และ Network Firewall จากที่เดียว

  • ใช้คู่กับ AWS Organizations — apply policy ครอบคลุมทุก account ในองค์กร
  • Manages: WAF Web ACLs, Shield Advanced protections, VPC Security Groups, AWS Network Firewall, Route 53 Resolver DNS Firewall
  • Auto-applies policy ให้ account ใหม่ ที่เพิ่งเพิ่มเข้า Organization โดยอัตโนมัติ
  • ช่วยรวมศูนย์ compliance — เห็นภาพรวมว่ามี resource ไหนยังไม่เป็นไปตาม policy
05

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)

06

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)

07

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

08

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 สูงและความเป็นส่วนตัวเต็มที่

09

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
10

AWS Secrets Manager

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

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

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)

12

AWS Audit Manager

AWS Audit Manager เก็บหลักฐาน (evidence) เกี่ยวกับการใช้งาน AWS ของคุณ อัตโนมัติและต่อเนื่อง เพื่อ map กับ frameworks ต่าง ๆ เช่น SOC 2, PCI DSS, GDPR, HIPAA, ISO 27001 — ลดงาน manual ในการเตรียมข้อมูลสำหรับ audit

AWS Artifact

ดาวน์โหลด compliance reports ของ AWS (ISO, PCI, SOC) — เป็นหลักฐานว่า AWS ผ่านมาตรฐาน

AWS Audit Manager

สร้าง evidence ของคุณเอง — ตรวจสอบว่า workload ของคุณ เป็นไปตาม framework ที่เลือก โดยรวบรวม config + logs + activity ให้อัตโนมัติ

  • Pre-built frameworks: SOC 2, PCI DSS, GDPR, HIPAA, ISO 27001, CIS, AWS Foundational Security Best Practices ฯลฯ
  • เก็บ evidence จาก CloudTrail, Config, Security Hub ฯลฯ
  • สร้าง assessment report ที่พร้อมส่งให้ auditor
13

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 ขโมยข้อมูลออกไป

14

Amazon Inspector

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

  • Target = EC2 instances (รวม container image และ Lambda function ในเวอร์ชันใหม่)
  • ต้องติดตั้ง AWS Systems Manager (SSM) Agent บน EC2 (Inspector v2 ใช้ SSM Agent — ไม่ต้องการ Inspector Agent แยก)
  • วิเคราะห์ OS vulnerabilities และ network reachability
  • Output = vulnerability report เรียงตามความรุนแรง
15

AWS Config

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

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

Amazon Macie

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

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

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)
18

Amazon Detective

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

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

AWS Abuse

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

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

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
21

Summary

Shield Standard / Advanced

ป้องกัน DDoS — Standard ฟรี (อัตโนมัติบน CloudFront / Route 53 / Global Accelerator), Advanced $3,000/เดือน + DRT 24/7 (ปกป้อง CloudFront, Route 53, Global Accelerator, ELB, EC2 EIP)

WAF

Layer 7 firewall — ป้องกัน SQL injection, XSS, geo-block ผูกได้กับ CloudFront, ALB, API Gateway, AppSync, Cognito user pools (ไม่ผูกกับ EC2 / NLB)

Firewall Manager

Centralized policy ข้ามหลาย account ใน AWS Organizations — manage WAF, Shield Advanced, Security Groups, Network Firewall จากที่เดียว

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 ของ AWS (ISO, PCI, SOC, BAA)

Audit Manager

เก็บ evidence อัตโนมัติเพื่อ map กับ frameworks (SOC 2, PCI DSS, HIPAA, GDPR, ISO) — สร้าง assessment report ของ workload คุณเอง

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 ที่ถูกใช้ในทางผิด

ทดสอบ

คำถามทบทวน

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

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

Which statement BEST describes the difference between AWS Shield Standard and AWS Shield Advanced?