CCSP · Domain 6 · 13%

Pháp lý, Rủi ro & Tuân thủ đám mây

Legal, Risk & Compliance

Domain cuối của CCSP — nhưng không kém quan trọng: khung pháp lý đám mây (GDPR/CLOUD Act), đàm phán SLA, các framework tuân thủ (FedRAMP/ISO 27017/PCI DSS/SOC 2), đánh giá rủi ro CSP, eDiscovery trong cloud, và quyền kiểm toán.

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

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

1.1. Khung pháp lý đám mây — GDPR, CLOUD Act, Luật VN (Cloud legal framework)

GDPR (General Data Protection Regulation) & Cloud:

CLOUD Act (Clarifying Lawful Overseas Use of Data Act, US 2018):

Luật An ninh mạng VN 2018: Điều 26 yêu cầu các doanh nghiệp nước ngoài cung cấp dịch vụ tại VN phải: lưu trữ dữ liệu quan trọng của người dùng VN tại VN, và đặt văn phòng đại diện tại VN. Nghị định 13/2023/NĐ-CP về bảo vệ dữ liệu cá nhân bổ sung thêm requirements. Ảnh hưởng: AWS/Azure phải có Vietnam Region hoặc customer phải dùng VN-based cloud (VNG Cloud, FPT Cloud, Viettel IDC).

1.2. Cloud Contracts & SLA Negotiation (Cloud SLA & contracts)

SLA (Service Level Agreement) với CSP phải được đàm phán kỹ — standard SLA của CSP thường có lợi cho CSP:

1.3. Cloud Compliance Frameworks (Compliance frameworks)

⚠️ CSP Shared Assessment Model: Khi CSP có SOC 2/ISO 27001/FedRAMP → customers có thể "inherit" một số controls từ CSP. Nhưng customer vẫn phải implement controls cho phần responsibility của mình. Đây là "Shared Assessment" không phải "Full Transfer of Responsibility." CCSP exam thường hỏi về điều này.

1.4. Cloud Risk Management & CSA STAR (Cloud risk & CSA STAR)

Cloud-specific risks (không có trong on-premises):

CSA STAR Registry (Security Trust Assurance and Risk):

1.5. eDiscovery & Audit Rights trong Cloud (eDiscovery & audit)

eDiscovery (Electronic Discovery): Quy trình tìm kiếm, thu thập, review, và produce electronically stored information (ESI) để phục vụ legal proceedings. Trong cloud:

Audit rights negotiation: Best case: direct audit by customer or customer-appointed auditor. Common case: CSP cung cấp audit reports (SOC 2, ISO 27001 cert, FedRAMP ATO letter). CSP thường không allow customer on-site audits vì multi-tenancy — would expose other customers' environments.

1.6. Cloud Forensics & Chain of Custody (Cloud digital forensics)

Cloud forensics khác biệt căn bản so với on-premises: môi trường ephemeral, shared infrastructure, và jurisdictional complexity đặt ra thách thức riêng:

AWS Forensics Lab — Evidence Preservation Steps:

# Bước 1: Tạo forensic snapshot của EBS volume nghi ngờ bị compromise
aws ec2 create-snapshot \
  --volume-id vol-0abc123def456789 \
  --description "forensic-hold-$(date +%Y%m%d-%H%M%S)" \
  --tag-specifications 'ResourceType=snapshot,Tags=[{Key=Purpose,Value=forensics},{Key=CaseId,Value=IR-2026-001}]' \
  --query "SnapshotId" --output text

# Bước 2: Apply S3 Object Lock legal hold lên evidence file (không thể delete khi locked)
aws s3api put-object-legal-hold \
  --bucket forensics-evidence-bucket \
  --key cloudtrail/2026/05/24/evidence.log.gz \
  --legal-hold '{"Status":"ON"}'

# Bước 3: Verify snapshot đã được tạo và metadata đúng
aws ec2 describe-snapshots \
  --snapshot-ids snap-0xyz789abc123def \
  --query "Snapshots[0].{Id:SnapshotId,State:State,VolumeId:VolumeId,StartTime:StartTime,Description:Description,Tags:Tags}" \
  -o json

# Hash verification — tính SHA-256 của evidence để chain of custody
# (sau khi download CloudTrail log về local)
sha256sum ./evidence/cloudtrail-2026-05-24.json.gz > ./evidence/SHA256SUMS.txt
cat ./evidence/SHA256SUMS.txt

Kết quả mong đợi: Bước 1 trả về SnapshotId: snap-0xyz.... Bước 3 verify "State":"completed", "Description":"forensic-hold-20260524-...", và tags đúng. S3 Object Lock khi ON: mọi attempt delete object trả về AccessDenied. SHA-256 hash trong SHA256SUMS.txt là fingerprint bất biến của evidence — đối chiếu khi nộp tòa để chứng minh không bị tamper.

