CCSP · Domain 5 · 16%

Vận hành bảo mật đám mây

Cloud Security Operations

Vận hành SOC trong môi trường đám mây: CSPM, cloud SIEM, incident response và forensics trên cloud, vulnerability management, IAM operations (PIM/JIT), threat intelligence, và BCP/DR multi-region — mọi thứ cần để duy trì bảo mật 24/7 trên cloud.

Mục tiêu chương / Learning objectives

1. Lý thuyết cốt lõi / Core theory

1.1. Cloud Security Posture Management — CSPM (CSPM tools)

CSPM liên tục scan cloud configurations và so sánh với security benchmarks (CIS, NIST, PCI DSS). Khi phát hiện deviation → alert hoặc auto-remediate:

CCSP key concept — CSPM vs CWPP: CSPM bảo vệ cloud configuration (control plane security). CWPP (Cloud Workload Protection Platform) bảo vệ workloads đang chạy (runtime security: VMs, containers, serverless). CNAPP = cả hai. Trong exam, phân biệt: "S3 bucket public" → CSPM finding; "malware in EC2 instance" → CWPP finding.

1.2. Cloud SIEM Integration (Cloud SIEM)

Cloud tạo ra khối lượng log khổng lồ. SIEM tập trung thu thập, normalize, correlate, và alert:

1.3. Cloud Incident Response & Forensics (Cloud IR & forensics)

Cloud IR khác với on-premises IR ở nhiều điểm quan trọng:

1.4. Cloud Vulnerability Management & IAM Operations (Vuln mgmt & IAM ops)

Cloud-native vulnerability scanning:

IAM Operations — JIT & PIM:

1.5. JIT Secrets Rotation (Just-in-time secrets & dynamic credentials)

JIT secrets sinh credentials theo yêu cầu, tự thu hồi sau TTL — không tồn tại long-lived static secrets trong code hoặc config:

# AWS Secrets Manager: rotate ngay lập tức
aws secretsmanager rotate-secret --secret-id mydb-secret

# HashiCorp Vault dynamic secrets workflow
# 1. Enable database secrets engine
vault secrets enable database

# 2. Configure PostgreSQL connection
vault write database/config/mydb \
  plugin_name=postgresql-database-plugin \
  allowed_roles="app-role" \
  connection_url="postgresql://{{username}}:{{password}}@db.example.com/mydb" \
  username="vault-admin" password="admin-pass"

# 3. Define role với TTL 1 giờ
vault write database/roles/app-role \
  db_name=mydb \
  creation_statements="CREATE ROLE '{{name}}' WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}';" \
  default_ttl="1h" max_ttl="24h"

# 4. App request credential (credential tự expire sau 1h)
vault read database/creds/app-role
# => username: v-app-role-xKj7p3 | password: A-3kQr2mP9... | lease_duration: 1h

Kết quả mong đợi: vault read database/creds/app-role trả về JSON với lease_id, username, password, và lease_duration: 3600. Sau TTL, Vault tự động DROP USER trong PostgreSQL. aws secretsmanager rotate-secret trả về VersionId mới — kiểm tra bằng aws secretsmanager get-secret-value --secret-id mydb-secret.

1.6. Chaos Security Engineering (Chaos Security Engineering)

Chaos Security Engineering mở rộng chaos engineering truyền thống: chủ động inject failures để kiểm tra khả năng phục hồi bảo mật — không chỉ availability mà còn detection, response, và secrets resilience:

Lab — AWS FIS Security Chaos Experiment:

Platform: AWS
Tools: AWS FIS · AWS CLI · CloudWatch
# Bước 1: Tạo experiment template — IAM disruption (simulate credential revocation)
aws fis create-experiment-template \
  --description "Security chaos: simulate IAM credential disruption" \
  --targets '{"iamRoles":{"resourceType":"aws:iam:role","selectionMode":"ALL","resourceArns":["arn:aws:iam::123456789012:role/app-role"]}}' \
  --actions '{"denyIAMActions":{"actionId":"aws:iam:deny-access","parameters":{"duration":"PT5M"},"targets":{"Roles":"iamRoles"}}}' \
  --stop-conditions '[{"source":"aws:cloudwatch:alarm","value":"arn:aws:cloudwatch:us-east-1:123456789012:alarm/CriticalAppAlarm"}]' \
  --role-arn arn:aws:iam::123456789012:role/FISServiceRole \
  --query "experimentTemplate.id" --output text

# Bước 2: Khởi động experiment (lưu EXPERIMENT_ID từ output bước 1)
aws fis start-experiment \
  --experiment-template-id  \
  --query "experiment.id" --output text

