

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon EKS クラスターのランタイムカバレッジとトラブルシューティング
<a name="eks-runtime-monitoring-coverage"></a>

Runtime Monitoring を有効にして EKS の GuardDuty セキュリティエージェント (アドオン) をインストールした後、EKS クラスターのカバレッジの評価を開始できます。

**Topics**
+ [カバレッジ統計の確認](#reviewing-coverage-statistics-eks-runtime-monitoring)
+ [カバレッジステータス変更時の EventBridge 通知](#eks-runtime-monitoring-coverage-status-change)
+ [Amazon EKS ランタイムカバレッジの問題のトラブルシューティング](#eks-runtime-monitoring-coverage-issues-troubleshoot)

## カバレッジ統計の確認
<a name="reviewing-coverage-statistics-eks-runtime-monitoring"></a>

自分のアカウントまたはメンバーアカウントに関連付けられた EKS クラスターのカバレッジ統計は、選択した AWS リージョンのすべての EKS クラスターに対する正常な EKS クラスターの割合です。次の式はこれを次のように表します。

(正常なクラスター/すべてのクラスター)\$1100

いずれかのアクセス方法を選択して、アカウントのカバレッジ統計を確認してください。

------
#### [ Console ]
+ にサインイン AWS マネジメントコンソール し、[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/) で GuardDuty コンソールを開きます。
+ ナビゲーションペインで、**[Runtime Monitoring]** を選択します。
+ **[EKS クラスターのランタイムカバレッジ]** タブを選択します。
+ **[EKS クラスターのランタイムカバレッジ]** タブでは、**[クラスターリスト]** テーブルにあるカバレッジステータス別に集計されたカバレッジ統計を表示できます。
  + **[クラスターリスト]** テーブルは次の列でフィルタリングできます。
    + **クラスター名**
    + **アカウント ID**
    + **[エージェント管理タイプ]**
    + **[カバレッジステータス]**
    + **[アドオンバージョン]**
+ EKS クラスターのいずれかの **[カバレッジステータス]** が **[異常]** の場合、**[問題]** 列には、**[異常]** ステータスである理由に関する追加情報が含まれている場合があります。

------
#### [ API/CLI ]
+ 独自の有効なディテクター ID、リージョン、およびサービスエンドポイントを使用して [ListCoverage](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListCoverage.html) API を実行します。この API を使用して、クラスターリストをフィルタリングしたり、ソートしたりできます。
  + 以下の `CriterionKey` のオプションのいずれかを使用して例 `filter-criteria` を変更できます。
    + `ACCOUNT_ID`
    + `CLUSTER_NAME`
    + `RESOURCE_TYPE`
    + `COVERAGE_STATUS`
    + `ADDON_VERSION`
    + `MANAGEMENT_TYPE`
  + 以下のオプションで `sort-criteria` の例 `AttributeName` を変更できます。
    + `ACCOUNT_ID`
    + `CLUSTER_NAME`
    + `COVERAGE_STATUS`
    + `ISSUE`
    + `ADDON_VERSION`
    + `UPDATED_AT`
  + *max-results* (最大 50) を変更できます。
  + アカウントと現在のリージョンの `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 --region us-east-1 list-coverage --detector-id 12abc34d567e8fa901bc2d34e56789f0 --sort-criteria '{"AttributeName": "EKS_CLUSTER_NAME", "OrderBy": "DESC"}' --filter-criteria '{"FilterCriterion":[{"CriterionKey":"ACCOUNT_ID", "FilterCondition":{"EqualsValue":"111122223333"}}] }'  --max-results 5
  ```
+ [GetCoverageStatistics](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetCoverageStatistics.html) API を実行すると、`statisticsType` に基づいてカバレッジ集計された統計情報を取得できます。
  + 例 `statisticsType` を次のオプションのいずれかに変更できます。
    + `COUNT_BY_COVERAGE_STATUS` - カバレッジステータス別に集計された EKS クラスターのカバレッジ統計を表します。
    + `COUNT_BY_RESOURCE_TYPE` – リスト内の AWS リソースのタイプに基づいて集計されたカバレッジ統計。
    + コマンドで例 `filter-criteria` を変更できます。`CriterionKey` に対して次のオプションを設定できます。
      + `ACCOUNT_ID`
      + `CLUSTER_NAME`
      + `RESOURCE_TYPE`
      + `COVERAGE_STATUS`
      + `ADDON_VERSION`
      + `MANAGEMENT_TYPE`
  + アカウントと現在のリージョンの `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 --region us-east-1 get-coverage-statistics --detector-id 12abc34d567e8fa901bc2d34e56789f0 --statistics-type COUNT_BY_COVERAGE_STATUS --filter-criteria '{"FilterCriterion":[{"CriterionKey":"ACCOUNT_ID", "FilterCondition":{"EqualsValue":"123456789012"}}] }'
  ```

------

EKS クラスターのカバレッジステータスが **[異常]** である場合は、「[Amazon EKS ランタイムカバレッジの問題のトラブルシューティング](#eks-runtime-monitoring-coverage-issues-troubleshoot)」を参照してください。

## カバレッジステータス変更時の EventBridge 通知
<a name="eks-runtime-monitoring-coverage-status-change"></a>

アカウントの EKS クラスターのカバレッジステータスが **[異常]** と表示されることがあります。カバレッジステータスが **[異常]** になったことを検出するためにカバレッジステータスを定期的にモニタリングし、ステータスが **[異常]** の場合はトラブルシューティングすることをお勧めします。または、Amazon EventBridge ルールを作成して、カバレッジステータスが `Unhealthy` から `Healthy` に変更された場合やそれ以外の変更があった場合に通知を受け取ることもできます。デフォルトでは、GuardDuty はこれをアカウントの [EventBridge バス](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html)に公開します。

### 通知スキーマの例
<a name="coverage-status-eventbridge-schema"></a>

EventBridge のルールでは、あらかじめ定義されたサンプルイベントとイベントパターンを使用して、カバレッジステータスの通知を受け取ることができます。EventBridge ルールの作成の詳細については、「*Amazon EventBridge ユーザーガイド*」の「[ルールの作成](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-get-started.html#eb-gs-create-rule)」を参照してください。

さらに、次の通知スキーマの例を使用して、カスタムイベントパターンを作成します。アカウントの値を必ず置き換えてください。Amazon EKS クラスターのカバレッジステータスが `Healthy` から `Unhealthy` に変更されたときに通知を受け取るには、`detail-type` が *GuardDuty Runtime Protection Unhealthy* である必要があります。カバレッジステータスが `Unhealthy` から `Healthy` に変更されたときに通知を受け取るには、`detail-type` の値を *GuardDuty Runtime Protection Healthy* に置き換えます。

```
{
  "version": "0",
  "id": "event ID",
  "detail-type": "GuardDuty Runtime Protection Unhealthy",
  "source": "aws.guardduty",
  "account": "AWS アカウント ID",
  "time": "event timestamp (string)",
  "region": "AWS リージョン",
  "resources": [
       ],
  "detail": {
    "schemaVersion": "1.0",
    "resourceAccountId": "string",
    "currentStatus": "string",
    "previousStatus": "string",
    "resourceDetails": {
        "resourceType": "EKS",
        "eksClusterDetails": { 
            "clusterName": "string",
            "availableNodes": "string",
             "desiredNodes": "string",
             "addonVersion": "string"
         }
    },
    "issue": "string",
    "lastUpdatedAt": "timestamp"
  }
}
```

## Amazon EKS ランタイムカバレッジの問題のトラブルシューティング
<a name="eks-runtime-monitoring-coverage-issues-troubleshoot"></a>

EKS クラスターのカバレッジステータスが `Unhealthy` の場合、GuardDuty コンソールの **[問題]** 列または [CoverageResource](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_CoverageResource.html) データ型を使用して、対応するエラーを確認できます。

包含タグまたは除外タグを使用して EKS クラスターを選択的にモニタリングする場合、タグの同期に時間がかかることがあります。これにより、関連する EKS クラスターのカバレッジステータスに影響が及ぶ可能性があります。対応するタグ (包含または除外) を削除してから、もう一度追加してみることができます。詳細については、「**Amazon EKS ユーザーガイド**」の「[Amazon EKS リソースのタグ付け](https://docs.aws.amazon.com/eks/latest/userguide/eks-using-tags.html)」を参照してください。

カバレッジ問題の構造は `Issue type:Extra information` です。通常、問題にはオプションの*追加情報*があり、特定のクライアント側の例外や問題に関する説明が含まれる場合があります。*追加情報*に基づき、EKS クラスターのカバレッジの問題をトラブルシューティングするための推奨ステップを以下の表に示します。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/guardduty/latest/ug/eks-runtime-monitoring-coverage.html)


**アドオン問題コードのあるアドオンの作成/更新エラーのトラブルシューティング手順**  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/guardduty/latest/ug/eks-runtime-monitoring-coverage.html)