Your company is in a period of high volume business critical activity and cannot afford the risk of taking down either of the HANA hosts for maintenance however you have just been advised of a critical kernel vulnerability.
RHEL versions 7.7 and 8.1 introduced live kernel patching functionality via kpatch for all subscriptions, which allows for select critical and important security kernel patches to be applied without a reboot.
In this lab exercise, you will identify vulnerable systems and automatically apply live kernel patches on your lab instances.
Your Ansible Tower instance url and credentials were supplied to you on the page created for this workshop.
For your lab environment, there are 2 smart inventories are pre-created:
First, run Lab 4 - Check Vulnerabilities job template to identify any vulnerable systems.
Select TEMPLATES
Click the rocketship icon for the
Lab 4 - Check Vulnerabilities
When prompted, click NEXT in OTHER PROMPTS dialog.
In SURVEY tab, select cve_2019_11135
Note: For more information on this vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2019-11135
Select NEXT and preview the inputs.
Select LAUNCH
Sit back, watch the magic happen
One of the first things you will notice is the summary section. This gives you details about your job such as who launched it, what playbook it’s running, what the status is, i.e. pending, running, or complete.
Next you will be able to see details on the play and each task in the playbook.
When the job has successfully completed, you should see which systems are vulnerable (yes/no).
After running the job template, results will be now reflected in the inventory RHEL 8 - Vulnerable.
Navigate to INVENTORIES
Click Lab 4 - RHEL 8 - Vulnerable.
Review SMART HOST FILTER field, it’s only listing RHEL 8.1 vulnerable systems.
Click the HOSTS tab and review the system(s) listed.
Now that you verified the vulnerable systems, you can run the Lab 4 - Live Kernel Patch job template to update those systems without distrbuting the services running.
Select TEMPLATES
Click the rocketship icon for the
Lab 4 - Live Kernel Patch
When prompted, click NEXT in OTHER PROMPTS dialog.
In SURVEY tab, select cve_2019_11135
Note: For more information on this vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2019-11135
Select NEXT and preview the inputs.
Click LAUNCH.
When the job has successfully completed, you should see the systems that are patched in the details view:
After running the Lab 4 - Live Kernel Patch job template, all systems should patched and vulnerabilities should be gone.
Select TEMPLATES and re-run Lab 4 - Check Vulnerabilities
After answering the survey question and running, validate that systems are not vulnerable anymore.
Navigate to INVENTORIES > Lab 4 - RHEL 8 - Vulnerable and verify that no hosts are listed in the dynamic inventory.
Wouldn’t it be nice if you could put this all together in a nice Workflow (potentially with an approval step) so that you wouldn’t need to run through individual job templates manually.
In this exercise you will create a workflow template for checking, fixing and validating vulnerable systems.
Navigate to TEMPLATES.
Click the icon and select Workflow Template
Complete the form using the following values (leaving other fields blank):
Key | Value | Note |
---|---|---|
Name | Lab 4 - Validate and Patch Vulnerabilities | |
Description | Template for fixing vulnerabilities | |
Organization | Default |
Select SAVE
You will see and empty canvas where you can start including job templates.
Select START
In ADD A NODE dialog box on the right side of the window, select Lab 4 - Check Vulnerabilities
Click PROMPT
When prompted, in SURVEY tab, select cve_2019_11135
Select NEXT and preview the inputs.
Select CONFIRM
Click SELECT
Hover over the newly added Lab 4 -Check Vulnerabilities box and click
In ADD A NODE dialog box on the right side of the window, select Lab 4 - Live Kernel Patch
Click SELECT
Repeat steps 6-10 and add Lab 4 - Check Vulnerabilities again as the 3rd node.
Select SAVE
Back on the main Workflow Template page, select SAVE
again.
Now you can test the Workflow template that you just created.
Select TEMPLATES
Click the rocketship icon for the
Lab 4 - Validate and Patch Vulnerabilities
Alternatively, you can click LAUNCH on the Workflow Template view.
After you launch the workflow template, you will see the top-level view:
You can click “Details” on individual nodes to see the detailed view of jobs as the nodes gets run
Review the details of each node, are the results as expected? Any vulnerability found?
Hint: Vulnerabilities were previously fixed on all nodes.
In this challenge exercise, you will add an approval node in the workflow and re-run.
Hint: You can add an approval node to the canvas by selecting ‘Approval Node’ from the drop down as opposed to ‘Template’.