# Bước 3: Monitor CloudWatch alarms trong quá trình experiment
aws cloudwatch describe-alarms \
  --alarm-names "AppHealthCheck" "SecurityAlertThreshold" \
  --query "MetricAlarms[].{Alarm:AlarmName,State:StateValue,Reason:StateReason}" \
  -o table

# Bước 4: Review experiment results
aws fis get-experiment --id  \
  --query "{State:experiment.state,StartTime:experiment.startTime,StopConditions:experiment.stopConditions,Targets:experiment.targets}" \
  -o json

Kết quả mong đợi: aws fis get-experiment trả về JSON: "state":{"status":"completed","reason":"..."},"targets":{"iamRoles":{"count":1,"type":"aws:iam:role"}}. CloudWatch alarms chuyển sang ALARM state trong khi experiment chạy — xác nhận detection pipeline hoạt động. Nếu alarm không fire → gap trong monitoring cần fix. Experiment tự dừng khi stop condition (CloudWatch alarm) breach, bảo vệ production.

CCSP key concept — Chaos vs Penetration Testing: Pen testing tìm vulnerabilities trong bảo mật tĩnh (configurations, code). Chaos security engineering test dynamic resilience — khi failure xảy ra, hệ thống recover và alert đúng không? Cả hai cần thiết: pen test → fix gaps; chaos test → verify response mechanisms. Game days là form cao nhất của chaos security.

1.7. Cloud BCP/DR & Multi-Region Resilience (BCP/DR multi-region)

2. Bài thực hành / Hands-on lab

🖥️ Nền tảng / Platform: Any (Cloud Shell / Local)
🛠️ Công cụ / Tools: Azure CLI · AWS CLI

Lab 1 — Azure Security Alerts, Log Analytics Query & Policy Compliance

OS: Any · Tool: Azure CLI.

# Liệt kê security alerts từ Defender for Cloud
az security alert list -o table 2>/dev/null | head -20

# Query Log Analytics cho failed logins (Event ID 4625)
az monitor log-analytics query \
  --workspace myWorkspaceId \
  --analytics-query "
SecurityEvent
| where EventID == 4625
| where TimeGenerated > ago(24h)
| summarize FailedAttempts = count() by Account, Computer, IpAddress
| where FailedAttempts > 5
| top 10 by FailedAttempts desc
" \
  -o table 2>/dev/null || echo "Replace myWorkspaceId with actual Log Analytics workspace ID"

# Kiểm tra Defender for Cloud settings (MCAS, email notifications)
az security setting show --name mcsas -o json 2>/dev/null

# Xem Azure Policy compliance - tìm non-compliant resources
az policy state list \
  --resource-group myRG \
  --query "[?complianceState=='NonCompliant'].{Resource:resourceId,Policy:policyDefinitionName,State:complianceState}" \
  -o table 2>/dev/null | head -20

# Xem JIT VM access requests
az security jit-policy list \
  --resource-group myRG \
  -o json 2>/dev/null | python3 -c "
import json, sys
try:
    data = json.load(sys.stdin)
    for p in data:
        print(f'VM: {p[\"name\"]} | Ports: {[r[\"number\"] for r in p.get(\"virtualMachines\",[{}])[0].get(\"ports\",[])]}')
except:
    print('No JIT policies found or insufficient permissions')
"

✅ Kết quả mong đợi / Expected output: Security alerts bảng hiển thị AlertName, Severity (High/Medium/Low), Status (Active/Dismissed), và ResourceId. Log Analytics query trả về accounts với >5 failed logins trong 24h — brute force indicator. Policy compliance hiển thị NonCompliant resources với policy name — remediation priority. JIT policies hiển thị protected VMs và ports (RDP:3389, SSH:22 phải trong JIT policy, không được open permanently).

Lab 2 — AWS CloudTrail Investigation, GuardDuty Findings & Security Hub

OS: Any · Tool: AWS CLI.

# Tìm kiếm ConsoleLogin events trong CloudTrail (authentication audit)
aws cloudtrail lookup-events \
  --lookup-attributes AttributeKey=EventName,AttributeValue=ConsoleLogin \
  --max-results 10 \
  --query "Events[].{User:Username,Source:EventSource,Time:EventTime,IP:CloudTrailEvent}" \
  -o table

# Lấy GuardDuty detector ID và tìm active findings
DETECTOR_ID=$(aws guardduty list-detectors --query "DetectorIds[0]" --output text 2>/dev/null)
if [ -n "$DETECTOR_ID" ] && [ "$DETECTOR_ID" != "None" ]; then
  echo "GuardDuty Detector: $DETECTOR_ID"
  aws guardduty list-findings \
    --detector-id "$DETECTOR_ID" \
    --finding-criteria '{"Criterion":{"severity":{"Gte":4}}}' \
    --max-results 5 \
    --query "FindingIds" \
    --output text
else
  echo "GuardDuty not enabled. Enable: aws guardduty create-detector --enable"
