

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

# 检查运行时间覆盖率统计数据并对问题进行故障排除
<a name="runtime-monitoring-assessing-coverage"></a>

在您启用 Runtime Monitoring 并且 GuardDuty 安全代理部署到您的资源后，会 GuardDuty提供相应资源类型的覆盖率统计信息以及属于您账户的资源的单个覆盖状态。确定覆盖状态的方法是确保您已启用运行时监控、已创建 Amazon VPC 终端节点以及已部署相应资源 GuardDuty 的安全代理。**正常**覆盖状态表示当有与您的资源相关的运行时事件时， GuardDuty 能够通过 Amazon VPC 终端节点接收上述运行时事件并监控行为。如果在配置运行时监控、创建 Amazon VPC 终端节点或部署 GuardDuty安全代理时出现问题，则覆盖状态将显示为 “**不健康**”。当覆盖状态为不健康时， GuardDuty 将无法接收或监视相应资源的运行时行为，也无法生成任何运行时监控结果。

以下主题将帮助您查看覆盖率统计信息、配置 EventBridge 通知以及解决特定资源类型的覆盖率问题。

**Topics**
+ [Amazon EC2 实例的运行时覆盖率和故障排除](gdu-assess-coverage-ec2.md)
+ [Amazon ECS 集群的运行时覆盖率和故障排除](gdu-assess-coverage-ecs.md)
+ [Amazon EKS 集群的运行时覆盖率和故障排除](eks-runtime-monitoring-coverage.md)

# Amazon EC2 实例的运行时覆盖率和故障排除
<a name="gdu-assess-coverage-ec2"></a>

对于 Amazon EC2 资源，运行时间覆盖率是在实例级别评估的。Amazon EC2 实例可能会在您的 AWS 环境中运行多种类型的应用程序和工作负载等等。此功能还支持由 Amazon ECS 托管的 Amazon EC2 实例，并且如果您在 Amazon EC2 实例上运行 Amazon ECS 集群，则实例级别的覆盖率问题将在 Amazon EC2 运行时覆盖率下显示。

