⏱️ 4 giờ
🔒 Immutable
🔑 AES-256
🛡️ Malware Scan
🎓 Kết Quả Học Tập
- ✅ Deploy JeOS hardened repository (immutable storage)
- ✅ Enable AES-256 encryption cho backups
- ✅ Chứng minh immutability blocks xóa/chỉnh sửa
- ✅ Cấu hình malware detection & scan
- ✅ Simulate & recover từ ransomware attack
- ✅ Thiết kế 3-2-1 backup strategy
Lý Thuyết: Bảo Vệ Chống Ransomware
🚨 Tại Sao Ransomware Nguy Hiểm Với Backup?
Kịch bản tấn công:
1. Hacker có admin credentials (phishing, RDP exploit)
2. Hacker encrypt toàn bộ production VMs
3. Hacker tìm & XÓA backup files
4. Hacker yêu cầu ransom $500,000
5. Không có backup → PHẢI trả tiền hoặc mất data vĩnh viễn
NẾU CÓ HARDENED REPO:
3. Hacker thử xóa → THẤT BẠI (immutable)
4. IT team recover từ immutable backup
5. RTO <1h, RPO <4h, $0 ransom paid ✓
1. Hacker có admin credentials (phishing, RDP exploit)
2. Hacker encrypt toàn bộ production VMs
3. Hacker tìm & XÓA backup files
4. Hacker yêu cầu ransom $500,000
5. Không có backup → PHẢI trả tiền hoặc mất data vĩnh viễn
NẾU CÓ HARDENED REPO:
3. Hacker thử xóa → THẤT BẠI (immutable)
4. IT team recover từ immutable backup
5. RTO <1h, RPO <4h, $0 ransom paid ✓
📐 Quy Tắc 3-2-1-1-0
| Quy Tắc | Ý Nghĩa | Ví Dụ |
|---|---|---|
| 3 copies | 3 bản sao dữ liệu | Production + Backup + Copy |
| 2 media | 2 loại storage khác nhau | NAS + Cloud S3 |
| 1 offsite | 1 bản ở site khác | DR site hoặc cloud |
| 1 immutable | 1 bản bất biến | Hardened Repository |
| 0 errors | 0 lỗi restore | Test restore hàng tuần |
LAB 5A: Deploy Hardened Repository
Bước 1: Tải & Boot JeOS ISO
# Tải VIA ISO từ my.veeam.com
# Tạo VM mới trong hypervisor:
VM Specs:
├─ Name: JeOS-Hardened-Repo
├─ vCPU: 4
├─ RAM: 8GB
├─ Disk 1: 50GB (OS)
├─ Disk 2: 500GB (backup storage)
├─ Network: Isolated VLAN (tách riêng!)
└─ ISO: veeam-infrastructure-appliance.iso
Power On → Boot from ISO
# Tạo VM mới trong hypervisor:
VM Specs:
├─ Name: JeOS-Hardened-Repo
├─ vCPU: 4
├─ RAM: 8GB
├─ Disk 1: 50GB (OS)
├─ Disk 2: 500GB (backup storage)
├─ Network: Isolated VLAN (tách riêng!)
└─ ISO: veeam-infrastructure-appliance.iso
Power On → Boot from ISO
Bước 2: Cài Đặt JeOS (Hardened Role)
Tại console VM:
1. Language: English
2. Role: ★ Hardened Repository ★ ← QUAN TRỌNG
3. Network:
├─ IP: 10.10.50.10 (isolated VLAN)
├─ Netmask: 255.255.255.0
├─ Gateway: 10.10.50.1
└─ DNS: 10.10.1.1
4. Hostname: hardened-repo-01
5. Root password: [Strong password - 16+ chars]
6. Storage path: /veeam/repository (Disk 2)
7. Encryption password: [Separate strong password]
→ Install (automatic, ~15 phút)
→ Reboot
1. Language: English
2. Role: ★ Hardened Repository ★ ← QUAN TRỌNG
3. Network:
├─ IP: 10.10.50.10 (isolated VLAN)
├─ Netmask: 255.255.255.0
├─ Gateway: 10.10.50.1
└─ DNS: 10.10.1.1
4. Hostname: hardened-repo-01
5. Root password: [Strong password - 16+ chars]
6. Storage path: /veeam/repository (Disk 2)
7. Encryption password: [Separate strong password]
→ Install (automatic, ~15 phút)
→ Reboot
Bước 3: Thêm Hardened Repo vào Veeam
Veeam Console → Infrastructure → Repositories
→ Add Repository → Hardened Repository
Cấu hình:
├─ Name: Lab5-Hardened-Repo
├─ Server: 10.10.50.10 (JeOS IP)
├─ Credentials: root / [password]
├─ Path: /veeam/repository
├─ ✓ Enable Immutable Backups
├─ Immutability period: 7 days
├─ ✓ Enable Encryption (AES-256)
├─ Encryption password: [your key]
└─ Click Finish
Chờ ~2 phút: Status = Online ✓
→ Add Repository → Hardened Repository
Cấu hình:
├─ Name: Lab5-Hardened-Repo
├─ Server: 10.10.50.10 (JeOS IP)
├─ Credentials: root / [password]
├─ Path: /veeam/repository
├─ ✓ Enable Immutable Backups
├─ Immutability period: 7 days
├─ ✓ Enable Encryption (AES-256)
├─ Encryption password: [your key]
└─ Click Finish
Chờ ~2 phút: Status = Online ✓
Bước 4: Tạo Backup Job → Hardened Repo
Home → Jobs → Backup → VM Backup
├─ Name: Lab5-Immutable-Backup
├─ VMs: Database-Server-01
├─ Repository: Lab5-Hardened-Repo
├─ Retention: 14 days
└─ Run Now
Chờ: ~30 phút
✓ Kết quả:
├─ Backup completed successfully
├─ Status: Immutable until [date + 7 days]
└─ Encryption: AES-256 enabled
├─ Name: Lab5-Immutable-Backup
├─ VMs: Database-Server-01
├─ Repository: Lab5-Hardened-Repo
├─ Retention: 14 days
└─ Run Now
Chờ: ~30 phút
✓ Kết quả:
├─ Backup completed successfully
├─ Status: Immutable until [date + 7 days]
└─ Encryption: AES-256 enabled
LAB 5B: Chứng Minh Immutability (Ransomware Simulation)
Mục tiêu: Chứng minh backup KHÔNG thể bị xóa/chỉnh sửa dù có admin access
Test A: Thử Xóa Qua Veeam UI
# Giả lập: Hacker có admin Veeam credentials
Veeam Console → Backups → Disk
→ Tìm "Lab5-Immutable-Backup"
→ Right-click → Delete from Disk
KẾT QUẢ:
❌ ERROR: "Cannot delete backup. Backup is
immutable until 2026-05-09 14:30:00"
→ BLOCKED ✓ (Hacker không xóa được!)
Veeam Console → Backups → Disk
→ Tìm "Lab5-Immutable-Backup"
→ Right-click → Delete from Disk
KẾT QUẢ:
❌ ERROR: "Cannot delete backup. Backup is
immutable until 2026-05-09 14:30:00"
→ BLOCKED ✓ (Hacker không xóa được!)
Test B: Thử Xóa Qua SSH (Root Access)
# Giả lập: Hacker có SSH root access
ssh [email protected]
Password: [entered]
# Liệt kê backup files
ls -la /veeam/repository/
# Output: Lab5-Immutable-Backup-*.vib (nhiều files)
# Thử xóa
rm -rf /veeam/repository/Lab5-Immutable-Backup*
KẾT QUẢ:
❌ rm: cannot remove 'Lab5-Immutable-Backup-Full.vib':
Operation not permitted
# Kiểm tra attributes
lsattr /veeam/repository/Lab5-Immutable-Backup-Full.vib
# Output: ----i--------e-- (i = immutable flag)
# Thử bỏ immutable flag
chattr -i /veeam/repository/Lab5-Immutable-Backup-Full.vib
KẾT QUẢ:
❌ chattr: Operation not permitted
(kernel-level protection, even root blocked!)
→ BLOCKED ✓ (Ngay cả ROOT cũng không xóa được!)
ssh [email protected]
Password: [entered]
# Liệt kê backup files
ls -la /veeam/repository/
# Output: Lab5-Immutable-Backup-*.vib (nhiều files)
# Thử xóa
rm -rf /veeam/repository/Lab5-Immutable-Backup*
KẾT QUẢ:
❌ rm: cannot remove 'Lab5-Immutable-Backup-Full.vib':
Operation not permitted
# Kiểm tra attributes
lsattr /veeam/repository/Lab5-Immutable-Backup-Full.vib
# Output: ----i--------e-- (i = immutable flag)
# Thử bỏ immutable flag
chattr -i /veeam/repository/Lab5-Immutable-Backup-Full.vib
KẾT QUẢ:
❌ chattr: Operation not permitted
(kernel-level protection, even root blocked!)
→ BLOCKED ✓ (Ngay cả ROOT cũng không xóa được!)
Test C: Thử Encrypt Backup Files
# Giả lập: Hacker thử encrypt backup files
ssh [email protected]
# Thử đọc file (để encrypt)
cat /veeam/repository/Lab5-Immutable-Backup-Full.vib
KẾT QUẢ: Binary gibberish (file đã AES-256 encrypted)
→ Hacker không đọc được nội dung ✓
# Thử ghi đè (overwrite with encrypted version)
echo "RANSOMWARE" > /veeam/repository/Lab5*.vib
KẾT QUẢ:
❌ bash: /veeam/repository/Lab5*.vib:
Permission denied
→ BLOCKED ✓ (Không ghi đè, không encrypt được!)
ssh [email protected]
# Thử đọc file (để encrypt)
cat /veeam/repository/Lab5-Immutable-Backup-Full.vib
KẾT QUẢ: Binary gibberish (file đã AES-256 encrypted)
→ Hacker không đọc được nội dung ✓
# Thử ghi đè (overwrite with encrypted version)
echo "RANSOMWARE" > /veeam/repository/Lab5*.vib
KẾT QUẢ:
❌ bash: /veeam/repository/Lab5*.vib:
Permission denied
→ BLOCKED ✓ (Không ghi đè, không encrypt được!)
Test D: Thử Format Disk
# Giả lập: Hacker thử format toàn bộ ổ đĩa
ssh [email protected]
mkfs.ext4 /dev/sdb1 # Disk 2 (repository disk)
KẾT QUẢ:
❌ mkfs.ext4: /dev/sdb1 is apparently in use
by the system; will not make a filesystem here!
→ BLOCKED ✓ (Disk protected against formatting!)
ssh [email protected]
mkfs.ext4 /dev/sdb1 # Disk 2 (repository disk)
KẾT QUẢ:
❌ mkfs.ext4: /dev/sdb1 is apparently in use
by the system; will not make a filesystem here!
→ BLOCKED ✓ (Disk protected against formatting!)
LAB 5C: Malware Detection & Scan
Bước 1: Enable Malware Detection
Veeam Console → Settings → Malware Detection
├─ ✓ Enable malware detection
├─ Signature update: Automatic (weekly)
├─ Scan mode: Post-backup scan
├─ Alert threshold: 1+ suspicious files
└─ Action: Quarantine & notify admin
├─ ✓ Enable malware detection
├─ Signature update: Automatic (weekly)
├─ Scan mode: Post-backup scan
├─ Alert threshold: 1+ suspicious files
└─ Action: Quarantine & notify admin
Bước 2: Tạo EICAR Test File (Safe Malware Simulation)
# SSH vào VM được bảo vệ (Database-Server-01)
ssh root@database-server-01
# Tạo EICAR test file (tiêu chuẩn quốc tế cho test AV)
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD'\
'-ANTIVIRUS-TEST-FILE!$H+H*' > /tmp/eicar-test.txt
# Verify file tồn tại
ls -la /tmp/eicar-test.txt
cat /tmp/eicar-test.txt
exit
ssh root@database-server-01
# Tạo EICAR test file (tiêu chuẩn quốc tế cho test AV)
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD'\
'-ANTIVIRUS-TEST-FILE!$H+H*' > /tmp/eicar-test.txt
# Verify file tồn tại
ls -la /tmp/eicar-test.txt
cat /tmp/eicar-test.txt
exit
Bước 3: Chạy Backup & Kiểm Tra Scan
Home → Jobs → Lab5-Immutable-Backup → Run Now
Chờ hoàn thành...
Kiểm tra kết quả scan:
Jobs → Lab5-Immutable-Backup → Latest Session
→ Malware Detection tab
KẾT QUẢ DỰ KIẾN:
⚠️ WARNING: Suspicious file detected!
├─ File: /tmp/eicar-test.txt
├─ Type: EICAR-Test-File
├─ Action: Quarantined
└─ Backup completed with warning
→ Malware detection WORKS ✓
Chờ hoàn thành...
Kiểm tra kết quả scan:
Jobs → Lab5-Immutable-Backup → Latest Session
→ Malware Detection tab
KẾT QUẢ DỰ KIẾN:
⚠️ WARNING: Suspicious file detected!
├─ File: /tmp/eicar-test.txt
├─ Type: EICAR-Test-File
├─ Action: Quarantined
└─ Backup completed with warning
→ Malware detection WORKS ✓
LAB 5D: Recovery From Ransomware
Bước 1: Simulate Ransomware (Safe)
# SSH vào protected VM
ssh root@database-server-01
# Giả lập "mã hóa" files (SAFE - chỉ rename)
cd /var/www/html # hoặc thư mục data
for f in *.html *.txt *.conf; do
mv "$f" "${f}.ENCRYPTED"
done
# Kiểm tra "damage"
ls /var/www/html/
# Output: index.html.ENCRYPTED, config.conf.ENCRYPTED...
# Website DOWN! Files "encrypted"!
curl http://localhost # → ERROR (index.html missing)
ssh root@database-server-01
# Giả lập "mã hóa" files (SAFE - chỉ rename)
cd /var/www/html # hoặc thư mục data
for f in *.html *.txt *.conf; do
mv "$f" "${f}.ENCRYPTED"
done
# Kiểm tra "damage"
ls /var/www/html/
# Output: index.html.ENCRYPTED, config.conf.ENCRYPTED...
# Website DOWN! Files "encrypted"!
curl http://localhost # → ERROR (index.html missing)
Bước 2: Recover from Hardened Backup
Veeam Console → Backups → Disk
→ Lab5-Immutable-Backup
→ Chọn restore point TRƯỚC tấn công
→ Right-click → File-Level Restore
Browse:
├─ /var/www/html/index.html
├─ /var/www/html/config.conf
└─ [Select all affected files]
Restore to: Original location (overwrite)
→ Click Restore
Chờ: ~5 phút
→ Lab5-Immutable-Backup
→ Chọn restore point TRƯỚC tấn công
→ Right-click → File-Level Restore
Browse:
├─ /var/www/html/index.html
├─ /var/www/html/config.conf
└─ [Select all affected files]
Restore to: Original location (overwrite)
→ Click Restore
Chờ: ~5 phút
Bước 3: Verify Recovery
# SSH vào VM
ssh root@database-server-01
# Kiểm tra files đã khôi phục
ls /var/www/html/
# Output: index.html, config.conf ← RESTORED!
# Test website
curl http://localhost
# Output: <html>... ← WEBSITE ONLINE!
# Xóa files "encrypted" còn sót
rm -f /var/www/html/*.ENCRYPTED
echo "Recovery successful!"
echo "RTO achieved: ~10 minutes"
echo "Data loss (RPO): 0 (backup was recent)"
ssh root@database-server-01
# Kiểm tra files đã khôi phục
ls /var/www/html/
# Output: index.html, config.conf ← RESTORED!
# Test website
curl http://localhost
# Output: <html>... ← WEBSITE ONLINE!
# Xóa files "encrypted" còn sót
rm -f /var/www/html/*.ENCRYPTED
echo "Recovery successful!"
echo "RTO achieved: ~10 minutes"
echo "Data loss (RPO): 0 (backup was recent)"
Bài Tập Ứng Dụng (4 bài)
💼 Bài 1: Thiết Kế 3-2-1-1-0 cho Bệnh Viện
Tình huống: Bệnh viện 500 giường, 300 VMs (hồ sơ bệnh nhân, hình ảnh y khoa, hệ thống lab). RTO target: 30 phút cho critical systems.
Yêu cầu:
- Thiết kế đầy đủ 3-2-1-1-0 (vẽ diagram)
- Xác định đâu là immutable copy
- Tính chi phí ước lượng (licensing + storage)
- Nếu ransomware tấn công lúc 2AM, quy trình recovery như thế nào?
💡 Gợi ý:
3 copies: Production + Local backup + Cloud copy
2 media: NAS (local) + AWS S3 (cloud)
1 offsite: AWS S3 (different region)
1 immutable: Hardened repo (7-day lock)
0 errors: Weekly restore test (automated)
Cost: ~$50k/year (Veeam Enterprise + S3 storage)
3 copies: Production + Local backup + Cloud copy
2 media: NAS (local) + AWS S3 (cloud)
1 offsite: AWS S3 (different region)
1 immutable: Hardened repo (7-day lock)
0 errors: Weekly restore test (automated)
Cost: ~$50k/year (Veeam Enterprise + S3 storage)
💼 Bài 2: Tính ROI Immutable Backup
Dữ liệu:
- Chi phí Veeam + Hardened Repo: $80,000/năm
- Ransom demand trung bình: $500,000
- Downtime cost: $50,000/giờ
- Xác suất bị tấn công: 30%/năm (theo thống kê ngành)
Tính: ROI của hardened backup = ?
💡 Đáp án:
Expected loss without backup: 30% × ($500k + $50k×8h) = $270,000/year
Expected loss with backup: 30% × ($50k×1h) = $15,000/year (1h RTO)
Savings: $270k - $15k = $255,000/year
ROI: ($255k - $80k) / $80k = 218% ✓ (rất đáng đầu tư!)
Expected loss without backup: 30% × ($500k + $50k×8h) = $270,000/year
Expected loss with backup: 30% × ($50k×1h) = $15,000/year (1h RTO)
Savings: $270k - $15k = $255,000/year
ROI: ($255k - $80k) / $80k = 218% ✓ (rất đáng đầu tư!)
💼 Bài 3: Immutability Period Design
Câu hỏi: Nên set immutability period bao lâu?
| Scenario | Period | Lý Do |
|---|---|---|
| SMB (nhỏ) | 7 ngày | ? |
| Enterprise | 30 ngày | ? |
| Healthcare | 90 ngày | ? |
| Financial | 365 ngày | ? |
Điền lý do cho mỗi period. Trade-off giữa security vs storage cost?
💡 Gợi ý:
SMB 7d: Phát hiện nhanh, ít storage overhead
Enterprise 30d: Đủ thời gian audit, phát hiện APT
Healthcare 90d: HIPAA compliance, patient data retention
Financial 365d: PCI-DSS/SOX compliance, audit trail
Trade-off: Longer period = more storage = higher cost
SMB 7d: Phát hiện nhanh, ít storage overhead
Enterprise 30d: Đủ thời gian audit, phát hiện APT
Healthcare 90d: HIPAA compliance, patient data retention
Financial 365d: PCI-DSS/SOX compliance, audit trail
Trade-off: Longer period = more storage = higher cost
💼 Bài 4: Incident Response Plan
Viết quy trình ứng phó sự cố (IRP) cho ransomware:
- Phát hiện (Detection): Ai phát hiện? Bằng cách nào?
- Cô lập (Containment): Cô lập gì? Theo thứ tự nào?
- Đánh giá (Assessment): Kiểm tra gì? Backup intact?
- Phục hồi (Recovery): Recover từ đâu? Thứ tự nào?
- Bài học (Lessons): Cải thiện gì sau sự cố?
💡 Template IRP:
1. Detection: Veeam malware scan alert + SOC monitoring
2. Containment: Power off affected VMs → Isolate network segment
3. Assessment: Verify hardened backup intact → Check last clean point
4. Recovery: Tier-1 (DB) → Tier-2 (Web) → Tier-3 (App)
5. Lessons: Enable CDP for critical, add MFA, segment networks
1. Detection: Veeam malware scan alert + SOC monitoring
2. Containment: Power off affected VMs → Isolate network segment
3. Assessment: Verify hardened backup intact → Check last clean point
4. Recovery: Tier-1 (DB) → Tier-2 (Web) → Tier-3 (App)
5. Lessons: Enable CDP for critical, add MFA, segment networks
Kết Quả Dự Kiến Hoàn Chỉnh
LAB 5A: Deploy Hardened Repository
✅ JeOS deployed: 10.10.50.10 (isolated VLAN)
✅ Hardened repo added to Veeam: Status = Online
✅ Immutability: 7 days enabled
✅ Encryption: AES-256 active
✅ Backup completed: "Immutable until 2026-05-09"
LAB 5B: Ransomware Simulation
✅ UI delete: BLOCKED ("Backup is immutable")
✅ SSH rm: BLOCKED ("Operation not permitted")
✅ SSH chattr: BLOCKED ("Operation not permitted")
✅ SSH overwrite: BLOCKED ("Permission denied")
✅ SSH format: BLOCKED ("Device in use")
LAB 5C: Malware Detection
✅ EICAR test file created on VM
✅ Backup scan detected EICAR file
✅ Alert generated: "Suspicious file detected"
LAB 5D: Recovery
✅ Simulated ransomware (files renamed)
✅ Restored from hardened backup
✅ Files recovered, website online
✅ RTO achieved: ~10 minutes
✅ RPO achieved: 0 (recent backup)
✅ JeOS deployed: 10.10.50.10 (isolated VLAN)
✅ Hardened repo added to Veeam: Status = Online
✅ Immutability: 7 days enabled
✅ Encryption: AES-256 active
✅ Backup completed: "Immutable until 2026-05-09"
LAB 5B: Ransomware Simulation
✅ UI delete: BLOCKED ("Backup is immutable")
✅ SSH rm: BLOCKED ("Operation not permitted")
✅ SSH chattr: BLOCKED ("Operation not permitted")
✅ SSH overwrite: BLOCKED ("Permission denied")
✅ SSH format: BLOCKED ("Device in use")
LAB 5C: Malware Detection
✅ EICAR test file created on VM
✅ Backup scan detected EICAR file
✅ Alert generated: "Suspicious file detected"
LAB 5D: Recovery
✅ Simulated ransomware (files renamed)
✅ Restored from hardened backup
✅ Files recovered, website online
✅ RTO achieved: ~10 minutes
✅ RPO achieved: 0 (recent backup)