fi

# Xem Security Hub findings (active, high severity)
aws securityhub get-findings \
  --filters '{
    "RecordState": [{"Value":"ACTIVE","Comparison":"EQUALS"}],
    "SeverityLabel": [{"Value":"HIGH","Comparison":"EQUALS"},{"Value":"CRITICAL","Comparison":"EQUALS"}]
  }' \
  --max-results 5 \
  --query "Findings[].{Title:Title,Severity:Severity.Label,Resource:Resources[0].Id,Compliance:Compliance.Status}" \
  -o table 2>/dev/null

# Kiểm tra CloudTrail logging status
aws cloudtrail describe-trails \
  --query "trailList[].{Name:Name,MultiRegion:IsMultiRegionTrail,LogEnabled:HasCustomEventSelectors,S3:S3BucketName}" \
  -o table

✅ Kết quả mong đợi / Expected output: CloudTrail ConsoleLogin events hiển thị username, source IP, timestamp — phát hiện logins từ unusual IPs hoặc countries. GuardDuty findings với severity ≥4 (Medium+): UnauthorizedAccess, Recon, CryptoCurrency. Security Hub HIGH/CRITICAL findings với Compliance status FAILED = remediation needed. CloudTrail MultiRegion=True và LogEnabled=True là bắt buộc cho compliance. Nếu MultiRegion=False → security gap, không có audit trail đầy đủ.

3. Tình huống doanh nghiệp / Real-world scenario

Bối cảnh:

Một tập đoàn logistics có 3 cloud environments (AWS prod, Azure dev/test, GCP analytics). Lúc 2:00 AM thứ Sáu, AWS GuardDuty alert về UnauthorizedAccess:IAMUser/MaliciousIPCaller.Custom — API calls từ IP trong threat intelligence list. Attacker đang dùng IAM credentials bị lộ để enumerate S3 buckets và download data. SOC team phải respond ngay.

Cloud IR Response:

  1. Contain (0-5 min): Disable compromised IAM user ngay: aws iam update-login-profile --user-name compromised-user --no-password-reset-requiredaws iam update-access-key --access-key-id AKIA... --status Inactive --user-name compromised-user. Revoke active sessions: aws iam attach-user-policy --user-name compromised-user --policy-arn arn:aws:iam::aws:policy/AWSDenyAll.
  2. Preserve (5-15 min): Export CloudTrail events 24h trước cho user này. Lưu S3 server access logs cho buckets bị access. Enable S3 Object Lock trên log bucket nếu chưa có.
  3. Investigate (15-60 min): CloudTrail lookup-events với username filter. Xác định: bao nhiêu S3 buckets bị access, objects nào bị download, có lateral movement sang services khác không (EC2, RDS, Lambda)?
  4. Eradicate & Recover (1-4h): Rotate tất cả credentials. Review và tighten IAM policies. Nếu data exfiltrated: notify DPO và khởi động GDPR breach notification process (72 giờ deadline). Enable PIM/JIT cho tất cả privileged accounts.

Bài học CCSP: Cloud IR phải "automate the first 15 minutes" — GuardDuty finding → EventBridge → Lambda tự động disable user và page on-call. Manual response lúc 2AM quá chậm. SOAR playbooks là bắt buộc cho mature cloud security operations.

4. Tự kiểm tra / Knowledge check

  1. Phân biệt CSPM, CWPP, và CNAPP. Lấy ví dụ cụ thể về loại finding mà mỗi công nghệ phát hiện trong AWS environment.
  2. Cloud forensics khác on-premises forensics như thế nào? Giải thích kỹ thuật "snapshot forensics" và tại sao đây là phương pháp preferred trong cloud IR.
  3. Just-In-Time access và Privileged Identity Management giải quyết vấn đề gì của traditional standing privileges? Rủi ro nào vẫn còn khi dùng JIT?
  4. So sánh 4 cloud DR strategies (Backup/Pilot Light/Warm Standby/Active-Active) theo RTO, RPO, và cost. Khi nào chọn Warm Standby thay vì Active-Active?
  5. AWS GuardDuty, Microsoft Sentinel, và Google Chronicle phục vụ use case khác nhau như thế nào? Trong kiến trúc multi-cloud, làm sao tích hợp cả 3?
  6. Chaos engineering có phải là security practice không? Giải thích cách chaos experiments giúp cải thiện cloud resilience và DR readiness.
Chương 4: Bảo mật ứng dụng Chương 6: Pháp lý, Rủi ro & Tuân thủ
Thực hành trên công cụAzure CLI · AWS CLI
Nền tảngAzure · AWS
Thời điểm phát hànhQ2/2026
Ngày biên soạn24/05/2026
Người biên soạnTrần Văn Hòa (MCT)
Phiên bảnv1.0
Zalo