CCSP key concept — Cloud Forensics Readiness: Forensics readiness phải implement trước khi incident xảy ra: enable CloudTrail multi-region, VPC Flow Logs, S3 server access logs, và set retention ≥ legal requirement (thường 7 năm cho tài chính). Reactive forensics trong cloud thường thất bại vì evidence đã bị overwrite. "If it's not logged, it didn't happen" — and if the log isn't protected, it can't be used in court.

Quantum-Readiness cho Cloud (Post-Quantum Cryptography)

Máy tính lượng tử (quantum computers) có thể phá vỡ RSA, ECC, và Diffie-Hellman — nền tảng của TLS, PKI, và cloud encryption hiện tại. CCSP candidates cần hiểu timeline và roadmap chuyển đổi:

Exam tip: CCSP exam có thể hỏi về "crypto-agility" — ability to swap algorithms without re-architecting. Đây là mitigation strategy cho quantum threat. Biết tên: ML-KEM (key exchange), ML-DSA (signatures), NIST FIPS 203/204/205.

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

🖥️ Nền tảng / Platform: Any + Ubuntu 22.04
🛠️ Công cụ / Tools: Azure CLI · AWS CLI

Lab 1 — Azure Policy Compliance Audit & Defender Plans Review

OS: Any · Tool: Azure CLI.

  1. Xem Microsoft Service Trust Portal programmatically và kiểm tra compliance plans:
# Microsoft Service Trust Portal - compliance docs available at:
# https://servicetrust.microsoft.com (SOC reports, ISO certs, PCI DSS, FedRAMP)
# Truy cập programmatically qua Microsoft Graph API (requires auth):
# GET https://graph.microsoft.com/v1.0/compliance/...

# Kiểm tra tất cả Azure Policy assignments trong subscription
az policy assignment list \
  --query "[].{Name:displayName,PolicyDef:policyDefinitionId,Scope:scope,Enforcement:enforcementMode}" \
  -o table | head -20

# Xem Regulatory Compliance standards đang được monitor
az policy assignment list \
  --query "[?contains(policyDefinitionId,'Regulatory') || contains(displayName,'CIS') || contains(displayName,'NIST') || contains(displayName,'PCI')].{Name:displayName,Id:id}" \
  -o table

# Kiểm tra Microsoft Defender plans đang bật (chi phí bảo mật)
az security pricing list \
  --query "[].{Service:name,PricingTier:pricingTier,FreeTrialExpiry:freeTrialRemainingTime}" \
  -o table

# Xem built-in policy definitions liên quan đến data residency
az policy definition list \
  --query "[?contains(displayName,'location') || contains(displayName,'region')].{Name:displayName,Category:metadata.category}" \
  -o table 2>/dev/null | grep -i "location\|region\|residency" | head -10

✅ Kết quả mong đợi / Expected output: Policy assignments hiển thị CIS Azure Foundations, NIST SP 800-53, PCI DSS v4 — mỗi standard map controls tới Azure resources. Enforcement mode DoNotEnforce = audit-only (không block non-compliant). Defender pricing tiers: Standard = paid, Free = limited. Tất cả critical services (Servers, SQL, Storage, Containers, KeyVaults) nên ở Standard tier cho production. Location policies enforce data residency — ví dụ chỉ allow Southeast Asia region.

Lab 2 — AWS Evidence Preservation cho eDiscovery & Compliance Report

OS: Ubuntu 22.04 · Tool: AWS CLI.

#!/bin/bash
# Evidence preservation và compliance reporting script

echo "=== CloudTrail Health Check ==="
aws cloudtrail get-trail-status --name myTrail \
  --query "{IsLogging:IsLogging,LatestDelivery:LatestDeliveryTime,LatestCloudWatchLogs:LatestCloudWatchLogsDeliveryTime}" \
  -o json 2>/dev/null || echo "CloudTrail 'myTrail' not found. Check trail name."

echo ""
echo "=== eDiscovery: Last 1 hour of CloudTrail events ==="
START_TIME=$(date -d '1 hour ago' --iso-8601=seconds 2>/dev/null || date -v-1H +%Y-%m-%dT%H:%M:%S 2>/dev/null || echo "2026-05-24T10:00:00")
END_TIME=$(date --iso-8601=seconds 2>/dev/null || date +%Y-%m-%dT%H:%M:%S)

aws cloudtrail lookup-events \
  --start-time "$START_TIME" \
  --end-time "$END_TIME" \
  --query "Events[*].{User:Username,Action:EventName,Time:EventTime,Source:EventSource}" \
  --output table 2>/dev/null | head -30

echo ""
echo "=== AWS Config Compliance Report ==="
# Tìm non-compliant Config rules (compliance posture)
aws configservice describe-compliance-by-config-rule \
  --query "ComplianceByConfigRules[?Compliance.ComplianceType!='COMPLIANT'].{Rule:ConfigRuleName,Status:Compliance.ComplianceType}" \
  -o table 2>/dev/null | head -20

