Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Cách thực hiện kiểm thử bảo mật mạng (Network Security Testing)

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ạiMục tiêuPhương phápCông cụ điển hìnhTầ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, cloudCredentialed/Non-credentialed scan, Agent-based, Container/Image scan, IaC scanNessus, OpenVAS/Greenbone, Qualys VMDR, Rapid7 InsightVM, Tenable.io, Trivy, Grype, Checkov, tfsecHà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/responseBlack/White/Gray box. External/Internal/Wireless/Web App/API/Cloud/AD/Client-side/Physical. Theo PTES, OSSTMM, NIST 800-115Metasploit, Cobalt Strike, Burp Suite Pro, Nmap, BloodHound, CrackMapExec, Impacket, Rubeus, SQLMap, ffuf, nuclei, custom scripts6 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 scanningNessus 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 EmulationMô 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 profilesNă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 flowSTRIDE, PASTA, ATT&CK-based Threat Modeling, Data Flow Diagrams (DFD), Trust BoundariesMicrosoft Threat Modeling Tool, OWASP Threat Dragon, IriusRisk, CAIRIS, draw.io + custom templatesMỗi release lớn / Quý

Quy trình kiểm thử chuẩn (Standard Testing Process)

  1. 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.
  2. 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).
  3. Vulnerability Identification (Xác định lỗ hổng): Automated scanning + Manual verification. Loại bỏ False Positive. Mapping CVE → CWE → MITRE ATT&CK.
  4. 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.
  5. Post-Exploitation (Sau khai thác): Persistence, Pivoting, Credential Access, Discovery, Collection, Exfiltration simulation – đánh giá blast radius.
  6. Reporting (Báo cáo): Executive Summary (rủi ro kinh doanh), Technical Findings (CVSS, Evidence, PoC, Remediation, References), Risk Rating, Retest Plan.
  7. 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ómCông cụ đại diện
Network Discovery & Port ScanningNmap (gold standard), Masscan (fast), ZMap (Internet-wide), RustScan, Naabu
Vulnerability ScanningNessus Pro, OpenVAS/Greenbone, Qualys VMDR, Rapid7 InsightVM, Tenable.io, OpenVAS, Trivy (container/IaC), Grype, Syft
Web App / API TestingBurp Suite Pro (industry std), OWASP ZAP (free), nuclei (template-based), ffuf (fuzzing), SQLMap, xsstrike, graphql-cop, Postman (security tests)
Wireless TestingAircrack-ng, Kismet, Wifite, Wifiphisher, bettercap, hcxtools (PMKID), hostapd-wpe (Rogue AP)
Active Directory / WindowsBloodHound (SharpHound), CrackMapExec, Impacket (secretsdump, wmiexec, psexec, ntlmrelayx), Rubeus, Certipy, KrbRelayUp, PetitPotam, noPac
Cloud SecurityScoutSuite, Prowler, CloudSploit, Pacu (AWS exploitation), AzureHound, GCPFirewallEnum, TruffleHog (secrets), Checkov/tfsec (IaC)
C2 / Red Team FrameworksCobalt Strike (commercial), Brute Ratel C4, Sliver, Havoc, Mythic, Empire/Starkiller (legacy), Merlin
SIEM / Log Analysis / HuntingSplunk, Elastic (ELK), Microsoft Sentinel, Chronicle, Graylog, Wazuh, Sigma rules, KQL/SPL/Lucene query
Automation / SecOpsSOAR (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ạiViết tắtMô tảGiai đoạn SDLC
Static Application Security TestingSASTPhân tích source code / bytecode / binary không chạy chương trình (White box)Code / Build (CI/CD)
Dynamic Application Security TestingDASTQuét ứng dụng đang chạy (Black box) – fuzzing, injection, auth bypassTest / Staging / Prod (careful)
Interactive ASTIASTAgent instrumentation runtime – kết hợp SAST+DAST, accurate hơnTest / Staging
Software Composition AnalysisSCAQuét dependency (3rd party lib) – CVE, license, malicious packageBuild / CI/CD / Registry
Runtime Application Self-ProtectionRASPAgent 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 logsPre-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.