Tại sao cần bảo mật ứng dụng (Application Security - AppSec)?
Ứng dụng hiện đại (Web, Mobile, API, Microservices, SaaS, Cloud-native) là bề mặt tấn công lớn nhất (Largest Attack Surface) của tổ chức. Theo báo cáo Verizon DBIR, OWASP: >70% vi phạm dữ liệu bắt nguồn từ lỗ hổng ứng dụng (Injection, Broken Access Control, Crypto Failures...).
3 Lĩnh vực bảo mật cấp độ ứng dụng
| Loại kiểm soát | Mô tả | Ví dụ |
| Technical (Kỹ thuật) | Biện pháp công nghệ bảo vệ code, data, runtime | SAST/DAST/IAST/SCA, WAF, RASP, API Gateway, Secrets Management, Encryption |
| Administrative (Quản trị) | Chính sách, quy trình, đào tạo, tuân thủ | SDL (Security Development Lifecycle), Code Review mandatory, Security Training, Policy as Code |
| Physical (Vật lý) | Bảo vệ hạ tầng chạy ứng dụng | Data Center Security, HSM, TPM, Secure Boot, Hardware Root of Trust |
Vòng đời phát triển an ninh (Secure SDLC / DevSecOps)
- Plan/Design: Threat Modeling (STRIDE, PASTA, LINDDUN), Architecture Review, Security Requirements
- Code/Develop: Secure Coding Standards (OWASP, CERT), IDE Plugins (SonarLint, Snyk), Pre-commit Hooks (Secrets scan)
- Build/CI: SAST (Static Analysis), SCA (Software Composition Analysis - Dependency Check), Container Scan, IaC Scan (Checkov, tfsec)
- Test/Staging: DAST (Dynamic Analysis), IAST (Interactive), API Fuzzing, Penetration Test, Chaos Engineering
- Deploy/CD: Image Signing (Cosign/Sigstore), Admission Control (Kyverno, OPA/Gatekeeper), SBOM Generation (SPDX, CycloneDX)
- Operate/Monitor: RASP (Runtime Application Self-Protection), WAF, API Security, Observability (Logs, Metrics, Traces), Incident Response
OWASP Top 10 2021 (Rủi ro ứng dụng web hàng đầu)
- A01: Broken Access Control - IDOR, Path Traversal, Missing Function Level Access Control
- A02: Cryptographic Failures - Weak crypto, Plaintext transmission, Hardcoded keys, Weak RNG
- A03: Injection - SQLi, NoSQLi, Command Injection, LDAP Injection, XSS (Stored/Reflected/DOM)
- A04: Insecure Design - Missing threat modeling, Business logic flaws, Insecure defaults
- A05: Security Misconfiguration - Default creds, Unnecessary features, Verbose errors, Cloud misconfig (S3 public, Security Groups)
- A06: Vulnerable & Outdated Components - Log4Shell, Spring4Shell, Dependency confusion, Unmaintained libraries
- A07: Identification & Authentication Failures - Weak passwords, Credential stuffing, Session fixation, Missing MFA
- A08: Software & Data Integrity Failures - CI/CD pipeline compromise, Unsigned updates, Insecure deserialization
- A09: Security Logging & Monitoring Failures - Insufficient logging, No alerting, Log injection, Blind spots
- A10: Server-Side Request Forgery (SSRF) - Internal service access, Cloud metadata API abuse, File read via file://
Cách bảo mật ứng dụng hiệu quả (Actionable)
- Shift Left: Tích hợp security sớm nhất trong SDLC (IDE, Pre-commit, CI)
- Automation: SAST/SCA/Container/IaC Scan trên mọi PR/MR (GitHub Actions, GitLab CI, Jenkins)
- Dependency Management: Dependabot/Renovate auto-update, Lock files, Private registry, License compliance
- Secrets Management: HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GitGuardian, TruffleHog - Không bao giờ hardcode secrets
- API Security: Schema validation (OpenAPI), Rate limiting, AuthZ (OPA/Cedar), mTLS, API Gateway (Kong, Apigee, AWS API GW)
- Runtime Protection: WAF (ModSecurity, Cloudflare, AWS WAF), RASP (Datadog, Contrast, FortiAppSec), eBPF-based (Tetragon, Cilium)
- Security Testing: Pen Test hàng năm, Bug Bounty Program, Red Team Exercise, Purple Teaming
- Training: Secure Code Training cho Dev (OWASP Top 10, Language-specific), Security Champions Program
AppSec trong bối cảnh Network Security
An ninh mạng (Network Security) bảo vệ lớp hạ tầng (L3/L4: Firewall, Segmentation, DDoS Protection). An ninh ứng dụng (AppSec) bảo vệ lớp ứng dụng (L7: Business Logic, Data, API, User Session). Cả hai bổ sung nhau - Network Security không thấy được SQLi trong payload HTTPS, AppSec không chặn được DDoS volumetric tại L3/L4.
Tiêu chuẩn & Framework tham chiếu
- OWASP ASVS (Application Security Verification Standard): Mức 1/2/3 - Checklist yêu cầu bảo mật
- OWASP SAMM (Software Assurance Maturity Model): Đánh giá độ trưởng thành AppSec
- NIST SSDF (Secure Software Development Framework): 4 nhóm thực hành: Prepare, Protect, Produce, Respond
- BSIMM (Building Security In Maturity Model): Quan sát thực tế từ 130+ tổ chức
- ISO 27034 / ISO 5055: Application Security Standards