

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 为多账户环境配置 EKS 运行时监控（API）
<a name="eks-runtime-monitoring-configuration-multiple-accounts"></a>

在多账户环境中，只有委派的 GuardDuty 管理员账户才能为成员账户启用或禁用 EKS 运行时监控，并管理属于其组织中成员账户的 EKS 集群的 GuardDuty 代理管理。 GuardDuty 成员账户无法通过其账户修改此配置。委托 GuardDuty 管理员账户账户使用管理其成员账户 AWS Organizations。有关多账户环境的更多信息，请参阅[管理多个账户](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html)。

## 为委派的 GuardDuty 管理员账户配置 EKS 运行时监控
<a name="eks-protection-configure-delegated-admin"></a>

本节提供了为属于委派 GuardDuty 管理员账户的 EKS 集群配置 EKS 运行时监控和管理 GuardDuty安全代理的步骤。

根据 [在 Amazon EKS 集群中管理 GuardDuty 安全代理的方法](how-runtime-monitoring-works-eks.md#eksrunmon-approach-to-monitor-eks-clusters)，您可以选择首选方法，并按照下表中所述的步骤进行操作。


|  **管理 GuardDuty安全代理的首选方法**  | **步骤** | 
| --- | --- | 
|  通过管理安全代理 GuardDuty （监控所有 EKS 集群）  |  运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html) API：使用您自己的区域检测器 ID，并将 `features` 对象名称设为 `EKS_RUNTIME_MONITORING`，状态设为 `ENABLED` 进行传递。 将 `EKS_ADDON_MANAGEMENT` 的状态设为 `ENABLED`。 GuardDuty 将管理您账户中所有 Amazon EKS 集群的安全代理的部署和更新。 或者，您可以使用自己的区域探测器 ID 来使用该 AWS CLI 命令。要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` 以下示例同时启用了 `EKS_RUNTIME_MONITORING` 和 `EKS_ADDON_MANAGEMENT`： <pre>aws guardduty update-detector --detector-id 12abc34d567e8fa901bc2d34e56789f0 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "ENABLED", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "Status" : "ENABLED"}] }]'</pre>  | 
| 监控所有 EKS 集群，但排除其中一些集群（使用排除标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
| 监控选择性 EKS 集群（使用包含标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
|  手动管理安全代理  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 

## 为所有成员账户自动启用 EKS 运行时监控
<a name="auto-enable-eksrunmon-existing-memberaccounts"></a>

本节包含为所有成员账户启用 EKS 运行时监控并管理安全代理的步骤。这包括委派 GuardDuty 管理员账户、现有成员账户和加入组织的新账户。

根据 [在 Amazon EKS 集群中管理 GuardDuty 安全代理的方法](how-runtime-monitoring-works-eks.md#eksrunmon-approach-to-monitor-eks-clusters)，您可以选择首选方法，并按照下表中所述的步骤进行操作。


|  **管理 GuardDuty安全代理的首选方法**  | **步骤** | 
| --- | --- | 
|  通过管理安全代理 GuardDuty （监控所有 EKS 集群）  |  要有选择地为您的成员账户启用 EKS 运行时监控，请使用您自己的*detector ID*账户运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html)API 操作。 将 `EKS_ADDON_MANAGEMENT` 的状态设为 `ENABLED`。 GuardDuty 将管理您账户中所有 Amazon EKS 集群的安全代理的部署和更新。 或者，您可以使用自己的区域探测器 ID 来使用该 AWS CLI 命令。要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` 以下示例同时启用了 `EKS_RUNTIME_MONITORING` 和 `EKS_ADDON_MANAGEMENT`： <pre>aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --account-ids 111122223333 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "ENABLED", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "Status" : "ENABLED"}] }]'</pre>  您也可以传递用空格 IDs 分隔的账户列表。  成功执行代码后，会返回 `UnprocessedAccounts` 的空列表。如果更改账户的检测器设置时出现任何问题，则会列出该账户 ID 和问题摘要。  | 
| 监控所有 EKS 集群，但排除其中一些集群（使用排除标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
| 监控选择性 EKS 集群（使用包含标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
|  手动管理安全代理  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 

## 为所有现有活跃成员账户配置 EKS 运行时监控
<a name="eks-protection-configure-active-members"></a>

本节包括为组织中现有活跃成员账户启用 EKS 运行时监控和管理 GuardDuty安全代理的步骤。

