Docs

Security

Every tool in the Security section of the admin menu, from server hardening switches, sign-in protection, SSH and ModSecurity to account isolation, the Security Checkup and two-factor authentication, the firewall, plus the malware scanners under Add-ons.

27 min read Updated From the panel's guide

The Security section of the admin menu brings together the settings that protect the server, the panel's sign-in and the hosted websites. The firewall (CSF) is here too; the Add-ons section holds the malware scanners. Start with the Security Checkup, which lists what could still be made safer and links to each setting.

The installer already applies secure defaults. Compilers are closed to users, home-folder URLs and symbolic link protection are on, process flood protection is on, and password rules are set.

Home-Folder URLs (mod_userdir)#

In the admin area, open Security → Home-Folder URLs (mod_userdir) (open).

With Apache's mod_userdir, an address such as http://any-domain/~username/ shows that user's website under another account's domain, and the visit is counted against that domain. The setting Protect against ~username addresses switches these addresses off for the whole server.

  • Ticked (the default): /~username addresses do not work anywhere.
  • Unticked: they work under every domain on the server, for plain files only; PHP does not run there.

To change it, tick or untick the box and click Save security settings.

Leave the protection on unless you have a clear reason to turn it off. Clients who need a preview before their domain points to the server can use a temporary subdomain or a hosts-file entry instead. The Security Checkup suggests switching the protection back on if it is off.

In the admin area, open Security → Symlink Protection (open).

A hacked or malicious account can put a symbolic link in its website that points at another account's files, for example a configuration file with database passwords, and have the web server show it. With Protect websites against symlinks to other accounts' files ticked:

  • The web server follows a link only when the link and its target belong to the same account.
  • A website's own .htaccess cannot switch this off. Options lines in .htaccess (such as Options +FollowSymLinks) are skipped, and the website keeps working.
  • Everything else .htaccess can do (rewrites, redirects, password protection, headers) still works.

To change it, tick or untick the box and click Save security settings. Changing this setting rewrites every website's configuration in the background, which can take a little while on a server with many accounts.

Good to know: the protection is on by default, and the Security Checkup marks it as "Needs attention" when it is off. Turning it off is not recommended on a server with more than one account.

Outgoing Mail Restrictions#

In the admin area, open Security → Outgoing Mail Restrictions (open).

