Network Security Testing (Kiểm thử bảo mật mạng) là gì?
Là quy trình có hệ thống để xác định, xác thực và định lượng các lỗ hổng, sai cấu hình, và điểm yếu trong cơ sở hạ tầng mạng, hệ thống, ứng dụng và quy trình – nhằm đánh giá tư thế bảo mật (security posture) và tuân thủ các tiêu chuẩn (PCI-DSS, ISO 27001, NIST, Luật An ninh mạng VN).
5 Loại kiểm thử chính (Core Testing Types)
| Loại | Mục tiêu | Phương pháp | Công cụ điển hình | Tần suất |
|---|---|---|---|---|
| 1. Vulnerability Scanning (Quét lỗ hổng) | Tự động phát hiện CVE, misconfiguration, missing patches trên network, host, app, container, cloud | Credentialed/Non-credentialed scan, Agent-based, Container/Image scan, IaC scan | Nessus, OpenVAS/Greenbone, Qualys VMDR, Rapid7 InsightVM, Tenable.io, Trivy, Grype, Checkov, tfsec | Hàng tuần / Liên tục (CI/CD) |
| 2. Penetration Testing (Pentest / Ethical Hacking) | Mô phỏng kẻ tấn công thực tế để khai thác lỗ hổng, đánh giá tác động (impact), kiểm tra detection/response | Black/White/Gray box. External/Internal/Wireless/Web App/API/Cloud/AD/Client-side/Physical. Theo PTES, OSSTMM, NIST 800-115 | Metasploit, Cobalt Strike, Burp Suite Pro, Nmap, BloodHound, CrackMapExec, Impacket, Rubeus, SQLMap, ffuf, nuclei, custom scripts | 6 tháng / Năm / Sau thay đổi lớn |
| 3. Configuration Audit / Compliance Check (Kiểm tra cấu hình) | Đảm bảo thiết bị/network/app tuân thủ baseline an toàn (CIS Benchmarks, DISA STIG, Vendor Hardening Guide) | Automated audit (API/CLI/SSH), Policy-as-Code (OPA/Rego), IaC scanning | Nessus Policy Compliance, OpenSCAP, Lynis, kube-bench, kube-hunter, Terraform Sentinel, Config rules (AWS Config, Azure Policy) | Liên tục / Hàng tháng |
| 4. Red Teaming / Adversary Emulation | Mô phỏng APT/Threat Actor cụ thể (TTPs theo MITRE ATT&CK) – kiểm tra Blue Team detection & response (Purple Team) | Full kill chain: Recon → Initial Access → Persistence → PrivEsc → Lateral Movement → Exfil. Stealth, long-term (weeks-months) | Cobalt Strike, Brute Ratel, Sliver, Havoc, Custom malware, Living off the Land (LOLBAS/GTFOBins), Malleable C2 profiles | Năm / Theo yêu cầu |
| 5. Security Architecture Review / Threat Modeling | Đánh giá thiết kế an ninh trước khi triển khai / định kỳ – tìm lỗ hổng logic, trust boundary, data flow | STRIDE, PASTA, ATT&CK-based Threat Modeling, Data Flow Diagrams (DFD), Trust Boundaries | Microsoft Threat Modeling Tool, OWASP Threat Dragon, IriusRisk, CAIRIS, draw.io + custom templates | Mỗi release lớn / Quý |
Quy trình kiểm thử chuẩn (Standard Testing Process)
- Planning & Scoping (Lập kế hoạch & Pham vi): Định nghĩa objectives, scope (IP ranges, apps, cloud accounts, exclusions), rules of engagement (RoE), legal authorization (Get written permission!), notification, emergency contacts, reporting format.
- Reconnaissance (Thu thập thông tin): Passive (OSINT: Shodan, Censys, FOFA, Google Dorks, Certificate Transparency, DNS enum, WHOIS) → Active (Nmap, Masscan, ZMap, httpx, Subfinder, Amass, Cloud enum).
- Vulnerability Identification (Xác định lỗ hổng): Automated scanning + Manual verification. Loại bỏ False Positive. Mapping CVE → CWE → MITRE ATT&CK.
- Exploitation / Validation (Khai thác / Xác thực): Chỉ trong Pentest/Red Team. Chứng minh tác động: RCE, PrivEsc, Data Access, Lateral Movement. Không gây hại dữ liệu/sản xuất.
- Post-Exploitation (Sau khai thác): Persistence, Pivoting, Credential Access, Discovery, Collection, Exfiltration simulation – đánh giá blast radius.
- Reporting (Báo cáo): Executive Summary (rủi ro kinh doanh), Technical Findings (CVSS, Evidence, PoC, Remediation, References), Risk Rating, Retest Plan.
- Remediation & Retest (Khắc phục & Kiểm tra lại): Dev/Ops vá lỗi → Tester verify fix → Close ticket / Update risk register.
Công cụ phổ biến theo nhóm (Tool Categories)
| Nhóm | Công cụ đại diện |
|---|---|
| Network Discovery & Port Scanning | Nmap (gold standard), Masscan (fast), ZMap (Internet-wide), RustScan, Naabu |
| Vulnerability Scanning | Nessus Pro, OpenVAS/Greenbone, Qualys VMDR, Rapid7 InsightVM, Tenable.io, OpenVAS, Trivy (container/IaC), Grype, Syft |
| Web App / API Testing | Burp Suite Pro (industry std), OWASP ZAP (free), nuclei (template-based), ffuf (fuzzing), SQLMap, xsstrike, graphql-cop, Postman (security tests) |
| Wireless Testing | Aircrack-ng, Kismet, Wifite, Wifiphisher, bettercap, hcxtools (PMKID), hostapd-wpe (Rogue AP) |
| Active Directory / Windows | BloodHound (SharpHound), CrackMapExec, Impacket (secretsdump, wmiexec, psexec, ntlmrelayx), Rubeus, Certipy, KrbRelayUp, PetitPotam, noPac |
| Cloud Security | ScoutSuite, Prowler, CloudSploit, Pacu (AWS exploitation), AzureHound, GCPFirewallEnum, TruffleHog (secrets), Checkov/tfsec (IaC) |
| C2 / Red Team Frameworks | Cobalt Strike (commercial), Brute Ratel C4, Sliver, Havoc, Mythic, Empire/Starkiller (legacy), Merlin |
| SIEM / Log Analysis / Hunting | Splunk, Elastic (ELK), Microsoft Sentinel, Chronicle, Graylog, Wazuh, Sigma rules, KQL/SPL/Lucene query |
| Automation / SecOps | SOAR (Cortex XSOAR, Splunk SOAR, Tines, Shuffle, n8n), Python (pandas, requests, scapy, mitmproxy), PowerShell, Bash, Terraform/Ansible |
Tự kiểm thử mạng của mình (Self-Pentest / Internal Assessment) – Có được không?
CÓ – VÀ NÊN LÀM. Không có luật cấm tổ chức kiểm thử hệ thống của chính mình. Tuy nhiên:
- Phải có Authorization văn bản từ Leadership/Legal (dạng "Rules of Engagement").
- Tách môi trường: Staging/Dev/Test trước – không pentest Production nếu chưa có kinh nghiệm/playbook rollback.
- Tuân thủ PTES (Penetration Testing Execution Standard), OSSTMM, NIST 800-115.
- Dùng tài khoản Non-production / Test accounts.
- Có Rollback plan & Emergency contact nếu làm sập dịch vụ.
- Cân nhắc thuê Third-party Penetration Test hàng năm cho objectivity & compliance (PCI-DSS req 11.3, ISO 27001 A.12.6).
Tại sao Network Security Testing quan trọng?
- Phát hiện lỗ hổng trước khi kẻ tấn công (Proactive vs Reactive).
- Xác thực hiệu quả các kiểm soát (Firewall, WAF, EDR, Segmentation, Patch Mgmt).
- Tuân thủ quy định: PCI-DSS 11.3/11.4, ISO 27001 A.12.6, NIST 800-53 CA-8, SOC 2 CC7.1, Luật An ninh mạng VN Art 16, 28.
- Giảm thiểu tác động tài chính & uy tín của breach (Avg $4.45M – IBM 2023).
- Cải thiện tư thế bảo mật (Security Posture) liên tục –.metrics-driven.
Các loại kiểm thử bảo mật ứng dụng (Application Security Testing)
| Loại | Viết tắt | Mô tả | Giai đoạn SDLC |
|---|---|---|---|
| Static Application Security Testing | SAST | Phân tích source code / bytecode / binary không chạy chương trình (White box) | Code / Build (CI/CD) |
| Dynamic Application Security Testing | DAST | Quét ứng dụng đang chạy (Black box) – fuzzing, injection, auth bypass | Test / Staging / Prod (careful) |
| Interactive AST | IAST | Agent instrumentation runtime – kết hợp SAST+DAST, accurate hơn | Test / Staging |
| Software Composition Analysis | SCA | Quét dependency (3rd party lib) – CVE, license, malicious package | Build / CI/CD / Registry |
| Runtime Application Self-Protection | RASP | Agent trong runtime bảo vệ real-time (block attack, virtual patching) | Production |
| Secrets Detection | - | Tìm hardcoded secrets (API key, password, token) trong code/git history/CI logs | Pre-commit / CI/CD / Git history |
KPIs / Metrics đo lường hiệu quả Testing
- Vulnerability Management: Mean Time to Remediate (MTTR) theo severity (Critical < 15d, High < 30d, Med < 60d, Low < 180d), % assets scanned, % critical vulns open > SLA.
- Penetest: # Findings by severity, % Critical/High remediated, Time to first exploit (TTFE), Coverage (MITRE ATT&CK techniques tested).
- Red Team: Detection Rate (Blue Team), Time to Detect (TTD), Time to Respond (TTR), Blast Radius contained?
- Compliance: % Controls passing, Audit findings open/closed, Evidence completeness.
Kết luận
Network Security Testing không phải sự kiện một lần (one-off) mà là chương trình liên tục (Continuous Security Validation). Kết hợp: Automated Vuln Scanning (hàng tuần/ngày) + Periodic Pentest (6m/1y) + Continuous Configuration Audit (IaC/Policy-as-Code) + Annual Red Team / Purple Team + Threat Modeling (mỗi release). Tự động hóa qua CI/CD, SOAR, GRC Platform để scale. Mục tiêu cuối cùng: Giảm Mean Time to Detect (MTTD) & Mean Time to Respond (MTTR), tăng Resilience.