**Topics**
+ [查看覆盖率统计数据](#review-coverage-statistics-ec2-runtime-monitoring)
+ [保险状态会随着 EventBridge 通知而发生变化](#ec2-runtime-monitoring-coverage-status-change)
+ [对 Amazon EC2 运行时覆盖率问题进行故障排除](#ec2-runtime-monitoring-coverage-issues-troubleshoot)

## 查看覆盖率统计数据
<a name="review-coverage-statistics-ec2-runtime-monitoring"></a>

对于与您自己的账户或成员账户有关的 Amazon EC2 实例，覆盖率统计数据是选定 AWS 区域中正常 EC2 实例占所有 EC2 实例的百分比。下式将其表示为：

*（ instances/All 运行正常的实例）\$1100*

如果您还为 Amazon ECS 集群部署了 GuardDuty 安全代理，则与在 Amazon EC2 实例上运行的 Amazon ECS 集群相关的任何实例级别覆盖问题都将显示为 Amazon EC2 实例运行时覆盖率问题。

选择一种访问方法来查看您账户的覆盖率统计数据。

------
#### [ Console ]
+ 登录 AWS 管理控制台 并打开 GuardDuty 控制台，网址为[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。
+ 在导航窗格中，选择**运行时监控**。
+ 选择**运行时覆盖率**选项卡。
+ 您可以在 **EC2 实例运行时覆盖率**选项卡下查看覆盖率统计数据，按**实例列表**中可用的每个 Amazon EC2 实例的覆盖率状态汇总。
  + 您可以按以下列筛选**实例列表**：
    + **账户 ID**
    + **代理管理类型**
    + **代理版本**
    + **覆盖状态**
    + **实例 ID**
    + **集群 ARN**
+ 如果任何 EC2 实例的**覆盖率状态**为**不正常**，则**问题**列可能包含有关**不正常**状态原因的其他信息。

------
#### [ API/CLI ]
+ 使用您自己的有效检测器 ID、当前区域和服务端点运行 [ListCoverage](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListCoverage.html)API。您可以使用此 API 对实例列表进行筛选和排序。
  + 您可以使用以下 `CriterionKey` 选项之一更改示例 `filter-criteria`：
    + `ACCOUNT_ID`
    + `RESOURCE_TYPE`
    + `COVERAGE_STATUS`
    + `AGENT_VERSION`
    + `MANAGEMENT_TYPE`
    + `INSTANCE_ID`
    + `CLUSTER_ARN`
  + 当 `filter-criteria` 包含 `RESOURCE_TYPE` 为 **EC2** 的条件时，运行时监控将不支持将 **ISSUE** 作为 `AttributeName`。如果您使用该属性，API 响应将导致 `InvalidInputException`。

    您可以使用以下选项更改 `sort-criteria` 中的示例 `AttributeName`：
    + `ACCOUNT_ID`
    + `COVERAGE_STATUS`
    + `INSTANCE_ID`
    + `UPDATED_AT`
  + 您可以更改*max-results*（最多 50 个）。
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  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`
      + `RESOURCE_TYPE`
      + `COVERAGE_STATUS`
      + `AGENT_VERSION`
      + `MANAGEMENT_TYPE`
      + `INSTANCE_ID`
      + `CLUSTER_ARN`
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  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"}}] }'
  ```

------

如果 EC2 实例的覆盖率状态为**不正常**，请参阅[对 Amazon EC2 运行时覆盖率问题进行故障排除](#ec2-runtime-monitoring-coverage-issues-troubleshoot)。

## 保险状态会随着 EventBridge 通知而发生变化
<a name="ec2-runtime-monitoring-coverage-status-change"></a>

Amazon EC2 实例的覆盖率状态可能显示为**不正常**。要检测覆盖率状态何时变为不正常，我们建议您定期监控覆盖率状态，并在状态变为**不正常**时进行故障排除。**或者，您可以创建 Amazon EventBridge 规则，以便在保险状态从 “**不健康” 变为 “健康**” 或其他情况时收到通知。**默认情况下，会在[EventBridge 公交车](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html)上为您的账户 GuardDuty 发布此内容。

### 示例通知架构
<a name="ec2-gdu-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 EC2 实例的覆盖状态从变`Healthy`为时收到通知`Unhealthy`，`detail-type`应为*GuardDuty Runtime Protection Unhealthy*。要在保险状态从变为时收到通知`Healthy`，`Unhealthy`请将的`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": "EC2",
        "ec2InstanceDetails": {
          "instanceId":"",
          "instanceType":"",
          "clusterArn": "",
          "agentDetails": {
            "version":""
          },
          "managementType":""
        }
    },
    "issue": "string",
    "lastUpdatedAt": "timestamp"
  }
}
```

## 对 Amazon EC2 运行时覆盖率问题进行故障排除
<a name="ec2-runtime-monitoring-coverage-issues-troubleshoot"></a>

如果 Amazon EC2 实例的覆盖率状态为**不正常**，则可以在**问题**列下查看原因。

如果 EC2 实例与某个 EKS 集群关联，并且手动或通过自动代理配置安装了 EKS 安全代理，则要对覆盖率问题进行故障排除，请参阅[Amazon EKS 集群的运行时覆盖率和故障排除](eks-runtime-monitoring-coverage.md)。

下表列举了问题类型和相应的故障排除步骤。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/gdu-assess-coverage-ec2.html)

# Amazon ECS 集群的运行时覆盖率和故障排除
<a name="gdu-assess-coverage-ecs"></a>

Amazon ECS 集群的运行时间覆盖范围包括在 Amazon ECS 容器实例上 AWS Fargate 运行的任务[1](#ecs-container-instance)。

对于在 Fargate 上运行的 Amazon ECS 集群，运行时间覆盖率是在任务级别评估的。ECS 集群运行时覆盖率包括在您为 Fargate（仅限 ECS）启用了运行时监控和自动代理配置后开始运行的 Fargate 任务。默认情况下，Fargate 任务是不可变的。 GuardDuty 将无法安装安全代理来监视已在运行的任务上的容器。要包含此类 Fargate 任务，必须停止并重新启动该任务。务必要检查相关服务是否受支持。

有关 Amazon ECS 容器的信息，请参阅[容量创建](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-capacity.html)。

**Topics**
+ [查看覆盖率统计数据](#ecs-review-coverage-statistics-ecs-runtime-monitoring)
+ [保险状态会随着 EventBridge 通知而发生变化](#ecs-runtime-monitoring-coverage-status-change)
+ [对 Amazon ECS-Fargate 运行时覆盖率问题进行故障排除](#ecs-runtime-monitoring-coverage-issues-troubleshoot)

## 查看覆盖率统计数据
<a name="ecs-review-coverage-statistics-ecs-runtime-monitoring"></a>

对于与您自己的账户或成员账户关联的 Amazon ECS 资源，覆盖率统计数据是选定 AWS 区域中正常 Amazon ECS 集群占所有 Amazon ECS 集群的百分比。这包括与 Fargate 和 Amazon EC2 实例关联的 Amazon ECS 集群的覆盖率。下式将其表示为：

*（健康 clusters/All 集群）\$1100*

### 注意事项
<a name="considerations-ecs-coverage-review-stats"></a>
+ ECS 集群的覆盖率统计数据包括与该 ECS 集群关联的 Fargate 任务或 ECS 容器实例的覆盖率状态。Fargate 任务的覆盖率状态包括处于正在运行状态或最近完成运行的任务。
+ 在 **ECS 集群运行时覆盖率**选项卡中，**覆盖的容器实例**字段指示与 Amazon ECS 集群关联的容器实例的覆盖率状态。

  如果 Amazon ECS 集群仅包含 Fargate 任务，则计数将显示为 **0/0**。
+ 如果 Amazon ECS 集群与没有安全代理的 Amazon EC2 实例相关联，则 Amazon ECS 集群的覆盖率状态也将为**不正常**。

  要确定关联的 Amazon EC2 实例的覆盖率问题并进行故障排除，请参阅适用于 Amazon EC2 实例的[对 Amazon EC2 运行时覆盖率问题进行故障排除](gdu-assess-coverage-ec2.md#ec2-runtime-monitoring-coverage-issues-troubleshoot)。

选择一种访问方法来查看您账户的覆盖率统计数据。

------
#### [ Console ]
+ 登录 AWS 管理控制台 并打开 GuardDuty 控制台，网址为[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。
+ 在导航窗格中，选择**运行时监控**。
+ 选择**运行时覆盖率**选项卡。
+ 您可以在 **ECS 集群运行时覆盖率**选项卡下查看覆盖率统计数据，按**集群列表**中可用的每个 Amazon ECS 集群的覆盖率状态汇总。
  + 您可以按以下列筛选**集群列表**：
    + **账户 ID**
    + **集群名称**
    + **代理管理类型**
    + **覆盖状态**
+ 如果任何 Amazon ECS 集群的**覆盖率状态**为**不正常**，则**问题**列可能包含有关**不正常**状态原因的其他信息。

  如果 Amazon ECS 集群与 Amazon EC2 实例关联，请导航到 **EC2 实例运行时覆盖率**选项卡，然后按**集群名称**字段筛选以查看相关的**问题**。

------
#### [ API/CLI ]
+ 使用您自己的有效检测器 ID、当前区域和服务端点运行 [ListCoverage](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListCoverage.html)API。您可以使用此 API 对实例列表进行筛选和排序。
  + 您可以使用以下 `CriterionKey` 选项之一更改示例 `filter-criteria`：
    + `ACCOUNT_ID`
    + `ECS_CLUSTER_NAME`
    + `COVERAGE_STATUS`
    + `MANAGEMENT_TYPE`
  + 您可以使用以下选项更改 `sort-criteria` 中的示例 `AttributeName`：
    + `ACCOUNT_ID`
    + `COVERAGE_STATUS`
    + `ISSUE`
    + `ECS_CLUSTER_NAME`
    + `UPDATED_AT`

      只有在关联的 Amazon ECS 集群中创建了新任务或相应的覆盖率状态发生变化时，该字段才会更新。
  + 您可以更改*max-results*（最多 50 个）。
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  aws guardduty --region us-east-1 list-coverage --detector-id 12abc34d567e8fa901bc2d34e56789f0 --sort-criteria '{"AttributeName": "ECS_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`：表示按覆盖率状态汇总的 ECS 集群的覆盖率统计数据。
    + `COUNT_BY_RESOURCE_TYPE`— 根据列表中的 AWS 资源类型汇总的覆盖率统计信息。
    + 您可以在命令中更改示例 `filter-criteria`。您可以对 `CriterionKey` 使用以下选项：
      + `ACCOUNT_ID`
      + `ECS_CLUSTER_NAME`
      + `COVERAGE_STATUS`
      + `MANAGEMENT_TYPE`
      + `INSTANCE_ID`
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  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"}}] }'
  ```

------

有关覆盖率问题的更多信息，请参阅[对 Amazon ECS-Fargate 运行时覆盖率问题进行故障排除](#ecs-runtime-monitoring-coverage-issues-troubleshoot)。

## 保险状态会随着 EventBridge 通知而发生变化
<a name="ecs-runtime-monitoring-coverage-status-change"></a>

Amazon ECS 集群的覆盖率状态可能显示为**不正常**。要检测覆盖率状态何时变为不正常，我们建议您定期监控覆盖率状态，并在状态变为**不正常**时进行故障排除。**或者，您可以创建 Amazon EventBridge 规则，以便在保险状态从 “**不健康” 变为 “健康**” 或其他情况时收到通知。**默认情况下，会在[EventBridge 公交车](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html)上为您的账户 GuardDuty 发布此内容。

### 示例通知架构
<a name="ecs-gdu-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 ECS 集群的覆盖状态从变`Healthy`为时收到通知`Unhealthy`，`detail-type`应该是*GuardDuty Runtime Protection Unhealthy*。要在保险状态从变为时收到通知`Healthy`，`Unhealthy`请将的`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": "ECS",
        "ecsClusterDetails": {
          "clusterName":"",
          "fargateDetails":{
            "issues":[],
            "managementType":""
          },
          "containerInstanceDetails":{
            "coveredContainerInstances":int,
            "compatibleContainerInstances":int
          }
        }
    },
    "issue": "string",
    "lastUpdatedAt": "timestamp"
  }
}
```

## 对 Amazon ECS-Fargate 运行时覆盖率问题进行故障排除
<a name="ecs-runtime-monitoring-coverage-issues-troubleshoot"></a>

如果 Amazon ECS 集群的覆盖率状态为**不正常**，则可以在**问题**列下查看原因。

下表提供了 Fargate（仅限 Amazon ECS）问题的建议故障排除步骤。有关 Amazon EC2 实例覆盖率问题的信息，请参阅适用于 Amazon EC2 实例的[对 Amazon EC2 运行时覆盖率问题进行故障排除](gdu-assess-coverage-ec2.md#ec2-runtime-monitoring-coverage-issues-troubleshoot)。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/gdu-assess-coverage-ecs.html)

# Amazon EKS 集群的运行时覆盖率和故障排除
<a name="eks-runtime-monitoring-coverage"></a>

启用运行时监控并手动或通过自动代理配置为 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 集群的覆盖率统计数据，指的是正常 EKS 集群占选定 AWS 区域环境中所有 EKS 集群的百分比。下式将其表示为：

*（健康 clusters/All 集群）\$1100*

选择一种访问方法来查看您账户的覆盖率统计数据。

------
#### [ Console ]
+ 登录 AWS 管理控制台 并打开 GuardDuty 控制台，网址为[https://console.aws.amazon.com/guardduty/](https://console.aws.amazon.com/guardduty/)。
+ 在导航窗格中，选择**运行时监控**。
+ 选择 **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 个）。
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  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`
  + 要查找您的账户和当前区域的，请查看[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`

  ```
  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`或其他状态时通知您。默认情况下，会在[EventBridge 公交车](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-bus.html)上为您的账户 GuardDuty 发布此内容。

### 示例通知架构
<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*。要在保险状态从变为时收到通知`Healthy`，`Unhealthy`请将的`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/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-coverage.html)


**使用插件问题代码解决插件 creation/updation 错误的步骤**  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/eks-runtime-monitoring-coverage.html)