

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 在多帳戶環境中啟用 EKS 保護
<a name="eks-protection-enable-multiple-accounts"></a>

在多帳戶環境中，只有委派的 GuardDuty 管理員帳戶可以選擇啟用或停用其組織中成員帳戶的 EKS 保護功能。GuardDuty 成員帳戶無法從其帳戶修改此組態。委派的 GuardDuty 管理員帳戶會使用 管理其成員帳戶 AWS Organizations。此委派的 GuardDuty 管理員帳戶可以選擇在加入組織時為所有新帳戶自動啟用 EKS 保護。如需有關多帳戶環境的詳細資訊，請參閱[在 Amazon GuardDuty 中管理多個帳戶](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_accounts.html)。

## 為委派的 GuardDuty 管理員帳戶設定 EKS 稽核日誌監控
<a name="configure-eks-audit-log-monitoring-delegatedadmin"></a>

選擇您偏好的存取方法，為委派的 GuardDuty 管理員帳戶設定 EKS 稽核日誌監控。

------
#### [ Console ]

1. 開啟 GuardDuty 主控台，網址為 [https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。

1. 在導覽窗格中，選擇 EKS 保護。

1. 在**組態**索引標籤下，您可以在相應區段檢視 EKS 稽核日誌監控的目前組態狀態。若要更新委派 GuardDuty 管理員帳戶的組態，請在 **EKS 稽核日誌監控**窗格中選擇**編輯**。

1. 執行以下任意一項：

**使用**為所有帳戶啟用****
   + 選擇**為所有帳戶啟用**。這將為 AWS 組織中所有作用中的 GuardDuty 帳戶啟用保護計畫，包括加入組織的新帳戶。
   + 選擇**儲存**。

**使用**手動設定帳戶****
   + 若要僅為委派的 GuardDuty 管理員帳戶啟用保護計畫，請選擇**手動設定帳戶**。
   + 在**委派的 GuardDuty 管理員帳戶 （此帳戶）** 區段下選擇**啟用**。
   + 選擇**儲存**。

------
#### [ API/CLI ]

使用您自己的區域偵測器 ID，並透過將 `name` 設定為 `EKS_AUDIT_LOGS` 及將 `status` 設定為 `ENABLED` 或 `DISABLED` 來傳遞 `features` 物件，從而執行 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html) API 操作。

若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 [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。

您可以執行下列 AWS CLI 命令來啟用或停用 EKS 稽核日誌監控。請務必使用委派的 GuardDuty 管理員帳戶的有效*偵測器 ID*。

**注意**  
下列範例程式碼會啟用 EKS 稽核日誌監控。請務必將 *12abc34d567e8fa901bc2d34e56789f0* 取代為委派 `detector-id` GuardDuty 管理員帳戶的 ，並將 *555555555555* 取代為 AWS 帳戶 委派 GuardDuty 管理員帳戶的 。

若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 https：//[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。

```
aws guardduty update-detector --detector-id 12abc34d567e8fa901bc2d34e56789f0 --features '[{"Name": "EKS_AUDIT_LOGS", "Status": "ENABLED"}]'
```

若要停用 EKS 稽核日誌監控，請使用 `DISABLED` 取代 `ENABLED`。

------

## 為所有成員帳戶自動啟用 EKS 稽核日誌監控
<a name="k8s-autoenable"></a>

選擇您偏好的存取方式，以便為組織中現有的成員帳戶啟用 EKS 稽核日誌監控。

------
#### [ Console ]

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)：// 開啟 GuardDuty 主控台。

   請務必使用委派的 GuardDuty 管理員帳戶登入資料。

1. 執行以下任意一項：

**使用 **EKS 保護** 頁面**

   1. 在導覽窗格中，選擇 **EKS 保護**。

   1. 在**組態**索引標籤下，您可以檢視組織中作用中成員帳戶的 EKS 稽核日誌監控目前狀態。

      若要更新 EKS 稽核日誌監控組態，請選擇**編輯**。

   1. 選擇**為所有帳戶啟用**。此動作會自動為組織中的現有帳戶和新帳戶啟用 EKS 稽核日誌監控。

   1. 選擇**儲存**。
**注意**  
最多可能需要 24 小時才會更新成員帳戶的組態。

