

# SEC04-BP02 在标准化位置收集日志、调查发现和指标
<a name="sec_detect_investigate_events_logs"></a>

 安全团队依靠日志和调查发现来分析事件，找出可能表明出现了未经授权活动或意外更改的事件。为了简化这种分析过程，请将安全日志和调查发现收集到标准化位置。 这样就能将需要分析的数据点用于关联，并可以简化工具集成。

 **期望结果：**您采用标准化的方法来收集、分析和可视化日志数据、调查发现和指标。安全团队可以高效地关联、分析和可视化不同系统的安全数据，以便发现潜在的安全事件并识别异常情况。集成了安全信息和事件管理（SIEM，Security Information and Event Management）系统或其它机制，用于查询和分析日志数据，以便及时响应、跟踪和上报安全事件。

 **常见反模式：**
+  团队独立负责和管理日志记录及指标的收集，但是采取了与企业的日志记录策略不一致的方法。
+  团队没有采取足够的访问控制措施来限制所收集数据的可见性以及对数据的更改。
+  团队没有将其安全日志、调查发现和指标包括在数据分类策略中进行管理。
+  团队在配置数据收集时，忽略了数据主权和本地驻留要求。

 **建立此最佳实践的好处：**采用标准化日志记录解决方案来收集和查询日志数据及事件，可以改善从所包含的信息中获得的见解。为收集的日志数据配置自动处理生命周期，可以降低日志存储产生的成本。您可以根据数据的敏感性和团队需要的访问模式，对收集的日志信息建立精细的访问控制。您可以集成工具，用于关联和可视化数据，以及从数据中发掘洞察。

 **在未建立这种最佳实践的情况下暴露的风险等级：**中 

