- Tác giả

- Name
- Nguyễn Đức Xinh
- Ngày xuất bản
- Ngày xuất bản
Tổng Hợp Các Dịch Vụ AWS Security, Identity, and Compliance
Giới Thiệu
Nhóm dịch vụ AWS Security, Identity, and Compliance bao gồm các “khối Lego” bảo mật cốt lõi để xây dựng hệ thống an toàn, tuân thủ và có khả năng giám sát liên tục. Bài viết này tổng hợp các dịch vụ trọng yếu, cách chọn cho từng tình huống, và best practices vận hành trong môi trường nhiều tài khoản (multi‑account) và nhiều vùng (multi‑Region).
Phạm vi dịch vụ chính:
- Identity & Access: AWS Identity and Access Management (IAM), AWS IAM Identity Center (AWS Single Sign‑On), AWS Directory Service, Amazon Cognito, AWS Resource Access Manager (RAM)
- Crypto & Secrets: AWS Key Management Service (KMS), AWS CloudHSM, AWS Secrets Manager, AWS Certificate Manager (ACM)
- Network & Edge Protection: AWS WAF, AWS Shield, AWS Firewall Manager, AWS Network Firewall
- Threat Detection & Posture: Amazon GuardDuty, Amazon Inspector, Amazon Macie, Amazon Detective, AWS Security Hub
- Compliance & Governance: AWS Artifact, AWS Audit Manager
Mục tiêu:
- Nắm rõ chức năng/khác biệt của từng dịch vụ và khi nào dùng.
- Quy hoạch kiến trúc bảo mật chuẩn: identity, dữ liệu, mạng, giám sát, tuân thủ.
- Có decision guide, bảng so sánh nhanh, kiến trúc mẫu, và tips tối ưu.
Phân Loại Nhanh Theo Nhu Cầu
- Quản trị quyền truy cập nội bộ, máy‑máy: IAM, Identity Center (SSO), Directory Service, RAM
- Xác thực người dùng ứng dụng: Amazon Cognito
- Quản lý khóa/mã hóa và bí mật: KMS, CloudHSM, Secrets Manager, ACM
- Bảo vệ tầng edge/network và web: WAF, Shield, Firewall Manager, Network Firewall
- Phát hiện đe dọa và rủi ro: GuardDuty, Inspector, Macie, Detective
- Tập trung hóa kết quả và quản trị bảo mật: Security Hub
- Tài liệu tuân thủ và đánh giá audit: Artifact, Audit Manager
Bảng So Sánh Nhanh (Toàn Cảnh)
| Nhóm | Dịch vụ | Mục tiêu | Điển hình dùng khi | Tích hợp nổi bật |
|---|---|---|---|---|
| Identity | IAM | Kiểm soát truy cập tài nguyên AWS ở mức policy | Quản lý role, policy, permission boundary, least privilege | Organizations, STS, CloudTrail |
| Identity | Identity Center (SSO) | SSO người dùng vào AWS accounts và ứng dụng | Doanh nghiệp nhiều account, SSO OIDC/SAML | AWS Organizations, IdP doanh nghiệp |
| Identity | Directory Service | Managed AD/AD Connector | Windows workloads, RDS for SQL Server | EC2, FSx, WorkSpaces |
| Identity | Cognito | Xác thực/ủy quyền người dùng cuối | Web/mobile app, user pool, federation | API Gateway, ALB, AppSync |
| Sharing | RAM | Chia sẻ tài nguyên giữa accounts | Chia sẻ VPC subnets, Route53, License | Organizations |
| Crypto | KMS | Quản lý CMK, mã hóa at rest/in transit | S3/EBS/RDS/DynamoDB/Kinesis encryption | CloudTrail, CloudWatch |
| Crypto | CloudHSM | HSM chuyên dụng đạt compliance cao | Yêu cầu FIPS 140‑2 Level 3 | KMS (Custom Key Store) |
| Secrets | Secrets Manager | Lưu trữ & rotate secrets | DB credentials, API keys | RDS, Lambda, ECS/EKS |
| PKI | ACM | Quản lý chứng chỉ TLS/SSL | CloudFront, ALB/NLB, API Gateway | Auto‑renew public certs |
| Edge | WAF | Web ACL bảo vệ L7 | Chống SQLi/XSS/bot | CloudFront, ALB, API Gateway |
| Edge | Shield | DDoS protection (Standard/Advanced) | Bảo vệ L3/L4/L7 DDoS | CloudFront, Route 53, Global Accelerator |
| Network | Firewall Manager | Quản trị tập trung WAF, Shield, Network Firewall | Nhiều account/nhiều region đồng bộ policy | Security Hub, Organizations |
| Network | Network Firewall | Stateful firewall cho VPC | IDS/IPS, domain/IP rules | VPC, Transit Gateway |
| Threat | GuardDuty | Phát hiện đe dọa bằng ML/tri thức | Phân tích logs (VPC Flow, DNS, CloudTrail) | S3 Malware Scan, EKS audit |
| Threat | Inspector | Đánh giá CVE, lỗ hổng EC2/ECR/Lambda | Continuous scanning | Security Hub |
| Data | Macie | Phát hiện dữ liệu nhạy cảm S3 | PII/PHI detection | Security Hub |
| Investigate | Detective | Điều tra mối quan hệ sự kiện | Phân tích đồ thị bảo mật | GuardDuty, CloudTrail |
| Posture | Security Hub | Aggregation & compliance checks | CIS/NIST/Foundational Security Best Practices | FMS, GuardDuty, Inspector |
| Compliance | Artifact | Kho tài liệu compliance AWS | Lấy báo cáo SOC/ISO/PCI | Audit nội bộ/đối tác |
| Compliance | Audit Manager | Đánh giá kiểm soát & bằng chứng | Tự động thu thập evidence | Security Hub, CloudTrail |
1. Identity & Access
1.1 IAM (Identity and Access Management)
- Quản lý người dùng/role/service principal, policy JSON theo nguyên tắc least privilege.
- Hỗ trợ permission boundaries, session policy, resource‑based policy (S3, KMS, SQS...), IAM Roles for Service Accounts (IRSA) với EKS.
- Best practices: dùng role thay vì access key, tách quyền theo nhiệm vụ, dùng condition keys, kiểm tra với IAM Access Analyzer.
1.2 AWS IAM Identity Center (AWS Single Sign‑On)
- SSO người dùng từ IdP doanh nghiệp (AD, Okta, Azure AD…) vào nhiều AWS accounts và ứng dụng.
- Phân quyền qua permission sets, gán theo account/OU của Organizations.
- Giảm quản trị user rải rác giữa accounts, chuẩn hóa audit và offboarding.
1.3 AWS Directory Service
- Managed Microsoft AD, AD Connector, Simple AD (deprecated hướng dùng khác). Dùng cho Windows/AD integrated services.
- Tích hợp với EC2 Windows, RDS for SQL Server, FSx for Windows File Server, WorkSpaces.
1.4 Amazon Cognito
- Xác thực người dùng ứng dụng (user pools) và federation (OIDC/SAML/social). Quản lý signup/signin, MFA, token.
- Kết hợp API Gateway/ALB/AppSync để bảo vệ API/web.
1.5 AWS Resource Access Manager (RAM)
- Chia sẻ tài nguyên cross‑account: subnets, Route 53 Resolver rules, License Manager…
- Hỗ trợ Organizations để scale chia sẻ an toàn, có kiểm soát.
2. Crypto & Secrets
2.1 AWS Key Management Service (KMS)
- Tạo/quản lý Customer Managed Keys (CMK), kiểm soát key policy, grants; tích hợp encryption at rest cho hầu hết dịch vụ AWS.
- Multi‑Region keys, automatic key rotation, CloudTrail logging cho hoạt động với khóa.
2.2 AWS CloudHSM
- HSM chuyên dụng, khách hàng kiểm soát. Dùng khi yêu cầu compliance cao (FIPS 140‑2 Level 3) hoặc thuật toán/custom KMS key store.
- Có thể làm Custom Key Store cho KMS để giữ critical keys trong HSM.
2.3 AWS Secrets Manager
- Lưu trữ bí mật (DB credentials, API keys), hỗ trợ auto‑rotation với RDS/Aurora/Redshift; versioning, fine‑grained IAM policy.
- Khác với SSM Parameter Store (cơ bản hơn), Secrets Manager tối ưu cho secrets lifecycle và rotation.
2.4 AWS Certificate Manager (ACM)
- Cấp phát và quản lý chứng chỉ TLS/SSL (public/private). Auto‑renew public cert.
- Dùng với CloudFront, ALB/NLB, API Gateway, v.v.
3. Network & Edge Protection
3.1 AWS WAF
- Bảo vệ L7 (HTTP/HTTPS) khỏi SQLi, XSS, bots; rule‑based (IP rate‑based, geo match), managed rulesets.
- Gắn vào CloudFront, ALB, API Gateway, AppSync.
3.2 AWS Shield
- DDoS protection. Shield Standard tự động cho CloudFront/Route53/GA. Shield Advanced cung cấp thêm bảo vệ nâng cao, cost protection, 24/7 DDoS Response Team (DRT).
3.3 AWS Firewall Manager (FMS)
- Quản trị tập trung policy WAF/Shield/Network Firewall trên nhiều account/region. Áp chính sách theo OU/Tags, autoplace.
3.4 AWS Network Firewall
- Stateful managed firewall trong VPC. Hỗ trợ domain/IP/port rules, pattern inspection, IDS/IPS, tích hợp với Transit Gateway.
4. Threat Detection, Vulnerability, Data Protection & Investigation
4.1 Amazon GuardDuty
- Phát hiện đe dọa bằng ML/tri thức từ CloudTrail, VPC Flow Logs, DNS logs, EKS audit logs, S3 Malware Protection.
- Hỗ trợ multi‑account aggregator, auto‑enable qua Organizations.
4.2 Amazon Inspector
- Đánh giá lỗ hổng và cấu hình không an toàn cho EC2, ECR images, Lambda (package vulnerabilities & code‑level issues tùy phạm vi tính năng hiện tại).
- Continuous scanning, tích hợp patching workflows.
4.3 Amazon Macie
- Khám phá dữ liệu nhạy cảm trong S3 (PII/PHI), gợi ý phân loại và vi phạm chính sách dữ liệu.
4.4 Amazon Detective
- Xây dựng đồ thị sự kiện từ logs để điều tra liên kết giữa đối tượng/sự kiện, hỗ trợ triage và root cause.
4.5 AWS Security Hub
- Tập trung hóa findings từ GuardDuty/Inspector/Macie/Config/WAF/Firewall Manager…
- Chuẩn đối chiếu CIS/NIST/Foundational Security Best Practices; custom insights; automation với EventBridge.
5. Compliance & Audit
5.1 AWS Artifact
- Kho tài liệu chứng nhận và báo cáo compliance của AWS (SOC, ISO, PCI…). Tải về phục vụ audit nội bộ, khách hàng, đối tác.
5.2 AWS Audit Manager
- Tự động thu thập evidence (CloudTrail, Config…) cho framework như GDPR, ISO, PCI. Quản lý control set, tracking tiến độ audit.
So Sánh Chi Tiết Theo Chủ Đề
A) Identity: IAM vs Identity Center vs Cognito
| Tiêu chí | IAM | Identity Center (SSO) | Cognito |
|---|---|---|---|
| Đối tượng | Principals nội bộ AWS (user/role/service) | Nhân sự doanh nghiệp vào AWS accounts/apps | Người dùng cuối (customer/end‑user) |
| Chuẩn liên kết | STS, IAM policy | SAML/OIDC tới IdP enterprise | OIDC/SAML, social Id providers |
| Trường hợp dùng | Quản trị quyền tài nguyên AWS | Quản lý SSO multi‑account | AuthN/AuthZ cho web/mobile app |
B) Crypto/Secrets: KMS vs CloudHSM vs Secrets Manager vs ACM
| Dịch vụ | Mục tiêu | Khi nào dùng |
|---|---|---|
| KMS | Key management managed, tích hợp rộng | Mã hóa at rest dịch vụ AWS, key rotation |
| CloudHSM | HSM chuyên dụng do khách kiểm soát | Yêu cầu tuân thủ/cipher custom, FIPS cao |
| Secrets Manager | Lưu/rotate secrets | DB creds, API keys, rotation tự động |
| ACM | Quản lý chứng chỉ TLS | Public/private cert, auto‑renew |
C) Web/App Protection: WAF vs Shield vs Firewall Manager vs Network Firewall
| Dịch vụ | Lớp bảo vệ | Khi nào dùng |
|---|---|---|
| WAF | L7 (HTTP) | Chống SQLi/XSS/bot cho CloudFront/ALB/API GW |
| Shield | L3/L4/L7 DDoS | Luôn bật; Advanced cho ứng dụng quan trọng |
| Firewall Manager | Orchestration | Quản trị tập trung policy WAF/Shield/NF |
| Network Firewall | VPC stateful | Kiểm soát egress/ingress, IDS/IPS ở VPC |
D) Threat & Posture: GuardDuty vs Inspector vs Macie vs Detective vs Security Hub
| Dịch vụ | Loại | Mục tiêu |
|---|---|---|
| GuardDuty | Threat detection | Phát hiện hành vi bất thường |
| Inspector | Vulnerability mgmt | Quét CVE/hardening EC2/ECR/Lambda |
| Macie | Data discovery | PII/PHI trên S3 |
| Detective | Investigation | Liên kết sự kiện điều tra |
| Security Hub | Aggregation & compliance | Bảng điều khiển, tiêu chuẩn CIS/NIST |
Decision Guide (Hỏi‑Đáp Nhanh)
- Xác thực người dùng cuối cho app? → Cognito.
- SSO cho nhân sự vào nhiều AWS accounts? → Identity Center (SSO) + Organizations.
- Quản lý quyền dịch vụ AWS (least privilege)? → IAM với policy/role, IAM Access Analyzer.
- Mã hóa dữ liệu và quản lý khóa? → KMS (hoặc CloudHSM khi cần compliance cao/custom crypto).
- Lưu và rotate secrets? → Secrets Manager.
- Bảo vệ web trước SQLi/XSS/bots? → WAF (+ Shield Advanced cho DDoS quan trọng).
- Firewall stateful ở VPC? → Network Firewall (kết hợp Transit Gateway).
- Quản trị tập trung policy bảo mật nhiều account? → Firewall Manager, Security Hub.
- Phát hiện đe dọa từ logs/hành vi? → GuardDuty.
- Quét lỗ hổng EC2/ECR/Lambda? → Inspector.
- Phát hiện dữ liệu nhạy cảm trên S3? → Macie.
- Điều tra mối liên hệ sự cố? → Detective.
- Chuẩn bị bằng chứng compliance? → Artifact (tài liệu), Audit Manager (evidence).
Kiến Trúc Mẫu
1) Multi‑Account Security Baseline (Enterprise)
- AWS Organizations + OU phân lớp (Security, Shared Services, Sandbox, Prod…).
- Security Account: GuardDuty admin, Security Hub admin, Firewall Manager admin, centralized logging (CloudTrail org trails, S3 log bucket).
- Shield Advanced bật cho phân phối qua CloudFront/Route 53/Global Accelerator.
- SCP kiểm soát hành vi nguy hiểm (deny root access keys, restrict regions…).
2) Web/App Protection End‑to‑End
- CloudFront → WAF (managed rules) → ALB/NLB → ECS/EKS/EC2.
- Shield (Std/Adv) bảo vệ L3/L4/L7; Certificate qua ACM; secret DB bằng Secrets Manager.
- Inspector quét lỗ hổng, GuardDuty phát hiện đe dọa, findings đổ về Security Hub.
3) Data Protection & Secrets
- Dịch vụ lưu trữ (S3, EBS, RDS, DynamoDB) mã hóa với KMS CMK.
- Secrets Manager lưu và rotate DB creds; CloudHSM khi cần HSM chuyên dụng.
- Macie scan S3 để phát hiện PII/PHI; EventBridge tự động hóa remediations.
4) Developer Access & SSO
- Identity Center tích hợp IdP doanh nghiệp; permission sets cấp quyền theo vai trò.
- IAM role cho CI/CD; IRSA cho EKS; RAM chia sẻ subnet/resources có kiểm soát.
Best Practices Cốt Lõi
- Least privilege: policy tối thiểu cần thiết; dùng condition keys và permission boundaries.
- Tách nhiệm vụ: phân tách role human/automation; MFA bắt buộc cho đặc quyền cao.
- Encryption everywhere: bật mã hóa at rest và TLS in transit; quản trị CMK nghiêm ngặt.
- Logging & monitoring: CloudTrail org‑wide, CloudWatch metrics/alarms, Security Hub/GuardDuty.
- Network segmentation: VPC tách biệt, Security Group nguyên tắc “deny by default”, Network Firewall cho egress kiểm soát.
- Patching & vulnerability: Inspector liên tục, tự động hoá patch pipelines.
- Secrets hygiene: dùng Secrets Manager và rotation; không hardcode secrets.
- Automation: EventBridge + Systems Manager + Lambda để tự khắc phục (auto‑remediation).
Tối Ưu Chi Phí (Security‑Wise)
- Shield Advanced: bật cho các workload Internet‑facing quan trọng để nhận cost‑protection DDoS và hỗ trợ DRT.
- WAF: dùng managed rule groups phù hợp; theo dõi false positives, điều chỉnh rule thứ tự.
- Security Hub/GuardDuty/Inspector/Macie: bật ở tài khoản tập trung, dùng auto‑enable qua Organizations; lọc findings nhiễu, ưu tiên khắc phục theo rủi ro.
- KMS: quản lý số lượng CMK hợp lý; policy và grants tinh gọn; theo dõi chi phí request.
Mẹo Ôn Thi (AWS Certified)
- Phân biệt rõ: IAM (nội bộ) vs Identity Center (SSO enterprise) vs Cognito (end‑user auth).
- KMS vs CloudHSM vs Secrets Manager vs ACM: biết rõ mục đích và khi nào dùng.
- WAF vs Shield vs Firewall Manager vs Network Firewall: lớp bảo vệ và phạm vi áp dụng.
- GuardDuty/Inspector/Macie/Detective/Security Hub: chuỗi phát hiện ‑ đánh giá ‑ điều tra ‑ tổng hợp.
- Artifact vs Audit Manager: tài liệu chứng nhận vs thu thập evidence.
Ví Dụ Nhanh
WAF Rule Set Cơ Bản (Minh Hoạ Mục tiêu)
Rules:
- AWS-AWSManagedRulesCommonRuleSet
- Rate-based rule: 2000 req/5m per IP
- Geo match: Block countries not in allow-list
- Custom: Block requests with suspicious user-agent
IAM Policy Nguyên Tắc Least Privilege (Giản Lược)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::my-bucket/app/*",
"Condition": {"StringEquals": {"aws:RequestedRegion": "ap-southeast-1"}}
}
]
}
Checklist Áp Dụng Nhanh
- Bật CloudTrail org‑wide; centralize logs.
- Bật GuardDuty, Security Hub, Inspector, Macie (có chọn lọc) và aggregator.
- Dùng Identity Center + Organizations cho SSO và quyền nhất quán.
- Mã hóa với KMS; secrets vào Secrets Manager; cert qua ACM.
- Triển khai WAF/Shield cho Internet‑facing; Network Firewall ở VPC egress.
- Tự động hoá remediations bằng EventBridge + SSM/Lambda.
Kết Luận
Không có “một nút bấm” cho bảo mật. Hệ sinh thái AWS Security cung cấp đủ thành phần để xây dựng nền tảng an toàn, giám sát liên tục, và tuân thủ. Hãy bắt đầu từ identity/least‑privilege, bao phủ dữ liệu bằng mã hóa, kiểm soát biên mạng, chủ động phát hiện/khắc phục đe dọa, và quản trị compliance tập trung. Kết hợp đúng dịch vụ, tự động hóa đúng chỗ sẽ giúp hệ thống của bạn vừa an toàn vừa hiệu quả.
