SCS-C02 免费试练题 · 考证匠讲解
题目
A security engineer wants to forward custom application-security logs from an Amazon EC2 instance to Amazon CloudWatch. The security engineer installs the CloudWatch agent on the EC2 instance and adds the path of the logs to the CloudWatch configuration file. However, CloudWatch does not receive the logs. The security engineer verifies that the awslogs service is running on the EC2 instance. What should the security engineer do next to resolve the issue?
答案
答案 D。进程运行、日志文件可读与 AWS API 权限是三项条件。
拆题
- 进程运行、日志文件可读与 AWS API 权限是三项条件。
- EC2 instance role 提供临时凭证,CloudWatchAgentServerPolicy 包含常见发送权限。
- 旧 awslogs 与统一 CloudWatch agent 的服务名不同,实际排查还应核对启动的是正确 agent。
每个选项为什么对、为什么错
- A:CloudTrail 不接收任意应用日志,把它加 trust principal 也不是 EC2 角色授予发送权限。
- B:S3 trust 不修复 CloudWatch Logs API 授权,而且引入无必要中转。
- C:Inspector 做漏洞等检查,不代替日志采集 agent。
- D(正确):为 EC2 role 授予所需 Logs 权限,解决题中缺少发送授权的方向;生产可收窄到指定 log group。
放到具体场景里
教学例子:agent log 显示 AccessDenied:PutLogEvents,instance profile 没有日志写入权限。补充受限策略后确认 log stream 持续更新。若错误是 connection timeout 则查 endpoint/网络,若 permission denied 读取本地文件则查 OS 权限,不能都靠 attach policy 修复。
| 检查对象 | 本例条件或动作 | 结果与边界 |
|---|---|---|
| 本地 | 文件路径与权限 | 能读日志 |
| 身份 | instance profile | 临时 AWS 凭证 |
| 发送 | Logs API + 网络 | 看具体错误分类 |
遇到同类题的判断顺序
- 确认进程:统一 agent 实际运行。
- 读取错误:区分 OS、网络与 IAM。
- 授权角色:限定日志写入资源。
- 验证事件:新日志进入正确 stream。
结论:进程存活只是一个条件,不代表日志已经送达。
参考资料
继续练这门考试
同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。