根据 [在 Amazon EKS 集群中管理 GuardDuty 安全代理的方法](how-runtime-monitoring-works-eks.md#eksrunmon-approach-to-monitor-eks-clusters)，您可以选择首选方法，并按照下表中所述的步骤进行操作。


|  **管理 GuardDuty安全代理的首选方法**  |  **步骤**  | 
| --- | --- | 
|  通过管理安全代理 GuardDuty （监控所有 EKS 集群）  |  要有选择地为您的成员账户启用 EKS 运行时监控，请使用您自己的*detector ID*账户运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html)API 操作。 将 `EKS_ADDON_MANAGEMENT` 的状态设为 `ENABLED`。 GuardDuty 将管理您账户中所有 Amazon EKS 集群的安全代理的部署和更新。 或者，您可以使用自己的区域探测器 ID 来使用该 AWS CLI 命令。要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` 以下示例同时启用了 `EKS_RUNTIME_MONITORING` 和 `EKS_ADDON_MANAGEMENT`： <pre>aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --account-ids 111122223333 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "ENABLED", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "Status" : "ENABLED"}] }]'</pre>  您也可以传递用空格 IDs 分隔的账户列表。  成功执行代码后，会返回 `UnprocessedAccounts` 的空列表。如果更改账户的检测器设置时出现任何问题，则会列出该账户 ID 和问题摘要。  | 
| 监控所有 EKS 集群，但排除其中一些集群（使用排除标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
| 监控选择性 EKS 集群（使用包含标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
|  手动管理安全代理  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 

## 为新成员自动启用 EKS 运行时监控
<a name="eks-protection-configure-auto-enable-new-members"></a>

委派的 GuardDuty 管理员帐户可以自动启用 EKS 运行时监控，并选择一种方法来管理加入组织的新账户 GuardDuty 的安全代理。

根据 [在 Amazon EKS 集群中管理 GuardDuty 安全代理的方法](how-runtime-monitoring-works-eks.md#eksrunmon-approach-to-monitor-eks-clusters)，您可以选择首选方法，并按照下表中所述的步骤进行操作。


|  **管理 GuardDuty安全代理的首选方法**  |  **步骤**  | 
| --- | --- | 
|  通过管理安全代理 GuardDuty （监控所有 EKS 集群）  |  要有选择地为您的新账户启用 EKS 运行时监控，请使用您自己的*detector ID*账户调用 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateOrganizationConfiguration.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateOrganizationConfiguration.html)API 操作。 将 `EKS_ADDON_MANAGEMENT` 的状态设为 `ENABLED`。 GuardDuty 将管理您账户中所有 Amazon EKS 集群的安全代理的部署和更新。 或者，您可以使用自己的区域探测器 ID 来使用该 AWS CLI 命令。要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` 以下示例为单个账户同时启用了 `EKS_RUNTIME_MONITORING` 和 `EKS_ADDON_MANAGEMENT`。您也可以传递用空格 IDs 分隔的账户列表。 要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` <pre>aws guardduty update-organization-configuration --detector-id 12abc34d567e8fa901bc2d34e56789f0 --autoEnable  --features '[{"Name" : "EKS_RUNTIME_MONITORING", "AutoEnable": "NEW", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "AutoEnable": "NEW"}] }]'</pre> 成功执行代码后，会返回 `UnprocessedAccounts` 的空列表。如果更改账户的检测器设置时出现任何问题，则会列出该账户 ID 和问题摘要。  | 
| 监控所有 EKS 集群，但排除其中一些集群（使用排除标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
| 监控选择性 EKS 集群（使用包含标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
|  手动管理安全代理  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 

## 为单个活跃成员账户启用 EKS 运行时监控
<a name="eks-protection-configure-selectively-member-accounts"></a>

本节包含为单个活动成员账户配置 EKS 运行时监控并管理安全代理的步骤。

根据 [在 Amazon EKS 集群中管理 GuardDuty 安全代理的方法](how-runtime-monitoring-works-eks.md#eksrunmon-approach-to-monitor-eks-clusters)，您可以选择首选方法，并按照下表中所述的步骤进行操作。


|  **管理 GuardDuty安全代理的首选方法**  |  **步骤**  | 
| --- | --- | 
|  通过管理安全代理 GuardDuty （监控所有 EKS 集群）  |  要有选择地为您的成员账户启用 EKS 运行时监控，请使用您自己的*detector ID*账户运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html)API 操作。 将 `EKS_ADDON_MANAGEMENT` 的状态设为 `ENABLED`。 GuardDuty 将管理您账户中所有 Amazon EKS 集群的安全代理的部署和更新。 或者，您可以使用自己的区域探测器 ID 来使用该 AWS CLI 命令。要查找您的账户和当前区域的，请查看[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)控制台中的 **“设置**” 页面，或者运行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html)API。`detectorId` 以下示例同时启用了 `EKS_RUNTIME_MONITORING` 和 `EKS_ADDON_MANAGEMENT`： <pre>aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --account-ids 111122223333 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "ENABLED", "AdditionalConfiguration" : [{"Name" : "EKS_ADDON_MANAGEMENT", "Status" : "ENABLED"}] }]'</pre>  您也可以传递用空格 IDs 分隔的账户列表。  成功执行代码后，会返回 `UnprocessedAccounts` 的空列表。如果更改账户的检测器设置时出现任何问题，则会列出该账户 ID 和问题摘要。  | 
| 监控所有 EKS 集群，但排除其中一些集群（使用排除标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
| 监控选择性 EKS 集群（使用包含标签） |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 
|  手动管理安全代理  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-configuration-multiple-accounts.html)  | 