## 实施指导
<a name="implementation-guidance"></a>

 企业内 AWS 使用量的增长会导致分布式工作负载和环境数量的增加。由于这些工作负载和环境都会生成有关其内部活动的数据，因此在本地收集和存储这些数据对安全运营带来了挑战。安全团队使用安全信息和事件管理（SIEM，Security Information and Event Management）系统等工具，从分布式来源收集数据，并完成关联、分析和响应等工作流。这需要管理一组复杂权限以便访问各种数据来源，而且提取、转换、加载（ETL）流程的操作会带来额外开销。

 要克服这些挑战，可以考虑将所有相关的安全日志数据来源汇总到一个日志归档账户中，如 [Organizing Your AWS Environment Using Multiple Accounts](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/security-ou-and-accounts.html#log-archive-account) 中所述。这包括您的工作负载的所有与安全相关的数据，以及各种 AWS 服务生成的日志，例如 [AWS CloudTrail](https://aws.amazon.com/cloudtrail/)、[AWS WAF](https://aws.amazon.com/waf/)、[弹性负载均衡](https://aws.amazon.com/elasticloadbalancing/) 和 [Amazon Route 53](https://aws.amazon.com/route53/)。使用合适的跨账户权限，在单独的 AWS 账户中的标准化位置收集这些数据可以带来多种好处。这种做法有助于防止受感染的工作负载和环境中发生日志篡改，提供可供其它工具使用的单一集成点，并为配置数据留存和生命周期提供更简化的模型。 评估数据主权、合规范围和其它法规的影响，确定是否需要多个安全数据存储位置和保留期。

 为了简化日志和调查发现的收集和标准化工作，请评估在您的日志存档账户中是否适合使用 [Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/what-is-security-lake.html)。您可以将 Security Lake 配置为自动从各种常见事件源中摄取数据，例如 CloudTrail、Route 53、[Amazon EKS](https://aws.amazon.com/eks/) 和 [VPC 流日志](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html)。您也可以将 AWS Security Hub CSPM 配置作为传输到 Security Lake 的数据来源，这样您就可以将来自其它 AWS 服务（例如 [Amazon GuardDuty](https://aws.amazon.com/guardduty/) 和 [Amazon Inspector](https://aws.amazon.com/inspector/)）的调查发现与您的日志数据相关联。 您还可以使用第三方数据来源集成，或配置自定义数据来源。所有集成都将您的数据标准化为[开放网络安全架构框架](https://github.com/ocsf)（OCSF，Open Cybersecurity Schema Framework）格式，并作为 Parquet 文件存储在 [Amazon S3](https://aws.amazon.com/s3/) 存储桶中，从而消除了 ETL 处理需求。

 将安全数据存储在标准化位置可提供高级分析功能。AWS 建议您将 AWS 环境中运行的安全分析工具部署到[安全工具](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/security-ou-and-accounts.html#security-tooling-accounts)账户中，而且该账户独立于您的日志存档账户。通过这种方法，您可以实施深入的控制措施，用来保护日志和日志管理流程的完整性和可用性，与访问这些日志的工具区分开。 考虑使用服务（例如 [Amazon Athena](https://aws.amazon.com/athena/)）来运行关联多个数据来源的按需查询。还可以集成可视化工具，例如 [Quick](https://aws.amazon.com/quicksight/)。人工智能驱动的解决方案的应用日益广泛，可以执行很多功能，例如将发现结果转化为人类可读的摘要并以自然语言进行交互。为查询设置标准化数据存储位置后，这些解决方案通常会更容易集成。

## 实施步骤
<a name="implementation-steps"></a>

1.  **创建日志存档账户和安全工具账户** 

   1.  使用 AWS Organizations，在安全组织单位下[创建日志存档账户和安全工具账户](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html)。如果您使用 AWS Control Tower 来管理企业，则会自动为您创建日志存档账户和安全工具账户。您可以根据需要，配置用于访问和管理这些账户的角色和权限。

1.  **配置标准化安全数据位置** 

   1.  确定创建标准化安全数据位置的策略。 为此，您可以使用通用数据湖架构方法、第三方数据产品或 [ Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/getting-started.html) 等方案。AWS 建议您从您的账户[选择加入](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html)的 AWS 区域中收集安全数据，即使这些区域并未处于活跃使用状态。

1.  **将数据来源配置为发布到您的标准化位置** 

   1.  确定您的安全数据的来源，并将这些来源配置为发布到您的标准化位置。评估能够以所需格式自动导出数据的方案，而不是那些需要开发 ETL 流程的方案。使用 Amazon Security Lake，您可以从支持的 AWS 来源和集成的第三方系统[收集数据](https://docs.aws.amazon.com/security-lake/latest/userguide/source-management.html)。

1.  **配置工具来访问您的标准化位置** 

   1.  配置 Amazon Athena、Quick 或第三方解决方案等工具，来获取您的标准化位置所要求的访问权限。 将这些工具配置为在安全工具账户之外运行，并在适用时，允许对日志存档账户的跨账户读取访问。[在 Amazon Security Lake 上创建订阅用户](https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)，以便向这些工具提供对您数据的访问权限。

## 资源
<a name="resources"></a>

 **相关最佳实践：**
+  [SEC01-BP01 使用账户分隔工作负载](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_securely_operate_multi_accounts.html) 
+  [SEC07-BP04 定义数据生命周期管理](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_data_classification_lifecycle_management.html) 
+  [SEC08-BP04 强制实施访问控制](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_protect_data_rest_access_control.html) 
+  [OPS08-BP02 分析工作负载日志](https://docs.aws.amazon.com/wellarchitected/latest/framework/ops_workload_observability_analyze_workload_logs.html) 

 **相关文档：**
+  [AWS Whitepapers: Organizing Your AWS Environment Using Multiple Accounts](https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/organizing-your-aws-environment.html) 
+  [AWS Prescriptive Guidance: AWS Security Reference Architecture (AWS SRA)](https://docs.aws.amazon.com/prescriptive-guidance/latest/security-reference-architecture/welcome.html) 
+  [AWS Prescriptive Guidance: Logging and monitoring guide for application owners](https://docs.aws.amazon.com/prescriptive-guidance/latest/logging-monitoring-for-application-owners/introduction.html) 

 **相关示例：**
+  [Aggregating, searching, and visualizing log data from distributed sources with Amazon Athena and Quick](https://aws.amazon.com/blogs/security/aggregating-searching-and-visualizing-log-data-from-distributed-sources-with-amazon-athena-and-amazon-quicksight/) 
+  [How to visualize Amazon Security Lake findings with Quick](https://aws.amazon.com/blogs/security/how-to-visualize-amazon-security-lake-findings-with-amazon-quicksight/) 
+  [Generate AI powered insights for Amazon Security Lake using Amazon SageMaker AI Studio and Amazon Bedrock](https://aws.amazon.com/blogs/security/generate-ai-powered-insights-for-amazon-security-lake-using-amazon-sagemaker-studio-and-amazon-bedrock/) 
+  [Identify cybersecurity anomalies in your Amazon Security Lake data using Amazon SageMaker AI](https://aws.amazon.com/blogs/machine-learning/identify-cybersecurity-anomalies-in-your-amazon-security-lake-data-using-amazon-sagemaker/) 
+  [Ingest, transform, and deliver events published by Amazon Security Lake to Amazon OpenSearch Service](https://aws.amazon.com/blogs/big-data/ingest-transform-and-deliver-events-published-by-amazon-security-lake-to-amazon-opensearch-service/) 
+  [Simplify AWS CloudTrail log analysis with natural language query generation in CloudTrail Lake](https://aws.amazon.com/blogs/aws/simplify-aws-cloudtrail-log-analysis-with-natural-language-query-generation-in-cloudtrail-lake-preview/) 

 **相关工具：**
+  [Amazon Security Lake](https://docs.aws.amazon.com/security-lake/latest/userguide/what-is-security-lake.html) 
+  [Amazon Security Lake 合作伙伴集成](https://aws.amazon.com/security-lake/partners/) 
+  [开放式网络安全架构框架（OCSF）](https://github.com/ocsf) 
+  [Amazon Athena](https://aws.amazon.com/athena/) 
+  [Quick](https://aws.amazon.com/quicksight/) 
+  [Amazon Bedrock](https://aws.amazon.com/bedrock/)：