echo ""
echo "=== S3 Object Lock Status (WORM for legal hold) ==="
# Kiểm tra buckets có Object Lock (bắt buộc cho legal hold / compliance)
for bucket in $(aws s3api list-buckets --query "Buckets[].Name" --output text | tr '\t' '\n' | head -5); do
  LOCK=$(aws s3api get-object-lock-configuration --bucket "$bucket" \
    --query "ObjectLockConfiguration.ObjectLockEnabled" \
    --output text 2>/dev/null || echo "Disabled")
  echo "Bucket: $bucket | ObjectLock: $LOCK"
done

✅ Kết quả mong đợi / Expected output: CloudTrail IsLogging=true là bắt buộc. LatestDeliveryTime phải gần đây (nếu quá 24h trước = problem). eDiscovery query trả về audit trail theo period cần điều tra. Config rules non-compliant list = gaps cần remediate trước audit. S3 Object Lock=Enabled trên log buckets đảm bảo audit evidence không thể bị xóa — critical cho eDiscovery và regulatory compliance. Buckets KHÔNG có Object Lock = evidence tampering risk.

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

Bối cảnh:

Một công ty bảo hiểm Việt Nam đang bị kiện tụng liên quan đến dữ liệu khách hàng. Tòa án yêu cầu xuất trình email communications và transaction logs từ 18 tháng trước. Toàn bộ infrastructure đang trên Azure và M365. Legal counsel yêu cầu IT team cung cấp evidence với chain of custody đầy đủ trong 2 tuần.

eDiscovery Process & Legal Compliance:

  1. Legal hold (Day 1): Áp dụng M365 Compliance Center In-Place Hold lên mailboxes của các cá nhân liên quan. SharePoint và Teams content hold. Thông báo custodians về legal hold obligation — không được xóa bất kỳ dữ liệu nào.
  2. Content search (Day 1-3): M365 Content Search với keyword queries, date range, và sender/recipient filters. Export search results với SHA-256 hash để đảm bảo integrity. Azure Activity Log export cho period cần điều tra.
  3. Evidence integrity (Day 3-5): Download exported data và tạo hash manifest. Lưu copies trên S3/Azure Blob với Object Lock enabled. Notarize hash values với timestamp server (RFC 3161). Document chain of custody: ai đã access, khi nào, công cụ gì dùng.
  4. CSP cooperation: Nếu cần evidence từ CSP infrastructure (physical access logs, HSM audit trails): gửi legal request (court order) tới Microsoft/AWS. CSP sẽ provide records theo process đã quy định trong contract và applicable law.
  5. Remediation sau vụ kiện: Review retention policies — nhiều dữ liệu quan trọng bị overwrite do retention period quá ngắn. Implement Azure Purview Records Management với legally-required retention periods (7 năm cho tài liệu tài chính theo luật VN).

Bài học CCSP: eDiscovery preparedness không phải bắt đầu khi có litigation — phải implement legal hold, retention policies, và audit log preservation từ trước. "Proactive compliance" vs "reactive scramble." Thiếu chain of custody làm evidence không admissible trong tòa án.

4. Tự kiểm tra / Knowledge check

  1. Giải thích xung đột giữa CLOUD Act và GDPR. Một doanh nghiệp EU lưu dữ liệu trên AWS US-East-1 có thể bị ảnh hưởng như thế nào? Đâu là mitigation options khả thi nhất?
  2. Phân biệt ISO 27017 và ISO 27018. Khi đánh giá CSP, bạn sẽ yêu cầu certification nào — và tại sao? Certification này có thay thế hoàn toàn customer's own compliance requirements không?
  3. Giải thích CSA STAR Level 1 vs Level 2. Tại sao Level 2 đáng tin cậy hơn? Trong RFP (Request for Proposal) cho cloud migration, bạn sẽ yêu cầu CSP cung cấp gì?
  4. Liệt kê 5 cloud-specific risks không có trong on-premises. Với mỗi risk, đề xuất ít nhất một contractual control và một technical control.
  5. Một tòa án yêu cầu email records 2 năm trước nhưng company chỉ có retention policy 1 năm. Hậu quả pháp lý là gì? Làm sao prevent tình huống này trong tương lai với Azure/M365?
  6. Right to audit trong cloud SLA thường bị CSP giới hạn bằng cách cung cấp third-party audit reports. Điều này có đủ để satisfy GDPR Art. 28(3)(h) không? Khi nào cần negotiate direct audit rights?
Chương 5: Vận hành bảo mật Phase 4B: CSSLP
Thực hành trên công cụAzure CLI · AWS CLI
Nền tảngAny · Ubuntu 22.04
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