A repeatable playbook for when the next zero-day hits
You're in the middle of routine maintenance when Slack lights up: a critical remote code execution vulnerability just went public, and your stack is affected. The next two hours determine whether you patch cleanly or spend the weekend in war rooms.
I've responded to enough emergency CVEs to know the teams that move fast share one thing: a pre-defined runbook they can execute without second-guessing. This is that runbook. Five steps that work whether you're patching OpenSSL, a kernel module, or a PHP interpreter—tested on cPanel servers, bare VPS installs, and containerized apps alike.
Step 1: Triage and scope the blast radius
First, confirm you're actually vulnerable. Not every CVE affects every configuration.
Check the vendor advisory for affected versions, required conditions, and attack vectors. A vulnerability in Apache's mod_proxy doesn't matter if you only run Nginx. A kernel exploit that requires local access is less urgent than a remote auth bypass.
Inventory your exposure fast:
# Check installed package version
rpm -qa | grep openssl
dpkg -l | grep openssl
# For services, verify what's actually running
systemctl status httpd
ps aux | grep mysqld
On cPanel servers, the installed packages often lag behind upstream by design—WHM's package manager buffers updates. Check /var/cpanel/rpms/ for what version is staged.
Document which servers and services need patching. I use a simple spreadsheet: hostname, service, current version, vulnerable (yes/no), criticality (prod/staging/dev). This list drives everything that follows.
Prioritize by exposure and impact. An internet-facing web server with a remote exploit gets patched before an internal database with a privilege escalation bug. Prod before staging. Revenue-generating before internal tooling.
Step 2: Identify the patch and test it somewhere safe
Never apply an untested patch to production, even under pressure.
Find the official fix. Most distributions backport security patches to stable branches, so you don't always need to jump major versions. Check your distro's security mailing list or errata:
- RHEL/CentOS/AlmaLinux:
https://access.redhat.com/security/ - Debian:
https://security-tracker.debian.org/ - Ubuntu:
https://ubuntu.com/security/notices
For cPanel environments, monitor the WHM update system and the cPanel blog—they'll push patches through EasyApache or the RPM repository.
Spin up a non-production clone if possible. If your architecture is too complex to clone quickly, designate a staging server that mirrors production as closely as you can. Apply the patch there first:
# Example: patching OpenSSL on RHEL-based system
yum clean all
yum update openssl openssl-libs --assumeyes
# Restart affected services
systemctl restart httpd
systemctl restart postfix
Run your smoke tests. Does the web server still serve pages? Do SSL handshakes complete? Can clients authenticate? If you have automated test suites, run them. If not, manually verify the critical paths: login, checkout, API calls, whatever your users depend on.
Watch logs during and after the restart:
tail -f /var/log/httpd/error_log
journalctl -u httpd -f
Regressions show up here first. I've seen patches that broke PHP modules, TLS cipher compatibility, and custom firewall rules. Better to find out on staging.
What if you don't have a staging environment?
You patch during a maintenance window and keep a rollback plan ready.
Snapshot your VM or create a backup before touching anything. On cloud providers, snapshots are instant. On bare metal, at minimum back up your config files:
tar -czf /root/pre-patch-backup-$(date +%F).tar.gz \
/etc/httpd/ /etc/my.cnf /etc/php.ini /var/cpanel/
Document your rollback steps before you start. Which commands reverse the patch? How do you restore the old package? Write it down so you're not Googling syntax under pressure.
Step 3: Schedule and communicate the deployment window
Even critical patches need a deployment plan.
If the vulnerability requires immediate action—active exploitation in the wild, public exploits available, no workarounds—patch now and communicate afterward. That's rare. Most critical CVEs give you a few hours to plan.
Pick a window that balances speed and impact. Early morning or late evening in your users' timezone minimizes disruption. If you're patching something that requires a reboot (kernel, glibc), expect 5-15 minutes of downtime depending on startup complexity.
Notify stakeholders before you start. A short message works:
"We're applying an emergency security patch to address CVE-YYYY-XXXXX at 02:00 UTC. Web services will restart; expect 2-3 minutes of intermittent errors. No data loss expected."
Post it to your status page, Slack, email—wherever your users look first. In support tickets I handled, the complaints came from unexpected downtime, not from planned maintenance people knew about.
Step 4: Apply the patch and verify service restoration
Execute the same steps you tested in staging, but watch everything.
Before patching, take a final snapshot or backup if you didn't already. Then apply:
# Example for Debian/Ubuntu
apt-get update
apt-get install --only-upgrade openssl libssl1.1
systemctl restart apache2 mysql
For cPanel, use the WHM interface or the command line:
/scripts/upcp --force
/scripts/check_cpanel_rpms --fix
After the patch installs and services restart, confirm the new version is active:
openssl version
php -v
httpd -v
Then verify functionality. Hit your most critical endpoints manually or via curl:
curl -I https://yourdomain.com
curl -u user:pass https://yourdomain.com/api/health
Check your monitoring dashboards. Response times, error rates, and resource usage should return to baseline within minutes. If you see elevated errors or timeouts, investigate immediately—don't assume it's transient.
Review logs for anomalies:
grep -i error /var/log/httpd/error_log | tail -50
journalctl -u mysql --since "5 minutes ago"
I've seen patches introduce subtle breakage that only shows under load or with specific request patterns. If something looks wrong, roll back and re-test.
Step 5: Document what happened and update your runbook
Capture the details while they're fresh.
Record what you patched, when, and any issues encountered. A simple internal wiki page or incident log entry works:
- CVE identifier and description
- Affected systems and services
- Patch version applied
- Deployment window and actual downtime
- Rollback actions taken (if any)
- Post-deployment observations
This log is your future reference when auditors ask or the next CVE hits the same component.
Update your runbook with lessons learned. Did the staging test miss something? Was the rollback plan incomplete? Did communication lag? Fix those gaps now, not during the next emergency.
Schedule a follow-up check 24-48 hours later to confirm stability. Some issues only surface under multi-day load or in nightly batch jobs.
Frequently Asked Questions
How do I know if a CVE is critical enough to patch immediately?
Check the CVSS score and exploitability. Scores of 9.0+ with public exploits and network-based attack vectors demand immediate action. Anything requiring local access or complex pre-conditions can usually wait for a maintenance window.
What if the patch breaks production and I need to roll back?
Restore your pre-patch snapshot or downgrade the package. On RPM systems: yum downgrade package-name. On Debian: apt-get install package-name=old-version. Restart services and verify. Then investigate why the patch failed in staging versus production.
Should I wait for my hosting provider to patch managed services?
If you're on shared hosting or managed WordPress, yes—the provider handles security updates. On VPS or dedicated servers, you're responsible. Check your service agreement. When in doubt, open a ticket and ask.
Can I automate this process?
Partially. Tools like yum-cron, unattended-upgrades, or Ansible can automate patch installation and service restarts. I still recommend manual verification for critical CVEs—automation can't catch every edge case.
Build your runbook before the next CVE drops
The five steps—triage, test, schedule, deploy, document—work because they separate the decision-making from the execution. When a vulnerability goes public and the pressure is on, you don't want to be figuring out your rollback plan on the fly.
Set up your staging environment now. Write down your rollback commands. Automate your backups. The next critical CVE isn't a question of if, but when.
