

• AWS Systems Manager CloudWatch 控制面板在 2026 年 4 月 30 日之后将不再可用。客户可以像现在一样继续使用 Amazon CloudWatch 控制台来查看、创建和管理其 Amazon CloudWatch 控制面板。有关更多信息，请参阅 [Amazon CloudWatch 控制面板文档](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

# 补丁基准规则在基于 Linux 的系统上的工作原理
<a name="patch-manager-linux-rules"></a>

对于 Linux 分发版，补丁基准中规则的工作方式因分发版类型的不同而有所差异。与 Windows Server 托管式节点上的补丁更新不同，将在每个节点上评估规则，以便考虑实例上配置的存储库。Patch Manager（AWS Systems Manager 中的一项工具）使用本机软件包管理器推动安装补丁基准批准的补丁。

对于报告修补程序严重性级别的基于 Linux 的操作系统类型，Patch Manager 将软件发布者报告的严重性级别用于更新通知或单个修补程序。Patch Manager 不会从第三方来源（例如[常见漏洞评分系统](https://www.first.org/cvss/) (CVSS)），或者[国家漏洞数据库](https://nvd.nist.gov/vuln) (NVD) 发布的指标中获取严重性级别。

**Topics**
+ [补丁基准规则在 Amazon Linux 2 和 Amazon Linux 2023 上的工作原理](#linux-rules-amazon-linux)
+ [补丁基准规则在 CentOS Stream 上的工作原理](#linux-rules-centos)
+ [补丁基准规则在 Debian Server 上的工作原理](#linux-rules-debian)
+ [补丁基准规则在 macOS 上的工作原理](#linux-rules-macos)
+ [补丁基准规则在 Oracle Linux 上的工作原理](#linux-rules-oracle)
+ [补丁基准规则在 AlmaLinux、RHEL 和 Rocky Linux 上的工作原理](#linux-rules-rhel)
+ [补丁基准规则在 SUSE Linux Enterprise Server 上的工作原理](#linux-rules-sles)
+ [补丁基准规则在 Ubuntu Server 上的工作原理](#linux-rules-ubuntu)

## 补丁基准规则在 Amazon Linux 2 和 Amazon Linux 2023 上的工作原理
<a name="linux-rules-amazon-linux"></a>

**注意**  
Amazon Linux 2023（AL2023）使用版本控制的存储库，这些存储库可以通过一个或多个系统设置锁定到特定版本。对于 AL2023 EC2 实例的所有修补操作，Patch Manager 使用最新的存储库版本，与系统配置无关。有关更多信息，请参阅《Amazon Linux 2023 User Guide》**中的 [Deterministic upgrades through versioned repositories](https://docs.aws.amazon.com/linux/al2023/ug/deterministic-upgrades.html)。

在 Amazon Linux 2 和 Amazon Linux 2023 上，补丁选择过程如下：

1. 在托管节点上，YUM 库（Amazon Linux 2）或 DNF 库（Amazon Linux 2023）将访问每个已配置存储库的 `updateinfo.xml` 文件。

   如果未找到 `updateinfo.xml` 文件，是否安装补丁将取决于**包括非安全性更新**和**自动批准**设置。例如，如果允许非安全更新，则会在自动批准时间到达时安装这些更新。

1. `updateinfo.xml` 中的每个更新通知都包含几个属性，它们表示通知中的软件包的属性，如下表所述。  
**更新通知属性**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

1. 托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 Product 键属性的值。

1. 根据以下准则为更新选择程序包。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 CentOS Stream 上的工作原理
<a name="linux-rules-centos"></a>

CentOS Stream 默认存储库不包含 `updateinfo.xml` 文件。不过，您创建或使用的自定义存储库可能包含该文件。在本主题中，对 `updateinfo.xml` 的引用仅适用于这些自定义存储库。

在 CentOS Stream 上，补丁选择过程如下：

1. 在托管式节点上，DNF 库可访问每个已配置存储库的 `updateinfo.xml` 文件（如果该文件存在于自定义存储库中）。

   如果未找到 `updateinfo.xml`（其中始终包含默认存储库），是否安装补丁将取决于**包括非安全性更新**和**自动批准**设置。例如，如果允许非安全更新，则会在自动批准时间到达时安装这些更新。

1. 如果存在 `updateinfo.xml`，该文件中的每个更新通知都包含几个属性，这些属性表示通知中软件包的属性，如下表所述。  
**更新通知属性**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

1. 在所有情况下，托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 Product 键属性的值。

1. 根据以下准则为更新选择程序包。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 Debian Server 上的工作原理
<a name="linux-rules-debian"></a>

在 Debian Server上，补丁基准服务提供对*优先级*和*部分*字段的筛选。这些字段通常存在于所有 Debian Server 软件包中。为确定补丁基准是否选择了某个补丁，Patch Manager 执行以下操作：

1. 在 Debian Server 系统上，运行等效于 `sudo apt-get update` 的程序刷新可用软件包列表。不配置存储库，从 `sources` 列表中配置的存储库提取数据。

1. 如果某个更新可用于 `python3-apt` （一个 `libapt` 的 Python 库接口），则将升级到最新版本。（即使您没有选择**包括非安全更新**选项，该非安全软件包也会更新。）

1. 接下来将应用 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#systemsmanager-CreatePatchBaseline-request-GlobalFilters](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#systemsmanager-CreatePatchBaseline-request-GlobalFilters)、[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovalRules](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovalRules)、[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovedPatches](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovedPatches) 和 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-RejectedPatches](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-RejectedPatches) 列表。
**注意**  
由于无法可靠地确定 Debian Server 更新程序包的发布日期，因此该操作系统不支持自动审批选项。

   但是，批准规则也取决于在创建或上次更新补丁基准时是否选中**包括非安全更新**复选框。

   如果不包含非安全更新，则应用一条隐式规则，以便只选择在安全存储库中有升级的软件包。对于每个软件包，软件包的候选版本（通常为最新版本）必须包含在安全存储库中。在这种情况下，对于 Debian Server，补丁候选版本仅限于以下存储库中包含的补丁：

   这些存储库的命名如下：
   + Debian Server 11：`debian-security bullseye`
   + Debian Server 12：`debian-security bookworm`

   如果包含非安全更新，也会考虑来自其他存储库的补丁。

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

要查看 *Priority* 和 *Section* 字段的内容，运行以下 `aptitude` 命令：

**注意**  
您需要先在 Debian Server 系统上安装 Aptitude。

```
aptitude search -F '%p %P %s %t %V#' '~U'
```

在对此命令的响应中，按以下格式报告所有可升级软件包：

```
name, priority, section, archive, candidate version
```

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 macOS 上的工作原理
<a name="linux-rules-macos"></a>

在 macOS 上，补丁选择过程如下：

1. 在托管式节点上，Patch Manager 访问 `InstallHistory.plist` 文件的已解析内容并标识软件包名称和版本。

   有关解析过程的详细信息，请参阅 [如何安装补丁](patch-manager-installing-patches.md) 中的 **macOS** 选项卡。

1. 托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 Product 键属性的值。

1. 根据以下准则为更新选择程序包。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 Oracle Linux 上的工作原理
<a name="linux-rules-oracle"></a>

在 Oracle Linux 上，补丁选择过程如下：

1. 在托管式节点上，YUM 库可访问每个已配置存储库的 `updateinfo.xml` 文件。
**注意**  
如果存储库不是由 Oracle 管理的，则可能不存在 `updateinfo.xml` 文件。如果未找到 `updateinfo.xml`，是否安装补丁将取决于**包括非安全性更新**和**自动批准**设置。例如，如果允许非安全更新，则会在自动批准时间到达时安装这些更新。

1. `updateinfo.xml` 中的每个更新通知都包含几个属性，它们表示通知中的软件包的属性，如下表所述。  
**更新通知属性**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

1. 托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 Product 键属性的值。

1. 根据以下准则为更新选择程序包。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 AlmaLinux、RHEL 和 Rocky Linux 上的工作原理
<a name="linux-rules-rhel"></a>

在 AlmaLinux、Red Hat Enterprise Linux（RHEL）和 Rocky Linux 上，补丁选择过程如下：

1. 在托管式节点上，YUM 库 (RHEL 7) 或 DNF 库（AlmaLinux 8 和 9、RHEL 8、9 和 10 以及 Rocky Linux 8 和 9）访问每个已配置存储库的 `updateinfo.xml` 文件。
**注意**  
如果存储库不是由 Red Hat 管理的，可能不存在 `updateinfo.xml` 文件。如果找不到 `updateinfo.xml`，则不会应用任何补丁。

1. `updateinfo.xml` 中的每个更新通知都包含几个属性，它们表示通知中的软件包的属性，如下表所述。  
**更新通知属性**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

1. 托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 Product 键属性的值。

1. 根据以下准则为更新选择程序包。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/systems-manager/latest/userguide/patch-manager-linux-rules.html)

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。

## 补丁基准规则在 SUSE Linux Enterprise Server 上的工作原理
<a name="linux-rules-sles"></a>

在 SLES 上，每个补丁包括以下表示补丁中的软件包的属性的属性：
+ **类别**：对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中的 **Classification** 键属性的值。表示更新通知中包含的补丁的类型。

  可以使用 AWS CLI 命令 **[https://docs.aws.amazon.com/cli/latest/reference/ssm/describe-patch-properties.html](https://docs.aws.amazon.com/cli/latest/reference/ssm/describe-patch-properties.html)** 或 API 操作 **[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribePatchProperties.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribePatchProperties.html)** 来查看受支持值的列表。您也可以在 Systems Manager 控制台中**创建补丁基准**页面或**编辑补丁基准**页面中的**审批规则**区中查看列表。
+ **严重性**：对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中的**严重性**键属性的值。表示补丁的严重性。

  可以使用 AWS CLI 命令 **[https://docs.aws.amazon.com/cli/latest/reference/ssm/describe-patch-properties.html](https://docs.aws.amazon.com/cli/latest/reference/ssm/describe-patch-properties.html)** 或 API 操作 **[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribePatchProperties.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_DescribePatchProperties.html)** 来查看受支持值的列表。您也可以在 Systems Manager 控制台中**创建补丁基准**页面或**编辑补丁基准**页面中的**审批规则**区中查看列表。

托管式节点的产品由 SSM Agent 确定。此属性对应于补丁基准的 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html) 数据类型中 **Product** 键属性的值。

对于每个补丁，补丁基准用作筛选器，只允许更新包含符合条件的软件包。如果应用补丁基准定义后有多个软件包适用，则使用最新版本。

有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

## 补丁基准规则在 Ubuntu Server 上的工作原理
<a name="linux-rules-ubuntu"></a>

在 Ubuntu Server上，补丁基准服务提供对*优先级*和*部分*字段的筛选。这些字段通常存在于所有 Ubuntu Server 软件包中。为确定补丁基准是否选择了某个补丁，Patch Manager 执行以下操作：

1. 在 Ubuntu Server 系统上，运行等效于 `sudo apt-get update` 的程序刷新可用软件包列表。不配置存储库，从 `sources` 列表中配置的存储库提取数据。

1. 如果某个更新可用于 `python3-apt` （一个 `libapt` 的 Python 库接口），则将升级到最新版本。（即使您没有选择**包括非安全更新**选项，该非安全软件包也会更新。）

1. 接下来将应用 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#systemsmanager-CreatePatchBaseline-request-GlobalFilters](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#systemsmanager-CreatePatchBaseline-request-GlobalFilters)、[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovalRules](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovalRules)、[https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovedPatches](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-ApprovedPatches) 和 [https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-RejectedPatches](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreatePatchBaseline.html#EC2-CreatePatchBaseline-request-RejectedPatches) 列表。
**注意**  
由于无法可靠地确定 Ubuntu Server 的更新程序包的发布日期，因此此操作系统不支持自动批准选项。

   但是，批准规则也取决于在创建或上次更新补丁基准时是否选中**包括非安全更新**复选框。

   如果不包含非安全更新，则应用一条隐式规则，以便只选择在安全存储库中有升级的软件包。对于每个软件包，软件包的候选版本（通常为最新版本）必须包含在安全存储库中。在这种情况下，对于 Ubuntu Server，补丁候选版本仅限于以下存储库中包含的补丁：
   + Ubuntu Server 16.04 LTS：`xenial-security`
   + Ubuntu Server 18.04 LTS：`bionic-security`
   + Ubuntu Server 20.04 LTS：`focal-security`
   + Ubuntu Server 22.04 LTS：`jammy-security`
   + Ubuntu Server 24.04 LTS (`noble-security`)
   + Ubuntu Server 25.04 (`plucky-security`)

   如果包含非安全更新，也会考虑来自其他存储库的补丁。

   有关已批准的补丁和已拒绝的补丁列表的已接受格式的信息，请参阅 [已批准补丁和已拒绝补丁列表的程序包名称格式](patch-manager-approved-rejected-package-name-formats.md)。

要查看 *Priority* 和 *Section* 字段的内容，运行以下 `aptitude` 命令：

**注意**  
您需要先在 Ubuntu Server 16 系统上安装 Aptitude。

```
aptitude search -F '%p %P %s %t %V#' '~U'
```

在对此命令的响应中，按以下格式报告所有可升级软件包：

```
name, priority, section, archive, candidate version
```

有关补丁合规性状态值的信息，请参阅 [补丁合规性状态值](patch-manager-compliance-states.md)。