A few weeks ago we released the KernelCare "Extra" Patchset with the security fixes and the symlink protection available to all KernelCare customers running CentOS kernels. Today we are pleased to share that you can get the Symlink Protection Patchset for CentOS 6 and 7 at no cost, even if you don’t have licenses of KernelCare.
We’ve been discussing with the cPanel team on how to help with hardening of their customers' system kernels. This Symlink Protection Patchset will protect CentOS 6 and 7 systems and will help defend shared hosting servers, including the cPanel servers, against symlink attacks.
A symlink race attack is frequently used against shared hosting servers. It allows a malicious user to serve files that belong to other users by creating a symbolic link to those files. It is often used to access config.php files that belong to others. This patchset helps protect against such attacks.
Note that this patchset includes only the symlink protection, and does not include the security fixes (those are available to KernelCare customers) - you will still need to update kernel and REBOOT each time new CentOS kernel is released to keep your kernel secure.
We recommend the installation of this patchset on CentOS 6 and CentOS 7 to make your servers more secure.
How to install the free symlink protection patchset:
Below we provide instructions on how to install KernelCare and run this patchset for free. Though this symlink protection patchset is part of KernelCare, it does not require you to purchase a license or even register for the KernelCare free trial (if you choose to purchase a license at a later date, information on how to upgrade will be published in the documentation soon).
To enable the symlink protection, perform the following steps:
First, install KernelCare client:
curl -s https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
Enable free patch type, this patch type doesn't require a license
kcarectl --set-patch-type free --update
The ‘free’ patch will be applied on the next update.
. . .
During the installation, you should see something similar to:
time: 2017-06-22 16:13:40
kpatch-description: symlink protection // If you see this patch, it mean that you can enable symlink protection.
kpatch-description: symlink protection (kpatch adaptation)
Edit the file /etc/sysconfig/kcare/sysctl.conf (or create it if it doesn't exist) - add the lines:
fs.enforce_symlinksifowner = 1
fs.symlinkown_gid = 48
sysctl -w fs.enforce_symlinksifowner=1
sysctl -w fs.symlinkown_gid=48
Note: On standard RPM Apache installation, Apache is usually running under GID 48. On cPanel servers, Apache is running under user nobody, GID 99.