AWS Config
A camera pointed at your resources' configuration. It records what a resource looks like every time it changes, keeps the history, judges it against rules, and can fix it. It is detective, never preventive — that distinction decides most questions it appears in.
Một cái camera chĩa vào cấu hình của tài nguyên. Nó ghi lại hình dạng resource mỗi lần thay đổi, giữ lịch sử, chấm điểm theo rule, và có thể tự sửa. Nó detective, không bao giờ preventive — phân biệt đó quyết định phần lớn câu hỏi có nó.
The loopVòng lặp
Every arrow here happens after the change lands. If a requirement says "must never exist, not even for a second", Config is the wrong tool — that is an SCP, a CloudFormation Hook, or a pipeline gate.
Mọi mũi tên ở đây xảy ra sau khi thay đổi đã vào. Nếu yêu cầu nói "không được tồn tại dù chỉ một giây", Config là công cụ sai — đó là SCP, CloudFormation Hook, hoặc cổng pipeline.
Config vs the services it gets confused withConfig vs những service hay bị nhầm
| Question in the exam stemCâu hỏi trong đề | ServiceService |
|---|---|
| "How is this resource configured / was it ever unencrypted?""Resource này cấu hình thế nào / đã từng không mã hoá chưa?" | AWS Config |
| "Who called the API that changed it?""Ai gọi API làm nó đổi?" | CloudTrail |
| "CPU / latency / logs""CPU / latency / log" | CloudWatch |
| "React to the change in near-real-time""Phản ứng với thay đổi gần realtime" | EventBridge |
| "Stop the API call from succeeding at all""Chặn hẳn không cho API call thành công" | SCP / IAM |
| "Is there a CVE in this EC2 / container image?""EC2 / container image này có CVE không?" | Inspector |
| "Manage & auto-fix security groups / WAF org-wide""Quản lý & tự sửa security group / WAF toàn org" | Firewall Manager |
| "Generic best-practice recommendations""Khuyến nghị best practice chung chung" | Trusted Advisor |
0.0.0.0/0. Config marks it non-compliant and shows the before/after. CloudTrail names the principal who ran AuthorizeSecurityGroupIngress. EventBridge fires within seconds so a Lambda can revoke it. SCP could have blocked the call only if the condition were expressible — and for a source CIDR it isn't.
Một security group bị mở 0.0.0.0/0. Config đánh dấu non-compliant và cho xem trước/sau. CloudTrail chỉ ra principal đã chạy AuthorizeSecurityGroupIngress. EventBridge bắn trong vài giây để Lambda revoke. SCP chỉ chặn được nếu điều kiện diễn đạt được — và với source CIDR thì không.
Rules — what they can and can't holdRule — chứa được và không chứa được gì
rds-storage-encrypted · encrypted-volumes · s3-bucket-public-read-prohibited · restricted-ssh · required-tags · vpc-sg-open-only-to-authorized-portsHàng trăm cái, dùng ngay. Chỉ có tham số — chỉnh ngưỡng hoặc danh sách giá trị, không viết logic.rds-storage-encrypted · encrypted-volumes · s3-bucket-public-read-prohibited · restricted-ssh · required-tags · vpc-sg-open-only-to-authorized-ports
- A managed rule is not a place to stash a company CIDR list. "Create a Config managed rule containing all our office IP ranges" is a distractor — a shared CIDR list is a customer-managed prefix list shared via RAM.Managed rule không phải chỗ để nhét danh sách CIDR của công ty. "Tạo Config managed rule chứa mọi dải IP văn phòng" là bẫy — danh sách CIDR dùng chung là customer-managed prefix list share qua RAM.
vpc-sg-open-only-to-authorized-portschecks which ports may be open to the world — it can still pass a0.0.0.0/0rule on an authorised port. It also only flags; it never revokes unless you attach remediation.vpc-sg-open-only-to-authorized-portskiểm tra những port nào được mở ra ngoài — nó vẫn có thể cho qua rule0.0.0.0/0trên port hợp lệ. Nó cũng chỉ đánh dấu; không revoke trừ khi bạn gắn remediation.- Rules evaluate on change or on a periodic schedule. A periodic rule can lag by up to its period, so "near-real-time" wording points at EventBridge instead.Rule chạy khi có thay đổi hoặc theo lịch định kỳ. Rule định kỳ có thể trễ tới hết một chu kỳ, nên chữ "gần realtime" là trỏ sang EventBridge.
Detective vs proactive vs preventiveDetective vs proactive vs preventive
| DetectiveDetective | ProactiveProactive | PreventivePreventive | |
|---|---|---|---|
| WhenKhi nào | after the resource existssau khi resource đã tồn tại | on a proposed config, before deploytrên cấu hình dự kiến, trước deploy | at the API callngay tại lời gọi API |
| Blocks?Có chặn? | ✗ | ✗ — returns a verdict only✗ — chỉ trả về kết quả | ✓ |
| Built withXây bằng | Config rule · Control Tower detective controlConfig rule · detective control của Control Tower | Config proactive rule, wired into a pipeline / CFN HookConfig proactive rule, nối vào pipeline / CFN Hook | SCP · Control Tower preventive control · CFN Hook in fail modeSCP · preventive control của Control Tower · CFN Hook ở chế độ fail |
Org-scale: conformance packs & aggregatorsQuy mô org: conformance pack & aggregator
SELECT resourceId, resourceType, awsRegion, accountId
WHERE resourceType = 'AWS::EC2::Instance'
AND tags.key = 'Owner' -- inventory / audit, current state only
- Deploying rules to every account is a conformance pack or a StackSet job. An aggregator only views.Deploy rule vào mọi account là việc của conformance pack hoặc StackSet. Aggregator chỉ xem.
- Config is per Region, per account — you turn on the recorder in each Region you care about. There is no global Config.Config là theo Region, theo account — phải bật recorder ở từng Region quan tâm. Không có Config global.
- Cost control: set the recorder to selected resource types, or use a lower recording frequency for stable types. Recording everything in an ECS/Spot-heavy account gets expensive fast.Kiểm soát chi phí: đặt recorder ở selected resource types, hoặc dùng tần suất ghi thấp hơn cho loại ổn định. Record tất trong account nhiều ECS/Spot sẽ đắt rất nhanh.
Exam reflexesPhản xạ thi
- "Detect resources that are not encrypted / not tagged / publicly readable" → Config rule (or the equivalent Control Tower detective control)."Detect resource chưa mã hoá / chưa tag / public" → Config rule (hoặc detective control tương ứng của Control Tower).
- "What changed on this resource before the incident?" → Config configuration timeline, not CloudTrail (CloudTrail gives you the call, not the resulting shape)."Resource này đổi gì trước sự cố?" → configuration timeline của Config, không phải CloudTrail (CloudTrail cho lời gọi, không cho hình dạng kết quả).
- "Detect and fix automatically, least ops" → Config rule + automatic remediation via SSM Automation. Writing your own Lambda per account is the higher-overhead answer."Detect và tự sửa, ít vận hành nhất" → Config rule + automatic remediation qua SSM Automation. Tự viết Lambda cho từng account là đáp án nhiều overhead hơn.
- "Security team wants one dashboard across 50 accounts" → Config aggregator in the delegated security account (plus a conformance pack to place the rules)."Security muốn một dashboard cho 50 account" → Config aggregator ở security account uỷ quyền (kèm conformance pack để đặt rule).
- Config mentioned in a question that's really about something else (a shared CIDR list, a cost report) is usually just scenery — read the actual requirement.Config xuất hiện trong câu thật ra hỏi chuyện khác (danh sách CIDR chung, báo cáo chi phí) thường chỉ là phông nền — đọc kỹ yêu cầu thật.