Manually creating patch requests
Overview of manual patching
Use the ServiceNow Flow Designer to create flows that integrate with the Tanium Patch module to manually deploy patches to endpoints through ad-hoc patch requests. The flow orchestrates all the deployment actions based on the trigger that you specify, such as an item request in the ServiceNow Service Catalog. You typically create manual patch requests to deploy patches to endpoints that are not included in automatic flows. For example, some endpoints might perform a critical function in your network at a time that coincides with an automated flow for Patch Tuesday patching. In this case, you can exclude those endpoints from the automated flow and patch them through a manual request at a time that has less impact on your network.
The following figure shows an example flow for a manual patch request. This example is useful for understanding the triggers and actions that are common to many manual patch flows.
The sections in this topic describe the components of the preceding example flow. After you create or edit the flow, be sure to Save, test, and activate the flow. Then you can Create a Tanium Patch Request in the Service Catalog to trigger the flow.
Tanium Patch Management for IT Operations provides several of the components in the example flow as predefined actions that you can reuse for your own custom flows, as described in Predefined actions for patch management. The processes and policies of your organization determine the specific triggers and actions that you configure for patch flows.
Predefined actions for patch management
Tanium provides the following actions that you can use to create patch management flows.
|
Action |
Description |
|---|---|
|
Create Tanium Patch Request |
Creates an empty record in the Tanium Patch Request table To populate the record with endpoints and patches, use other actions, such as Add endpoints to Patch Request from Change and Add Patches by Filter to Patch Request. For an example of how to use this action in a flow, see Create a Tanium Patch Request. |
|
Add endpoints to Patch Request from Change |
Adds endpoints that you specify in a change request to a patch request In a flow for deploying patches, creating a change request is a prerequisite for creating the patch request. On a change request record, the Affected CIs tab shows the targeted endpoints. For an example of how to use this action in a flow, see Add endpoints from a change request to a patch request. |
|
Add Endpoints by Filter to Patch Request |
Adds all endpoints that match the specified filters to a Tanium patch request Configure the filters to include only endpoints with the same operating system (OS) as the OS that the patch request specifies. The following example shows a filter that includes only Windows endpoints that are virtual machines (VMs). |
|
Add endpoints missing selected patches |
Adds endpoints to a patch request if its patches meet the following conditions:
For example, you can use the action to add Windows endpoints that do not have a specific Windows patch installed. The Tanium Patch Status table records the patch installation status for endpoints. For an example of how to use this action in a flow, see Add endpoints missing selected patches. |
|
Add Patches by CVE to Patch Request |
Adds patches that are associated with specific common vulnerabilities and exposures (CVE) to a patch request This action is useful for addressing specific security flaws on endpoints. For an example of how to use this action in a flow, see Add patches by CVE to a patch request. |
|
Add Patches by Filter to Patch Request |
Adds all patches that match the specified filters to a Tanium patch request The Tanium Patch Definition table has a record for each available patch. For an example of how to use this action in a flow, see Add patches by filter to a patch request. |
|
Add Patch Lists by Filter to Patch Request |
Adds all patch lists that match the specified filters to a Tanium patch request The Tanium Patch List table has a record for each available patch list. For an example of how to use this action in a flow, see Add patch lists by filter to a patch request. |
|
Check if Patch Request is ready |
Checks whether all the required fields in a patch request are populated, in which case the request is ready to proceed with deployment Use this action to verify that a deployment can succeed or to generate useful error messages if the request is not ready. Error messages can help you troubleshoot the deployment. For an example of how to use this action in a flow, see Check if the patch request is ready. |
|
Get Confidence Scores for a Tanium Patch Request |
Outputs a formatted string that contains the confidence score status for patches associated with a Tanium Patch Request Use this action for informational purposes, such as adding the confidence score information to a Change Request for review. You can also open the action in Action Designer and complete a Test run. Then, copy the output string to a Patch Request or Change Request description. |
|
Trigger Patch Request Deployment |
Runs a patch request, which creates a deployment in the Tanium Patch module For an example of how to use this action in a flow, see Trigger patch request deployment.
Important: Always run the action Check if Patch Request is ready before running Trigger Patch Request Deployment.
|
View, edit, or create flows
Perform the following steps to view, edit, or create a flow. Each new or existing flow opens in a separate tab in the ServiceNow Flow Designer. Switching between tabs can help you create a new flow by basing it on the components of an existing flow.
-
Sign in to your ServiceNow instance.
-
In the Main menu, click All, enter flow designer in the filter
field, and click Flow Designer.
-
Click Flows to view all the existing flows. To view all the components of a specific flow, click its Name to open the flow in a new tab. If you edit any component, click Done in the corresponding section. After you finish making all your edits, click Save in the flow toolbar.
-
Create a flow by selecting . For the remaining steps, see Building flows.
Configure the trigger
Configure a trigger that starts the flow actions, such as a request for a Service Catalog item. In this example, the requested item is a Tanium Patch Request. You can run the flow in the background if you want to set a priority for the flow in relation to other flows.
Set flow variables
Set the variables that provide input for other actions in the flow. In this example, you add the following variables for the action Create a change request:
-
Requestor: Select the user role that is responsible for creating change requests. In this example, the role is System Administrator because patching can have a significant impact on your network and therefore warrants a highly privileged role.
-
Assignment Group: Select the team that is responsible for reviewing and approving change requests that initiate patch requests. In the example flow, the team is Patch request approval group.
Get catalog variables
The Patch Requested Endpoints flow resolves the following variables when a Service Catalog request triggers the flow. You set the variable values when you Create a Tanium Patch Request in the Service Catalog.
-
patch_from_date: ServiceNow searches for patches to deploy as far back as the specified date.
-
os: The OS of the endpoints to patch.
-
scheduled_start: This is the date to start deploying the patch.
Look up computer records
This action searches the Computer table for endpoints that match the conditions that you specify:
-
Owned by, Supported by, and Support group.Manager are set to the user who created a Tanium Patch Request in the Service Catalog.
-
Operating System is set to the value of the os variable that the action Get catalog variables retrieved.
Specify the Max Results if you want to limit the number of endpoint records that the action returns. For example, your organization might limit the number of endpoints that you can patch in a single deployment to reduce the impact to your network. You can click New Criteria to configure more conditions that filter the search. For example, add the Is Virtual condition to patch only virtual machines (VMs).
The next action depends on whether the search finds endpoints that match the condition:
-
Endpoints found: The flow skips to the action Create a change request.
-
No endpoints found: The flow runs the action Close the Service Catalog request if no endpoints are found.
Close the Service Catalog request if no endpoints are found
This action changes the State of the Tanium Patch Request to Closed Skipped if the action Look up computer records did not find endpoints that matched the specified conditions. The flow then ends.
Create a change request
A change request is required to initiate patch deployment. Therefore, this action creates a record (State equals New) in the Change Request table and populates the record fields with the values that you specify. This example uses the following values:
-
Short description helps other users understand the purpose of the change request.
-
Requested by and Assignment group are set to the variables that you specified in Set flow variables.
-
Planned start/end date are set to the variables that you configured in Get catalog variables.
Created CIs affected record for each item in computer records
This action creates a record in the CIs Affected table for each endpoint that the Look up computer records action found.
Create a patch request and add patches and endpoints
Creating a patch request from a change request involves multiple actions for adding the patches and endpoints to the patch request. The sequence of actions might be useful in other flows, such as for manual patch requests. Therefore, instead of reconfiguring each action for each flow that uses the same action sequence, you can create a reusable subflow that contains the entire sequence. This example uses the Create Patch Request & Add Patches/Endpoints subflow with the following settings:
|
Setting |
Description |
|---|---|
|
wait_for_completion |
Select this setting to specify that the parent flow Patch Requested Endpoints does not continue until all the actions in the subflow finish. |
|
Patch Request [Name | Description] |
Enter a name to identify the patch request and a description to help other users understand its purpose. In this example, both settings have the value Patch Endpoints requested by <requestor> , where <requestor> is the name of the user who opens the Service Catalog request to initiate the flow. |
|
Operating System Type |
Specify the OS of the endpoints you plan to patch. |
|
Change Request |
Select the change request that you configured in Create a change request. |
|
Add Endpoints from Change |
Select this setting run the action Add endpoints from a change request to a patch request. |
|
CVE IDs |
Enter common CVE identifiers to run the action Add patches by CVE to a patch request. |
|
Include Superseded in CVE Patches |
Select this setting to include patches for all CVEs even if the patches have been replaced by more recent patches. |
|
Additional Patches Filter |
Add additional filters for selecting endpoints to include in the patch request to run the action Add patches by filter to a patch request. |
|
Patch Lists Filter |
Add additional filters for selecting patch lists to include in the patch request to run the action Add patch lists by filter to a patch request. |
The preceding subflow runs the following actions in the following sequence:
Create a Tanium Patch Request
This action creates an empty record in the Tanium Patch Request table. The subsequent actions in the Create Patch Request & Add Patches/Endpoints subflow all have a Tanium Patch Request setting that specifies this patch request and they populate the record with endpoints and patches.
The settings in this request are similar to the Patching subflow settings and includes the following additional options:
|
Setting |
Description |
|---|---|
|
Restart After Install |
Select whether to restart the endpoint after a successful patch deployment. |
|
Restart Client Notification [Tanium End User Notification] |
If you enabled restarts, you can optionally add an end-user notification to warn the user about the restart. Select the deployment template that includes the notification message to display to the user. This setting is available only if you enabled and imported Tanium Patch deployment templates. For more information, see Import patch deployment templates.
Note: Do not update the ServiceNow Tanium End User Notification records that were created during the import process. Any edits to those records are overwritten during the next import. To add more notification message options, create more deployment templates in Tanium and then run the import again.
|
Add endpoints from a change request to a patch request
If you selected the Add Endpoints from Change option in the Create Patch Request & Add Patches/Endpoints subflow, then the action Add Endpoints to Patch Request from Change copies the endpoints from a change request to the patch request. The Change Request identifies the request created in Create a change request.
Add patches by CVE to a patch request
If you specified CVE IDs in the Create Patch Request & Add Patches/Endpoints subflow, then the action Add Patches by CVE to Patch Request adds patches that are associated with specific CVEs to the patch request. The Include Superseded setting indicates whether you selected the Include Superseded in CVE Patches option in the subflow.
Add patches by filter to a patch request
If you configured an Additional Patches Filter in the Create Patch Request & Add Patches/Endpoints subflow, then the action Add Patches by Filter to Patch Request adds a list of patches to the patch request based on the filter.
Add patch lists by filter to a patch request
If you configured a Patch Lists Filter in the Create Patch Request & Add Patches/Endpoints subflow, then the action Add Patch Lists by Filter to Patch Request adds a list of patch lists to the patch request based on the filter.
Assign flow outputs
Assign Flow Outputs assigns the outputs of the Create Patch Request & Add Patches/Endpoints subflow to the Tanium patch request, thereby populating the empty record in the Tanium Patch Request table.
Update the change request state to assess
This action updates the change request State to Assess, which initiates the process that your organization uses for assessing and approving change requests. In this example, the Patch request approval group that you selected in Set flow variables assesses the change request and sets its state to scheduled (approved) or cancelled (rejected).
Wait for change request to be scheduled or cancelled
The action pauses the flow until the users who assess change requests (the Patch request approval group in this example) set the change request State to:
-
Scheduled: The flow skips to the action Check if the patch request is ready.
-
Cancelled: The flow runs the action Update the patch request state to cancelled.
Update the patch request state to cancelled
If the users who assess the change request decide to cancel the request, this action updates the State of the associated patch request to Cancelled and then ends the flow. The error handler flow then starts if you configured it, as described in Add actions for errors.
Check if the patch request is ready
This action checks whether all the required fields in the patch request are populated. The next action in the flow depends on whether the request is ready:
-
Ready: The flow skips to Trigger patch request deployment.
-
Not ready: The flow runs the action Update the change request if the patch request is not ready.
Update the change request if the patch request is not ready
This action updates the change request to note that the patch request is not ready for deployment if the action Check if the patch request is ready returns that result. The flow ends. The error handler flow then starts if you configured it, as described in see Add actions for errors.
Trigger patch request deployment
This action runs the patch request, which creates a deployment in the Tanium Patch module. To review the deployment details, see Reviewing deployments.
The next action in the flow depends on whether the deployment encountered issues:
-
Deployment created successfully: The flow skips to the action Wait for the change request to close or be cancelled.
-
Deployment issues occurred: If the patch request failed to run or the deployment ID from the Patch module is missing, the flow runs the action described in Update the change request if deployment issues occurred.
Update the change request if deployment issues occurred
If the patch request failed to run or the deployment ID from the Patch module is missing, this action adds a note that provides details about the issue to the change request and then ends the flow. The error handler flow then starts if you configured it, as described in Add actions for errors.
Wait for the change request to close or be cancelled
The action pauses the flow until the change request State updates to:
-
Closed: The patch deployment finished.
-
Cancelled: The patch deployment encountered issues and timed out before it could finish. The End Time in the Service Catalog request determines when the deployment times out, as described in Manually creating a patch request.
After the request updates to either state, the flow runs the next action: Update the Service Catalog request.
Update the Service Catalog request
This action updates the State of the requested item (the Tanium Patch Request, in this example) with the state of the change request (closed or cancelled).
Add actions for errors
Optionally enable the Error Handler and add subflows, actions, and flow logic if you want to run a sequence of actions to identify and correct issues that occur during the patch flow. For example, you might want to log an error message and notify certain users by email. For more information, see Flow error handler.
Save, test, and activate the flow
Perform the following tasks after you configure all the triggers and actions for your patch flow:
-
Click Save to save the flow configuration.
-
Click Test to simulate a trigger and run the flow. Edit the flow if the test execution details show unexpected results. For more information, see Test a flow and Flow execution details. To troubleshoot patch request errors, see Troubleshooting patch requests in ServiceNow.
-
Click Activate when the flow is ready to use.
After you activate the flow, it is triggered whenever users Create a Tanium Patch Request in the Service Catalog.
Create a Tanium Patch Request in the Service Catalog
Trigger the example flow Patch Requested Endpoints by creating a Tanium patch request in the ServiceNow Service Catalog.