认证考题 | 检测特定时间段内 AWS IAM 访问密钥的使用状况


  题目

A company has a legacy application that runs on a single Amazon EC2 instance. A security audit shows that the application has been using an IAM access key within its code to access an Amazon S3 bucket that is named DOC-EXAMPLE-BUCKET1 in the same AWS account. This access key pair has the s3:GetObject permission to all objects in only this S3 bucket. The company takes the application offline because the application is not compliant with the company’s security policies for accessing other AWS resources from Amazon EC2. A security engineer validates that AWS CloudTrail is turned on in all AWS Regions. CloudTrail is sending logs to an S3 bucket that is named DOC-EXAMPLE-BUCKET2. This S3 bucket is in the same AWS account as DOC-EXAMPLE-BUCKET1. However, CloudTrail has not been configured to send logs to Amazon CloudWatch Logs. The company wants to know if any objects in DOC-EXAMPLE-BUCKET1 were accessed with the IAM access key in the past 60 days. If any objects were accessed, the company wants to know if any of the objects that are text files (.txt extension) contained personally identifiable information (PII).
Which combination of steps should the security engineer take to gather this information? (Choose two.)
A. Use Amazon CloudWatch Logs Insights to identify any objects in DOC-EXAMPLE-BUCKET1 that contain PII and that were available to the access key.
B. Use Amazon OpenSearch Service to query the CloudTrail logs in DOC-EXAMPLE-BUCKET2 for API calls that used the access key to access an object that contained PII.
C. Use Amazon Athena to query the CloudTrail logs in DOC-EXAMPLE-BUCKET2 for any API calls that used the access key to access an object that contained PII.
D. Use AWS Identity and Access Management Access Analyzer to identify any API calls that used the access key to access objects that contained PII in DOC-EXAMPLE-BUCKET1.
E. Configure Amazon Macie to identify any objects in DOC-EXAMPLE-BUCKET1 that contain PII and that were available to the access key.

  参考答案

CE

  需求概括

一家公司有一个运行在单个 Amazon EC2实例上的遗留应用程序。安全审计显示,该应用程序在其代码中使用了一个 IAM 访问密钥来访问同一个 AWS 账户中名为 DOC-EXAMPLE-BUCKET1的 Amazon S3存储桶。此访问密钥对仅对该 S3存储桶中的所有对象具有 s3:GetObject 权限。由于该应用程序不符合公司关于从 Amazon EC2访问其他 AWS 资源的安全策略,公司已将其下线。安全工程师验证了所有 AWS 区域均已启用 AWS CloudTrail。CloudTrail 将日志发送到名为 DOC-EXAMPLE-BUCKET2的 S3存储桶。此 S3存储桶与 DOC-EXAMPLE-BUCKET1位于同一个 AWS 账户中。然而,CloudTrail 未被配置为将日志发送到 Amazon CloudWatch Logs。公司想知道在过去60天内是否有人使用该 IAM 访问密钥访问了 DOC-EXAMPLE-BUCKET1中的任何对象。如果有对象被访问,公司还想知道其中是否有任何文本文件(.txt 扩展名)包含个人身份信息(PII)。
如何通过分析日志确定过去60天内特定 IAM 访问密钥是否访问了 S3存储桶中的对象,并进一步检查文本文件是否包含 PII?
该解决方案设计的需求包括,支持对日志数据的结构化查询,以识别特定访问密钥的 API 调用记录;能够筛选特定时间范围、存储桶和对象类型; 需支持对 S3存储桶中文本类型对象的内容进行扫描,识别其中是否包含个人身份信息(PII)。

  参考解析

技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。

A. 不正确。使用 Amazon CloudWatch Logs Insights 识别 DOC-EXAMPLE-BUCKET1中包含 PII 且对访问密钥可用的任何对象。CloudTrail 日志被配置发送到 S3 存储桶,因此无法使用 CloudWatch Logs Insights 查询日志数据。
B. 不正确。使用 Amazon OpenSearch Service 查询 DOC-EXAMPLE-BUCKET2中的 CloudTrail 日志,查找使用访问密钥访问包含 PII 的对象的 API 调用。虽然 OpenSearch Service 可查询日志,但配置复杂且成本较高,对于简单日志查询不是最优选择。
C. 正确。使用 Amazon Athena 查询 DOC-EXAMPLE-BUCKET2中的 CloudTrail 日志,查找使用访问密钥访问包含 PII 的对象的任何 API 调用。Athena 可直接查询 S3中的 CloudTrail 日志,支持 SQL 语法,适合筛选特定访问密钥和时间范围内的 API 调用,是高效的选择。
D. 不正确。使用 AWS Identity and Access Management Access Analyzer 识别在 DOC-EXAMPLE-BUCKET1中使用访问密钥访问包含 PII 的对象的任何 API 调用。Access Analyzer 主要用于分析资源访问策略,不直接支持日志查询或 PII 检测,此选项不适用。
E. 正确。配置 Amazon Macie 识别 DOC-EXAMPLE-BUCKET1中包含 PII 且对访问密钥可用的任何对象。Macie 专门用于检测 S3存储桶中的敏感数据,可扫描文本文件内容以识别 PII,是检测 PII 的理想选择。

  技术总结

Amazon Athena:可直接查询存储在 S3中的 CloudTrail 日志,支持 SQL 语法,适合结构化日志分析。
Amazon Macie:专门用于检测 S3存储桶中敏感数据(如 PII)的服务,支持自动化内容扫描。
Amazon OpenSearch Service:适合复杂日志分析和搜索,但配置和管理成本较高,对于简单查询可能过度复杂。
IAM Access Analyzer:主要用于分析资源访问策略,不直接支持日志查询或 PII 检测。
Amazon CloudWatch Logs Insights:需日志设置为发送到 CloudWatch Logs。