**使用**帳戶**頁面**

   1. 在導覽窗格中，選擇**帳戶**。

   1. 在**帳戶**頁面上，選擇**自動啟用**偏好設定，然後再**透過邀請新增帳戶**。

   1. 在**管理自動啟用偏好設定**視窗中，選擇 **EKS 稽核日誌監控**下的**為所有帳戶啟用**。

   1. 選擇**儲存**。

   如果您無法使用**為所有帳戶啟用**的選項，而且想要為組織中的特定帳戶自訂 EKS 稽核日誌監控組態，請參閱[選擇性地為成員帳戶啟用或停用 EKS 稽核日誌監控](#k8s-enable-disable-selective-members-org)。

------
#### [ API/CLI ]
+ 若要為您的成員帳戶選擇性地啟用或停用 EKS 稽核日誌監控，請使用您自己的*偵測器 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 稽核日誌監控。若要停用，請使用 `DISABLED` 取代 `ENABLED`。

  若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 [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。

  ```
  aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --account-ids 111122223333 --features '[{"name": "EKS_AUDIT_LOGS", "status": "ENABLED"}]'
  ```
**注意**  
您也可以傳遞以空格分隔的帳戶 ID 清單。
+ 當程式碼成功執行時，會返回一個空白 `UnprocessedAccounts` 清單。如果變更帳戶的偵測器設定時發生任何問題，則會列出該帳戶 ID 以及問題摘要。

------

## 為所有現有作用中成員帳戶啟用 EKS 稽核日誌監控
<a name="enable-for-all-existing-members-eks-audit-log"></a>

選擇您偏好的存取方式，以便為組織中所有現有作用中成員帳戶啟用 EKS 稽核日誌監控。

------
#### [ Console ]

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)：// 開啟 GuardDuty 主控台。

   使用委派的 GuardDuty 管理員帳戶登入資料登入。

1. 在導覽窗格中，選擇 **EKS 保護**。

1. 在 **EKS 保護**頁面上，您可以檢視 **GuardDuty 起始的惡意軟體掃描**組態的目前狀態。在**作用中成員帳戶**區段下，選擇**動作**。

1. 從**動作**下拉式選單中，選擇**為所有作用中的成員帳戶啟用**。

1. 選擇**儲存**。

------
#### [ API/CLI ]
+ 若要為您的成員帳戶選擇性地啟用或停用 EKS 稽核日誌監控，請使用您自己的*偵測器 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 稽核日誌監控。若要停用，請使用 `DISABLED` 取代 `ENABLED`。

  若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 [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。

  ```
  aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --account-ids 111122223333 --features '[{"name": "EKS_AUDIT_LOGS", "status": "ENABLED"}]'
  ```
**注意**  
您也可以傳遞以空格分隔的帳戶 ID 清單。
+ 當程式碼成功執行時，會返回一個空白 `UnprocessedAccounts` 清單。如果變更帳戶的偵測器設定時發生任何問題，則會列出該帳戶 ID 以及問題摘要。

------

## 為新成員帳戶自動啟用 EKS 稽核日誌監控
<a name="k8s-auto-enable-new-member-org"></a>

新增的成員帳戶必須先**啟用** GuardDuty，然後才能選取設定 GuardDuty 起始的惡意軟體掃描。透過邀請管理的成員帳戶可以為其帳戶手動設定 GuardDuty 起始的惡意軟體掃描。如需詳細資訊，請參閱[Step 3 - Accept an invitation](guardduty_become_console.md#guardduty_accept_invite_proc)。

選擇您偏好的存取方式，以便為加入組織的新帳戶啟用 EKS 稽核日誌監控。

------
#### [ Console ]

委派的 GuardDuty 管理員帳戶可以使用 EKS 稽核日誌監控或**帳戶**頁面，為組織中的新成員帳戶啟用 **EKS 稽核日誌監控**。

**為新成員帳戶自動啟用 EKS 稽核日誌監控**

1. 開啟 GuardDuty 主控台，網址為 [https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。

   請務必使用委派的 GuardDuty 管理員帳戶登入資料。

1. 執行以下任意一項：
   + 使用 **EKS 保護**頁面：

     1. 在導覽窗格中，選擇 **EKS 保護**。

     1. 在 **EKS 保護**頁面上，選擇 **EKS 稽核日誌監控**中的**編輯**。

     1. 選擇**手動設定帳戶**。

     1. 選取**為新成員帳戶自動啟用**。此步驟可確保每當有新帳戶加入您的組織時，EKS 稽核日誌監控都會自動為其帳戶啟用。只有組織委派的 GuardDuty 管理員帳戶可以修改此組態。

     1. 選擇**儲存**。
   + 使用**帳戶**頁面：

     1. 在導覽窗格中，選擇**帳戶**。

     1. 在**帳戶**頁面上，選擇**自動啟用**偏好設定。

     1. 在**管理自動啟用偏好設定**視窗中，選擇 **EKS 稽核日誌監控**下的**為新帳戶啟用**。

     1. 選擇**儲存**。

------
#### [ API/CLI ]
+ 若要為新帳戶選擇性地啟用或停用 EKS 稽核日誌監控，請使用您自己的*偵測器 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 稽核日誌監控。您也可以傳遞以空格分隔的帳戶 ID 清單。

  若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 [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。

  ```
  aws guardduty update-organization-configuration --detector-id 12abc34d567e8fa901bc2d34e56789f0 --auto-enable --features '[{"Name": "EKS_AUDIT_LOGS", "AutoEnable": "NEW"}]'
  ```

------

## 選擇性地為成員帳戶啟用或停用 EKS 稽核日誌監控
<a name="k8s-enable-disable-selective-members-org"></a>

選擇您偏好的存取方式，以便為組織中的指定成員帳戶啟用或停用 EKS 稽核日誌監控。

------
#### [ Console ]

1. 開啟 GuardDuty 主控台，網址為 [https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。

   請務必使用委派的 GuardDuty 管理員帳戶登入資料。

1. 在導覽窗格中，選擇**帳戶**。

   在**帳戶**頁面上，檢閱 **EKS 稽核日誌監控**欄位，了解您的成員帳戶狀態。

1. 

**啟用或停用 EKS 稽核日誌監控**

   選取您想要設定進行 EKS 稽核日誌監控的帳戶。您可以一次選取多個帳戶。在**編輯保護計畫**下拉式選單中，選擇 **EKS 稽核日誌監控**，然後選擇適當的選項。

------
#### [ API/CLI ]

若要為您的成員帳戶選擇性地啟用或停用 EKS 稽核日誌監控，請使用您自己的*偵測器 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 稽核日誌監控。若要停用，請使用 `DISABLED` 取代 `ENABLED`。您也可以傳遞以空格分隔的帳戶 ID 清單。

若要尋找`detectorId`您帳戶和目前區域的 ，請參閱 [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。

```
aws guardduty update-member-detectors --detector-id 12abc34d567e8fa901bc2d34e56789f0 --accountids 111122223333 --features '[{"Name": "EKS_AUDIT_LOGS", "Status": "ENABLED"}]'
```

------