When this is on, only the mail server and root may connect to mail servers elsewhere (SMTP). Users' scripts and programs then cannot send mail around the server's own mail server, which is a trick spammers often use. The rule is applied in the firewall (CSF's SMTP block).

The page shows whether the restriction is enabled or disabled. Click Enable or Disable to switch.

Good to know:

  • Websites still send mail the normal way, through the server's own mail server, where the hourly sending limits apply.
  • A website that connects straight to an outside mail server stops working while this is on. Some "SMTP" plugins do this. Set the plugin to use the local server, or turn the restriction off.
  • The Security Checkup suggests turning it on if it is off.

Session Log#

In the admin area, open Security → Session Log (open). This page shows who is signed in to the panel now, and keeps a record of every sign-in and sign-out.

Signed in now lists each active session with:

  • its number (intosess followed by ten digits, the same number shown in that user's page addresses),
  • the user, their role and the address and browser they signed in from,
  • when they signed in and when they last made a request.

If an administrator or reseller opened a client's area, the row says who opened it.

Session log shows the record month by month. Choose a Month, optionally enter a User, and click Show. Each row is either "signed in" (with the browser) or "ended" (with the reason and how long the session lasted). Times are in UTC. The newest 1,000 entries of the month are shown.

Good to know: there is one log file per month. Finished months are compressed, and logs older than six months are removed. To end your own other sessions, change your password: this signs out your other browsers.

Compiler Access#

In the admin area, open Security → Compiler Access (open).

Many attacks build their tools on the server after breaking into an account. With Users may run the C and C++ compilers unticked, only root can run gcc, g++, cc, c++, c89 and c99.

To change it, tick or untick the box and click Save security settings.

Good to know:

  • The installer closes compilers to users. The Security Checkup suggests closing them again if they are open.
  • If no compiler is installed, the page says so. The setting still applies as soon as one is installed.
  • Users who need to build software (for example some Ruby or Python packages with C extensions) cannot do so while this is off. You can build for them as root, or allow compilers for a short time.

Sign-in Security Policies#

In the admin area, open Security → Sign-in Security Policies (open). These rules apply whenever someone signs in to the panel: in the admin area, the reseller area and the client area.

  • Two-factor authentication is required for administrators and resellers: they must set up two-step sign-in before they can use the panel.
  • Password expiry: a password must be changed after a number of days (1 to 730; 90 is suggested).

Tick the rules you want and click Save.

Anyone affected is taken to the Password and Sign-in page after signing in, and can do nothing else until they renew their password or set up two-factor authentication. Clients may use two-factor authentication but are never forced to.

Good to know:

  • You cannot require two-factor authentication until you have set it up for your own login. This stops you locking yourself out. Set yours up under your name at the top right, My Admin Password.
  • The shortest password allowed is set under Password Strength Rules. Failed sign-ins are handled by Sign-in Attack Protection.

Sign-in Attack Protection: settings#

In the admin area, open Security → Sign-in Attack Protection (open). This protects the panel's sign-in against password guessing, and through the firewall (LFD) also SSH, FTP and mail. The top card shows whether protection is enabled; Turn off and Turn on switch all of it.

On the Settings tab:

  • Limit per username: failed sign-ins for one username from any address. The defaults are 15 within 5 minutes. When the limit is reached, that username is refused for the period. Lock administrator usernames too is off by default, so attackers cannot lock you out by guessing your name.
  • Limit per address: failed sign-ins from one address. The defaults are 5 within 15 minutes, which locks the address out for 15 minutes. Also block a locked-out address in the firewall blocks it for every service.
  • One-day blocks: after this many failed sign-ins from one address in a day (30 after installation; 0 switches it off), the address is kept out for a day, optionally also in the firewall.
  • Other services (SSH, FTP, mail): failed logins before LFD blocks an address, for SSH, FTP, sending mail (SMTP login), POP3 and IMAP. 0 switches a check off. You also set how long the block lasts, or Block until removed by hand instead.
  • Sign-in history: how long failed sign-ins are kept (360 minutes by default).
  • Notifications: tell you when an administrator signs in from an address that is not on the always-allowed list, and when an address or username is locked out.

Click Save. Addresses on the always-allowed list, or on the firewall's allow list, are never locked out.

Sign-in Attack Protection: allowed, refused and countries#

In the admin area, open Security → Sign-in Attack Protection (open) and use the tabs.

  • Always Allowed: addresses and networks that are never locked out of the panel, however often a sign-in fails. Add your office or home address so that a typing mistake cannot keep you out. Enter an address (such as 203.0.113.10) or a network (such as 203.0.113.0/24), an optional note, and click Add. The page shows your current address.
  • Always Refused: sign-ins to the panel from these addresses are always refused, even with the right password. This only covers the panel. To keep an address away from every service, block it in the firewall instead (Firewall).
  • Countries: Blocked countries and Always allowed countries, as two-letter codes separated by spaces (for example CN RU). This works in the firewall for every service at once: websites, mail, FTP, SSH and the panel. Visitors from a blocked country cannot reach anything on the server. Allowed countries pass the firewall like addresses on the allow list, so use that sparingly.

Good to know:

  • The firewall downloads each country's address ranges and keeps them up to date. A change takes a few minutes to apply.
  • Do not block the country you work from.
  • Country blocking needs CSF. If it is not installed, the tab says so.

Sign-in Attack Protection: lockouts and history#

In the admin area, open Security → Sign-in Attack Protection (open) and choose the Lockouts and History tab.

  • Locked out of the panel: addresses and usernames that are locked out now, and until when (UTC). Click Unlock to let one in again straight away.
  • Blocked in the firewall for now: temporary firewall blocks, with the reason. Click Unblock to remove one.
  • Recent failed sign-ins to the panel: time, address and the username tried, newest first (up to 300). Empty the history clears the list.

To let someone back in after they were locked out:

  1. Ask for their IP address, or find it in the failed sign-ins list.
  2. Click Unlock (panel lock-out) and, if listed, Unblock (firewall block).
  3. If this keeps happening, add their address on the Always Allowed tab.

Failed sign-ins are kept for the time set under Sign-in history on the Settings tab. The list also starts again when the panel is restarted.

Service Access Rules#

In the admin area, open Security → Service Access Rules (open). Each rule accepts or refuses connections to one port of this server from one address or range.

To add a rule:

  1. Enter the Port (1 to 65535).
  2. Enter the IP address or range, such as 203.0.113.5 or 203.0.113.0/24.
  3. Choose the Protocol (TCP or UDP) and the Action: ACCEPT, REJECT or DROP.
  4. Click Add the rule.

The Rules table lists every rule. Delete removes one.

Example: to allow MariaDB (port 3306) only from your office, add an ACCEPT rule for port 3306 from your office's address. The port itself stays closed to everyone else as long as it is not in the firewall's open port lists.

Good to know:

  • ACCEPT rules always win over REJECT and DROP rules.
  • The rules are written into the firewall's allow and deny files as advanced CSF rules. At most 200 rules are kept.
  • To open or close a port for everyone, use the port lists on Firewall instead. Ranges wider than a /8 (such as 0.0.0.0/0) are refused.
  • Refused connections are handled the way the firewall is set up, which by default drops them silently.

External Sign-in Providers#

In the admin area, open Security → External Sign-in Providers (open). This lets people sign in to the panel with an account they have at Google, Microsoft or another OpenID Connect provider.

To set up a provider:

  1. Copy the Redirect address shown at the top of the page. If the panel is reached under several names, each one's address must be registered.
  2. Register the panel with the provider as a web application, using that redirect address. For Google, use the Google Cloud console (APIs & Services → Credentials → OAuth client ID, type Web application). For Microsoft, use Microsoft Entra ID (App registrations) with a Web platform address, and create a client secret.
  3. In the provider's card, enter the Client ID and Client secret. For a generic OpenID Connect provider, also enter the Name on the button and the Issuer address; its settings are read from /.well-known/openid-configuration.
  4. Under Who may use it, tick Administrators, Resellers and/or Hosting accounts.
  5. Tick Switched on and click Save.

Each person then links their own account under Password and Sign-in, and the provider's button appears on the sign-in page. Two-step sign-in codes and sign-in questions are still asked after the provider signs them in.

A saved secret is not shown again. Leave the field empty to keep it, or tick Forget the saved secret. Each card shows how many logins are linked.

Root SSH Keys#

In the admin area, open Security → Root SSH Keys (open). This lists the SSH keys that can sign in as root, with each key's name, type and fingerprint.

To add a key:

  1. On your own computer, open the public key file (for example ~/.ssh/id_ed25519.pub) and copy its one line.
  2. Paste it under Public key and click Add key.
  3. Test it: open a new SSH connection as root with the key, before you change anything else.

To remove a key, click Remove next to it.

Good to know:

  • Paste only the public key, the line from the .pub file. Never paste a private key anywhere.
  • Keys with special options in authorized_keys are not shown in the table. The page says how many there are, and leaves them as they are.
  • Once your key works, you can switch off SSH passwords under SSH Password Sign-in. The panel refuses to switch passwords off while root has no key.

Admin (wheel) Group Members#

In the admin area, open Security → Admin (wheel) Group Members (open). Users in the wheel group may become root with su or sudo.

The table lists the current members. To change it:

  • To add a user, choose one under Add a user and click Add to the group. The list offers the server's ordinary system users who are not members yet.
  • To remove a user, click Remove from the group next to them. root cannot be removed.

Add only people who administer this server. A hosting account should never be in this group: anyone who breaks into it could then become root.

ModSecurity Settings#

In the admin area, open Security → ModSecurity Settings (open). ModSecurity is the web application firewall in Apache. It checks every request to the websites against the OWASP Core Rule Set.

The mode is at the top of Security → ModSecurity Rule Sets (open), under Web application firewall. Choose a mode and click Save mode:

  • On: requests that look like attacks (SQL injection, cross-site scripting and similar) are blocked with "403 Forbidden".
  • Detection only: nothing is blocked, but what would have been blocked is listed. Use this to check a site before you switch to On.
  • Off: no request is inspected.

Server-wide ModSecurity settings sets ModSecurity's global directives:

  • what goes to the audit log (SecAuditEngine; "Only requests that matter" is recommended),
  • connection rules (SecConnEngine) and compressed responses (SecDisableBackendCompression),
  • the country lookup database (SecGeoLookupDb) and Project Honey Pot key (SecHttpBlKey),
  • the regular-expression limits (SecPcreMatchLimit, where 250000 is recommended for the OWASP rules, and SecPcreMatchLimitRecursion).

Click Save. An empty field leaves ModSecurity's own default in place. Apache checks every change first, and a setting it rejects is not applied. To exempt a single website, open the account under All Accounts and use its ModSecurity switch.

ModSecurity Hit Log#

In the admin area, open Security → ModSecurity Hit Log (open). This lists requests that matched a ModSecurity rule. It is read from the web server's recent error logs, and times are the server's.

Each row shows the time, the website, the visitor's address, the severity, the HTTP status returned, and the rule ID with its message and the address requested.

  • To search, enter a domain, address, rule ID or text in the box and click Search.
  • Choose how many rows to show per page, and use Previous and Next to page through.
  • Your Rules jumps to your own rules.

To deal with a false alarm, where a legitimate request is blocked:

  1. Find the request in the hit log and note the rule ID (for example 942100).
  2. Open ModSecurity Rules.
  3. Add a rule with the text SecRuleRemoveById 942100, tick In force, and save.

Alternatively, switch ModSecurity off for that one website on the account's page.

The full ModSecurity page also shows Recent blocked or flagged requests, with the rules that caused each one.

ModSecurity Rules#

In the admin area, open Security → ModSecurity Rules (open). Here you add rules of your own, on top of the OWASP Core Rule Set, which is always loaded.

To add a rule:

  1. Enter a Note saying what the rule is for.
  2. Enter the Rule text, using ModSecurity directives only (SecRule, SecAction, SecRuleRemoveById and so on). For example: SecRule REQUEST_URI "@contains /xmlrpc.php" "id:1000001,phase:1,deny,status:403,msg:'xmlrpc blocked'".
  3. Tick In force and click Save rule.

The table lists your rules with their state. Edit changes a rule, Switch off and Switch on keep it without or with effect, and Delete removes it.

Good to know:

  • Give your own rules IDs from 1000000 upwards, so they do not clash with the Core Rule Set.
  • To stop one Core Rule Set rule that blocks something legitimate, use SecRuleRemoveById followed by its ID.
  • Apache checks the configuration before a rule takes effect. If the rule is not valid, the error is shown and the rule does not take effect.
  • You can keep up to 200 rules of your own.

ModSecurity Rule Sets#

In the admin area, open Security → ModSecurity Rule Sets (open). This lists the rule sets in use:

  • OWASP Core Rule Set (CRS): the version installed and its state (Blocking, Detecting only or Off, following the ModSecurity mode). It ships with intoPanel, is tested with it, and is replaced by the version that comes with each panel upgrade.
  • Custom rules: your own rules (see ModSecurity Rules).

Rule sets from other providers cannot be added. To change how the Core Rule Set behaves, add your own rules, for example SecRuleRemoveById to drop one rule.

Password Strength Rules#

In the admin area, open Security → Password Strength Rules (open). This opens the Password strength card of Server Preferences. Its rules apply to panel passwords of administrators, resellers and clients when a password is set or changed. Existing passwords keep working.

  • Shortest password: 10 to 64 characters.
  • Least password strength (%): 1 to 100, or 0 for no particular strength. Strength counts the length and the kinds of characters used.
  • A new password must contain: upper-case letters, lower-case letters, digits and/or symbols.

Click Save server preferences. The installer starts you with upper-case, lower-case and digits required and a strength of 50%. See Server Setup for details. To make passwords expire, use Sign-in Security Policies.

Account Isolation#

In the admin area, open Security → Account Isolation (open). With isolation on, the PHP of every hosting account runs in a service of its own, and so do the account's Node.js, Python and Ruby applications. Each service gets a private view of the server:

  • Of /home it sees only the account's own folder. Other accounts are not even listed.
  • It has its own /tmp.
  • Processes of other users are hidden (on every supported system except AlmaLinux 8, where they stay visible).

A website that is broken into then cannot look around the other accounts. The names of other accounts can still be read in the server's user list, but their files cannot.

To switch, click Switch isolation on or Switch isolation off. When isolation is on, the page shows how many PHP services are running for accounts.

Good to know:

  • Switching restarts PHP for every website once, so visitors may see an error for a few seconds.
  • Each isolated account uses a little more memory, because its PHP has a supervising process of its own.
  • Scheduled tasks (cron) are not isolated this way. Only file permissions hold them back.

Jailed shell for SSH#

On the same page, Jailed shell for SSH sets which shell accounts get when their package gives shell access and they have no setting of their own. In the jailed shell, an SSH or SFTP session sees only the account's own folder under /home, gets a private /tmp that is empty at every login, cannot see other users' processes, and finds the rest of the system read-only. Commands such as PHP, Git, Composer, WP-CLI and the database client keep working.

Click Give them the jailed shell by default or Give them the normal shell by default; every account's shell is updated at once. One account's own choice is set under SSH Shell Access. The jailed shell uses bubblewrap, which the installer adds.

Secure /tmp and Cron Check#

Open Security → Secure /tmp and Cron Check (Secure /tmp and Cron Check). It does what cPanel's securetmp does: /tmp becomes a file system of its own, mounted noexec, nosuid and nodev, and /var/tmp points to the same place with the same protection. A program a hacked website drops there cannot be started from there, and setuid and device files there do not work.

The table shows how /tmp and /var/tmp are mounted now and whether they are protected.

  1. Under Where /tmp is kept, choose:
    • In a file on disk: a file, /usr/tmpDSK, holds /tmp, as on cPanel servers. It uses no memory and keeps its files across restarts.
    • In memory (tmpfs): fastest, emptied at every restart. It uses memory only for what is stored, and may be at most half of the server's memory.
  2. Enter the Size of /tmp in MB (2048 unless you change it).
  3. Under When, choose At the next restart of the server (recommended) or Now. Now hides the files that are in /tmp at that moment under the new /tmp until the protection is taken off, so a program using one of them may fail.
  4. Click Protect /tmp.

The setting stays across restarts. Take the protection off goes back to an ordinary /tmp.

noexec stops starting a program from /tmp, but not reading a script there: php /tmp/x.php still runs. The cron check covers that.

Cron check: every account's crontab is checked for jobs that fetch code from the internet and run it, or that switch off PHP's disabled functions, the way planted malware keeps itself running. They are listed on this page, and Server Monitoring raises a critical alert (emailed to the alert contacts) while any is there. Such jobs are also refused when someone adds them in the panel, and left out (named in the log) when accounts are restored from backups or moved here with Server Migration. When an account is listed, remove the lines from its cron jobs, change its password and scan it under Malware Scanner.

Security Checkup#

In the admin area, open Security → Security Checkup (open). The checkup looks through the server's settings and lists what could be made safer, most important first.

Click Run the checks. Results are grouped as Needs attention, Suggestion, For information and Passed. Each item explains the problem, and Open the setting takes you to the page that fixes it. Run the checks again repeats the checks after you change something.

The checks cover:

  • SSH: password sign-in, and the standard port 22,
  • the firewall: installed, switched on, not in testing mode,
  • Outgoing Mail Restrictions and Sign-in Attack Protection,
  • Compiler Access, process flood protection, home-folder URLs, symbolic link protection and traceroute,
  • the background process killer (Forbidden Background Programs),
  • Apache answering TRACE requests or revealing its version,
  • PHP versions that no longer get security updates,
  • whether anyone receives the server's warnings (Alert Contacts),
  • waiting system updates, and whether the server needs a reboot.

The check for waiting updates asks the package system, which can take up to a minute.

Process Flood (Fork Bomb) Protection#

In the admin area, open Security → Process Flood (Fork Bomb) Protection (open).

A "fork bomb" is a script that starts copies of itself until the server runs out of processes. With Limit the processes and open files of each user's shell ticked, each ordinary user's shell sessions and scheduled tasks are limited to:

  • at most 250 processes (a soft limit of 200),
  • at most 8192 open files (a soft limit of 4096),
  • no core dumps.

A runaway or hostile script then cannot use up the whole server. Root is not limited, and websites (PHP) already have their own limits.

To change it, tick or untick the box and click Save security settings. The change applies to sessions that start afterwards; open sessions keep their old limits until they end.

The installer switches the protection on, and the Security Checkup suggests switching it back on if it is off.

SSH Password Sign-in#

In the admin area, open Security → SSH Password Sign-in (open). The card shows the SSH Port, whether Passwords are accepted, and how root may sign in (with a password or a key, or with a key only).

Keys cannot be guessed; passwords can. To allow keys only:

  1. Add your public key under Root SSH Keys.
  2. Open a new SSH connection with the key and check that it works. Keep that connection open.
  3. Untick Accept passwords and click Apply.

To allow passwords again, tick the box and click Apply.

Good to know:

  • The panel refuses to switch passwords off while there is no key, so you cannot lock yourself out that way.
  • The full SSH page also has Restart SSH. Open sessions stay open during a restart. The SSH server can be restarted from the panel but never stopped.
  • The installer adds safer SSH defaults: fewer guesses per connection, no empty passwords, and idle sessions end.
  • The Security Checkup marks password sign-in as "Needs attention".

Traceroute Access#

In the admin area, open Security → Traceroute Access (open).

traceroute and tracepath show the network path from this server to another host. That can help someone map your network. With Users may run traceroute unticked, only root can run these programs.

To change it, tick or untick the box and click Save security settings.

Traceroute is allowed by default. The Security Checkup lists it as "For information", not as a problem. Closing it does no harm unless your clients use it from the shell to diagnose network problems; you can always run it yourself in the Terminal.

Two-Factor Authentication#

In the admin area, open Security → Two-Factor Authentication (open). In the panel this feature is called two-step sign-in: signing in needs the password and a 6-digit code from an authenticator app.

To set it up for your own login:

  1. Click Set up my own, or open your name at the top right and then My Admin Password.
  2. Enter your password and click Set up two-step sign-in.
  3. Scan the QR code with an authenticator app (Google Authenticator, Authy, 1Password and so on), or enter the key by hand.
  4. Enter the code the app shows and click Switch on.
  5. Write down the recovery codes and keep them safe. Each works once, and they are shown only this one time.

The Logins table lists every administrator, reseller and hosting account, whether two-step sign-in is on, how many recovery codes are left, and how many sign-in questions they have.

To help someone who lost their phone and recovery codes, tick their login and click Remove two-step sign-in and sign-in questions from the ticked logins. They can then sign in with their password and set it up again. You cannot remove your own here.

Require it for administrators and resellers opens Sign-in Security Policies. If an administrator is locked out, run intopanel-web -disable-two-step NAME on the server (see Getting Started).

Firewall & Settings#

In the admin area, open Security → Firewall & Settings (open). CSF is the server's firewall, and LFD (Login Failure Daemon) is its login protection. The installer sets both up. The page has six tabs.

  • Overview: whether the firewall is On, whether login protection is Running, the CSF version, your address and how many addresses are on each list. Turn the firewall off and Turn the firewall on switch it; Restart the firewall reloads its rules and login protection; Restart login protection restarts LFD alone. Always allow my address adds your current address to the allow list. Find an address shows every list and live rule that mentions an address, for example to learn why a customer cannot connect, with buttons to unblock it.
  • Allow and Block Lists: Always allowed (passes the firewall and is never blocked), Blocked (cannot reach the server at all) and Never blocked by login protection (failed sign-ins are not counted, but port rules still apply; for monitoring services and your office). Add an address or network with an optional note; Remove takes it off.
  • Temporary: allow or block an address for some minutes, hours or days (at most 30), on all ports or only the ones you list. The table shows these entries and the blocks login protection made after failed sign-ins, with the time each ends (UTC). Remove all temporary entries clears them.
  • Ports: comma-separated lists for Incoming TCP, Outgoing TCP, Incoming UDP and Outgoing UDP; a range is written 30000:30100. The same lists apply to IPv6. The incoming TCP ports for SSH, websites and this panel cannot be closed, and outgoing DNS and web traffic must stay open.
  • Settings: Common settings groups the options most servers need, in plain words: permanent blocks, connection limits, countries, alert email, process watching and general options. All settings lists every option in /etc/csf/csf.conf with CSF's own note, and a search box.
  • Logs: the last lines of login protection's log, or of refused connections (when CSF's logging is on), newest first, with a filter.

Good to know:

  • Saving settings restarts the firewall and login protection. If either refuses the new settings, the previous ones are put back.
  • Testing mode cannot be turned on here: it empties the firewall every few minutes. If CSF is in testing mode, a warning says so: run the installer again to finish its setup.
  • You cannot block this server's own addresses or the address you are signed in from.
  • The installer sets the firewall up for shared hosting: IPv6 filtered as well as IPv4, large block lists kept in fast ipset tables, connection limits per address on mail, FTP, SSH and web ports, port-scan detection, limits on outgoing UDP floods from accounts, outgoing mail on port 25 only from the mail server, fork bombs ended, and mail only about permanent blocks. It relies on the kernel's SYN cookies rather than CSF's server-wide SYN limit, which would turn away ordinary visitors on a busy server. Every value can be changed in the Settings tab; reinstalling the panel does not change them back.
  • Cloudflare's networks reach the websites without the per-address connection limits and are never blocked by login protection, since each carries many visitors; Apache logs, and ModSecurity checks, the real visitor behind them.
  • Advanced rules written by hand in /etc/csf/csf.allow, csf.deny or csf.ignore are shown, but must be edited in those files.
  • How many failed sign-ins lead to a block is set per service in Sign-in Attack Protection. One port for one address: Service Access Rules. Outgoing mail: Outgoing Mail Restrictions.

Malware Scanners (ClamAV)#

In the admin area, open Add-ons → Malware Scanners (ClamAV) (open). Two scanners can be installed here. Neither is installed with the panel.

  • ClamAV: an antivirus engine. The client area's virus scanner also uses it.
  • Linux Malware Detect (Maldet): finds web shells, mass mailers and other malware typical of hacked websites.

Click Install or Remove next to a scanner, or Install ClamAV with Maldet to install both. Update signatures refreshes Maldet's signatures. The progress shows at the top of the page.

Good to know:

  • ClamAV's engine needs about 3 GB of memory. On a smaller server, Maldet uses its own lighter engine, and ClamAV scans and the client area's virus scanner cannot run.
  • When ClamAV is installed and memory allows, Maldet scans with ClamAV's engine and its own signatures added. If you installed Maldet before ClamAV, remove and install Maldet again so it uses ClamAV's engine.
  • Maldet is installed at a version the panel pins and checks, and does not update its own program. By default it only reports; see below to let it act on what it finds.

What Maldet does with what it finds#

Once Maldet is installed, the card What Maldet does with what it finds offers three choices. Tick any of them and click Save:

  • Move to quarantine (quarantine_hits): each file Maldet finds is moved to /usr/local/maldetect/quarantine, out of the website's reach. Bring a file back with maldet --restore and its name.
  • Attempt cleaning string-based malware injections (quarantine_clean): Maldet tries to cut injected code out of a quarantined file and puts the cleaned file back. It needs Move to quarantine.
  • Automatically suspend user accounts with malware hits (quarantine_suspend_user): after a Maldet scan started on this page or by the daily scans, each account with hits is suspended — its websites, mail and FTP — with the reason "malware found by the scanner". Unsuspend it on its account page once it is clean. The panel does this suspension itself; on a server without cPanel, Maldet's own would only change the account's login shell.

The first two also apply to Maldet's own daily check of changed files. ClamAV scans only report. Removing and installing Maldet again keeps these choices.

Scanning for malware and daily scans#

In the admin area, open Add-ons → Malware Scanners (ClamAV) (open). The scan cards appear once a scanner is installed.

To scan now:

  1. Under Scan for malware, choose an Account or All accounts.
  2. Choose the Kind of scan: Maldet Scan with ClamAV or ClamAV Scan.
  3. Click Scan now.

The scan reads every file in the home folders, so it takes a while on large accounts. The report appears at the top of the page. Unless you chose otherwise under What Maldet does with what it finds, nothing is moved or deleted; act on the findings yourself.

To scan every day:

  1. Under Daily scans, tick Scan accounts every day.
  2. Set Accounts scanned a day. Each day the next accounts on the list are scanned, round the whole list, then starting again with the first.
  3. Choose the kind of scan and the start hour (server time).
  4. Optionally enter an address under Send the results to. One message is sent after each day's scan, listing the accounts scanned and any suspicious files.
  5. Click Save.

The page shows when the last run took place and where the next run starts.

Was this article helpful?

Something missing? Ask in the community or open a ticket.