patch_baselines
Creates, updates, deletes, gets or lists a patch_baselines resource.
Overview
| Name | patch_baselines |
| Type | Resource |
| Id | aws.ssm.patch_baselines |
Fields
The following fields are returned by SELECT queries:
- get_patch_baseline
- describe_patch_baselines
| Name | Datatype | Description |
|---|---|---|
approval_rules | object | A set of rules defining the approval rules for a patch baseline. |
approved_patches | array | A list of explicitly approved patches for the baseline. |
approved_patches_compliance_level | string | Returns the specified compliance severity level for approved patches in the patch baseline. (CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED) |
approved_patches_enable_non_security | boolean | Indicates whether the list of approved patches includes non-security updates that should be applied to the managed nodes. The default value is false. Applies to Linux managed nodes only. |
available_security_updates_compliance_status | string | Indicates the compliance status of managed nodes for which security-related patches are available but were not approved. This preference is specified when the CreatePatchBaseline or UpdatePatchBaseline commands are run. Applies to Windows Server managed nodes only. (COMPLIANT, NON_COMPLIANT) |
baseline_id | string | The ID of the retrieved patch baseline. (pattern: <code>^[a-zA-Z0-9_-:/]{20,128}$</code>) |
created_date | string (date-time) | The date the patch baseline was created. |
description | string | A description of the patch baseline. |
global_filters | object | A set of patch filters, typically used for approval rules. |
modified_date | string (date-time) | The date the patch baseline was last modified. |
name | string | The name of the patch baseline. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>) |
operating_system | string | Returns the operating system specified for the patch baseline. (WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS, ORACLE_LINUX, DEBIAN, MACOS, RASPBIAN, ROCKY_LINUX, ALMA_LINUX, AMAZON_LINUX_2023) |
patch_groups | array | Patch groups included in the patch baseline. |
rejected_patches | array | A list of explicitly rejected patches for the baseline. |
rejected_patches_action | string | The action specified to take on patches included in the RejectedPatches list. A patch can be allowed only if it is a dependency of another package, or blocked entirely along with packages that include it as a dependency. (ALLOW_AS_DEPENDENCY, BLOCK) |
sources | array | Information about the patches to use to update the managed nodes, including target operating systems and source repositories. Applies to Linux managed nodes only. |
| Name | Datatype | Description |
|---|---|---|
baseline_description | string | The description of the patch baseline. |
baseline_id | string | The ID of the patch baseline. (pattern: <code>^[a-zA-Z0-9_-:/]{20,128}$</code>) |
baseline_name | string | The name of the patch baseline. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>) |
default_baseline | boolean | Indicates whether this is the default baseline. Amazon Web Services Systems Manager supports creating multiple default patch baselines. For example, you can create a default patch baseline for each operating system. |
operating_system | string | Defines the operating system the patch baseline applies to. The default value is WINDOWS. (WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, AMAZON_LINUX_2022, UBUNTU, REDHAT_ENTERPRISE_LINUX, SUSE, CENTOS, ORACLE_LINUX, DEBIAN, MACOS, RASPBIAN, ROCKY_LINUX, ALMA_LINUX, AMAZON_LINUX_2023) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_patch_baseline | select | region | Retrieves information about a patch baseline. | |
describe_patch_baselines | select | region | Lists the patch baselines in your Amazon Web Services account. | |
create_patch_baseline | insert | region | Creates a patch baseline. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter. | |
update_patch_baseline | update | region, BaselineId | Modifies an existing patch baseline. Fields not specified in the request are left unchanged. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter. | |
delete_patch_baseline | delete | region | Deletes a patch baseline. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_patch_baseline
- describe_patch_baselines
Retrieves information about a patch baseline.
SELECT
approval_rules,
approved_patches,
approved_patches_compliance_level,
approved_patches_enable_non_security,
available_security_updates_compliance_status,
baseline_id,
created_date,
description,
global_filters,
modified_date,
name,
operating_system,
patch_groups,
rejected_patches,
rejected_patches_action,
sources
FROM aws.ssm.patch_baselines
WHERE region = '{{ region }}' -- required
;
Lists the patch baselines in your Amazon Web Services account.
SELECT
baseline_description,
baseline_id,
baseline_name,
default_baseline,
operating_system
FROM aws.ssm.patch_baselines
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_patch_baseline
- Manifest
Creates a patch baseline. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.
INSERT INTO aws.ssm.patch_baselines (
OperatingSystem,
Name,
GlobalFilters,
ApprovalRules,
ApprovedPatches,
ApprovedPatchesComplianceLevel,
ApprovedPatchesEnableNonSecurity,
RejectedPatches,
RejectedPatchesAction,
Description,
Sources,
AvailableSecurityUpdatesComplianceStatus,
ClientToken,
Tags,
region
)
SELECT
'{{ OperatingSystem }}',
'{{ Name }}',
'{{ GlobalFilters }}',
'{{ ApprovalRules }}',
'{{ ApprovedPatches }}',
'{{ ApprovedPatchesComplianceLevel }}',
{{ ApprovedPatchesEnableNonSecurity }},
'{{ RejectedPatches }}',
'{{ RejectedPatchesAction }}',
'{{ Description }}',
'{{ Sources }}',
'{{ AvailableSecurityUpdatesComplianceStatus }}',
'{{ ClientToken }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
baseline_id
;
# Description fields are for documentation purposes
- name: patch_baselines
props:
- name: region
value: "{{ region }}"
description: Required parameter for the patch_baselines resource.
- name: OperatingSystem
value: "{{ OperatingSystem }}"
description: |
Defines the operating system the patch baseline applies to. The default value is WINDOWS.
valid_values: ['WINDOWS', 'AMAZON_LINUX', 'AMAZON_LINUX_2', 'AMAZON_LINUX_2022', 'UBUNTU', 'REDHAT_ENTERPRISE_LINUX', 'SUSE', 'CENTOS', 'ORACLE_LINUX', 'DEBIAN', 'MACOS', 'RASPBIAN', 'ROCKY_LINUX', 'ALMA_LINUX', 'AMAZON_LINUX_2023']
- name: Name
value: "{{ Name }}"
description: |
The name of the patch baseline.
- name: GlobalFilters
description: |
A set of global filters used to include patches in the baseline. The GlobalFilters parameter can be configured only by using the CLI or an Amazon Web Services SDK. It can't be configured from the Patch Manager console, and its value isn't displayed in the console.
value:
PatchFilters:
- Key: "{{ Key }}"
Values: "{{ Values }}"
- name: ApprovalRules
description: |
A set of rules used to include patches in the baseline.
value:
PatchRules:
- PatchFilterGroup:
PatchFilters:
- Key: "{{ Key }}"
Values: "{{ Values }}"
ComplianceLevel: "{{ ComplianceLevel }}"
ApproveAfterDays: {{ ApproveAfterDays }}
ApproveUntilDate: "{{ ApproveUntilDate }}"
EnableNonSecurity: {{ EnableNonSecurity }}
- name: ApprovedPatches
value:
- "{{ ApprovedPatches }}"
description: |
A list of explicitly approved patches for the baseline. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists in the Amazon Web Services Systems Manager User Guide.
- name: ApprovedPatchesComplianceLevel
value: "{{ ApprovedPatchesComplianceLevel }}"
description: |
Defines the compliance level for approved patches. When an approved patch is reported as missing, this value describes the severity of the compliance violation. The default value is UNSPECIFIED.
valid_values: ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'INFORMATIONAL', 'UNSPECIFIED']
- name: ApprovedPatchesEnableNonSecurity
value: {{ ApprovedPatchesEnableNonSecurity }}
description: |
Indicates whether the list of approved patches includes non-security updates that should be applied to the managed nodes. The default value is false. Applies to Linux managed nodes only.
- name: RejectedPatches
value:
- "{{ RejectedPatches }}"
description: |
A list of explicitly rejected patches for the baseline. For information about accepted formats for lists of approved patches and rejected patches, see Package name formats for approved and rejected patch lists in the Amazon Web Services Systems Manager User Guide.
- name: RejectedPatchesAction
value: "{{ RejectedPatchesAction }}"
description: |
The action for Patch Manager to take on patches included in the RejectedPackages list. ALLOW_AS_DEPENDENCY Linux and macOS: A package in the rejected patches list is installed only if it is a dependency of another package. It is considered compliant with the patch baseline, and its status is reported as INSTALLED_OTHER. This is the default action if no option is specified. Windows Server: Windows Server doesn't support the concept of package dependencies. If a package in the rejected patches list and already installed on the node, its status is reported as INSTALLED_OTHER. Any package not already installed on the node is skipped. This is the default action if no option is specified. BLOCK All OSs: Packages in the rejected patches list, and packages that include them as dependencies, aren't installed by Patch Manager under any circumstances. State value assignment for patch compliance: If a package was installed before it was added to the rejected patches list, or is installed outside of Patch Manager afterward, it's considered noncompliant with the patch baseline and its status is reported as INSTALLED_REJECTED. If an update attempts to install a dependency package that is now rejected by the baseline, when previous versions of the package were not rejected, the package being updated is reported as MISSING for SCAN operations and as FAILED for INSTALL operations.
valid_values: ['ALLOW_AS_DEPENDENCY', 'BLOCK']
- name: Description
value: "{{ Description }}"
description: |
A description of the patch baseline.
- name: Sources
description: |
Information about the patches to use to update the managed nodes, including target operating systems and source repositories. Applies to Linux managed nodes only.
value:
- Name: "{{ Name }}"
Products: "{{ Products }}"
Configuration: "{{ Configuration }}"
- name: AvailableSecurityUpdatesComplianceStatus
value: "{{ AvailableSecurityUpdatesComplianceStatus }}"
description: |
Indicates the status you want to assign to security patches that are available but not approved because they don't meet the installation criteria specified in the patch baseline. Example scenario: Security patches that you might want installed can be skipped if you have specified a long period to wait after a patch is released before installation. If an update to the patch is released during your specified waiting period, the waiting period for installing the patch starts over. If the waiting period is too long, multiple versions of the patch could be released but never installed. Supported for Windows Server managed nodes only.
valid_values: ['COMPLIANT', 'NON_COMPLIANT']
- name: ClientToken
value: "{{ ClientToken }}"
description: |
User-provided idempotency token.
- name: Tags
description: |
Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a patch baseline to identify the severity level of patches it specifies and the operating system family it applies to. In this case, you could specify the following key-value pairs: Key=PatchSeverity,Value=Critical Key=OS,Value=Windows To add tags to an existing patch baseline, use the AddTagsToResource operation.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_patch_baseline
Modifies an existing patch baseline. Fields not specified in the request are left unchanged. For information about valid key-value pairs in PatchFilters for each supported operating system type, see PatchFilter.
UPDATE aws.ssm.patch_baselines
SET
BaselineId = '{{ BaselineId }}',
Name = '{{ Name }}',
GlobalFilters = '{{ GlobalFilters }}',
ApprovalRules = '{{ ApprovalRules }}',
ApprovedPatches = '{{ ApprovedPatches }}',
ApprovedPatchesComplianceLevel = '{{ ApprovedPatchesComplianceLevel }}',
ApprovedPatchesEnableNonSecurity = {{ ApprovedPatchesEnableNonSecurity }},
RejectedPatches = '{{ RejectedPatches }}',
RejectedPatchesAction = '{{ RejectedPatchesAction }}',
Description = '{{ Description }}',
Sources = '{{ Sources }}',
AvailableSecurityUpdatesComplianceStatus = '{{ AvailableSecurityUpdatesComplianceStatus }}',
Replace = {{ Replace }}
WHERE
region = '{{ region }}' --required
AND BaselineId = '{{ BaselineId }}' --required
RETURNING
approval_rules,
approved_patches,
approved_patches_compliance_level,
approved_patches_enable_non_security,
available_security_updates_compliance_status,
baseline_id,
created_date,
description,
global_filters,
modified_date,
name,
operating_system,
rejected_patches,
rejected_patches_action,
sources;
DELETE examples
- delete_patch_baseline
Deletes a patch baseline.
DELETE FROM aws.ssm.patch_baselines
WHERE region = '{{ region }}' --required
;