Security
This page covers server protection in MoorCP: the ModSecurity WAF, CrowdSec, firewalld ports, panel login protection, and malware scanning with ClamAV and YARA. It is written for admins and technicians.
Open Security in the Infrastructure group.
Protection layers
| Layer | Component | Protects against |
|---|---|---|
| Per-request WAF | ModSecurity + OWASP CRS 3.3 | SQL injection, XSS, RCE, LFI/RFI, scanners, invalid protocol use. |
| Behavior-based IP blocking | CrowdSec + nftables firewall bouncer | Brute force on SSH, SMTP/IMAP and wp-login, HTTP scanners, CVE exploits, IPs that keep tripping the WAF, plus the community blocklist. |
| Host firewall | firewalld | Ports that should not be reachable from the internet. |
| Per-website access rules | IP Blocker & hotlink protection on the website | Chosen IPv4/IPv6 addresses or CIDR ranges (403), and other sites embedding the website's files. Works in every web server mode. See Websites. |
| Panel login protection | Temporary lockouts in the panel | Password guessing on the admin panel, the client panel, and API keys. |
| Malware scanning | ClamAV + YARA web shell rules | Malicious files in account home directories, scheduled and realtime. |
| Account isolation | Isolation driver | Accounts reading each other's files or processes. See CloudLinux. |
Security page layout
The page has five tabs: Overview, Malware Report, Scanner, WAF, and Network & Access.
The Server picker at the top right chooses the server that the per-server parts of every tab show: protection controls, malware findings, WAF events, blocked IPs, and firewall ports. Refresh reloads all data. The button next to it changes per tab: View malware report, WAF settings, or Manage login protection.
Overview tab
| Part | Contents |
|---|---|
| Summary cards | Open findings and Quarantined across all accounts (click to open the Malware Report), Scanner coverage and WAF coverage as servers covered out of all servers. |
| Server protection | One row per server: scanner, WAF, CrowdSec, and last scan. Manage opens the WAF tab for that server. |
| Malware activity | The five most recent account scans. View report opens the account's malware report. |
| Protection controls | For the selected server: Realtime scanning, YARA rules, ModSecurity + OWASP CRS, and CrowdSec, each with its status and an Install, Reapply, Turn on, or Turn off button. |
| Recent WAF activity | The five latest WAF events on the selected server. |
WAF (ModSecurity + OWASP CRS)
Support per web server mode
| Mode | WAF |
|---|---|
apache, nginx-proxy | ModSecurity 2.9 + OWASP CRS 3.3 |
openlitespeed | libmodsecurity v3 + the same OWASP CRS 3.3 |
nginx | Not available yet |
In nginx-proxy, static files served directly by Nginx do not pass through the WAF. All PHP and dynamic requests still go through the WAF.
nginx mode
Servers in nginx mode do not have a WAF yet. CrowdSec still protects them because it works from logs and the firewall.
WAF tab
The WAF tab shows, for the selected server:
- Protection, Default mode, and Ruleset cards;
- WAF policy: engine version, web server, paranoia level, anomaly threshold, and the number of Websites with own mode;
- WAF events with search, Period, and Result filters.
Installing the WAF and CrowdSec
- Pick the server in the Server picker, or click Manage on its row in Overview.
- In the WAF tab, click Install on server. If it is already installed, the button is Reapply on server. CrowdSec is installed from Network & Access with Install CrowdSec, or from Protection controls in Overview.
- Wait for Security components installed. A fresh install usually takes about 2 minutes.
The install is safe to repeat. MoorCP writes its configuration before the packages are installed, so ModSecurity does not start blocking with the package defaults. Websites keep running during the install.
Global WAF settings
Click WAF settings (or Manage ruleset in the WAF policy card). The settings apply to all servers.
| Setting | Default | Notes |
|---|---|---|
| Default mode | Detect only | Block, Detect only, or Off. |
| Paranoia level | 1 | 1 to 4. Level 1 suits shared hosting. Higher levels catch more attacks, and more false positives. |
| Anomaly threshold | 5 | A request is blocked when its score reaches this value. |
| Application exclusions | WordPress | CRS rule sets that reduce false positives in the admin areas of WordPress, Drupal, Nextcloud, DokuWiki, and XenForo. |
| IP allowlist | Empty | One IP or CIDR per line. Skipped by the WAF and never blocked by CrowdSec. |
| Clients can change the WAF mode of their websites | On | Clients may change the WAF mode of their own websites from the client panel. |
Click Save and apply.
Some addresses are always trusted, in both ModSecurity and CrowdSec: every address of the server itself (including loopback), the IPs of the other servers, and the panel host. Requests a site makes to itself, such as WordPress cron, cache preload crawlers, or image optimizer plugins, are therefore never blocked by the WAF. The agent updates this list when it starts and whenever the WAF settings are applied.
Start with Detect only
Leave the mode on Detect only for a few days. Review WAF events for false positives, turn off noisy rules per website, then switch to Block.
Per-website mode
Each website can use its own mode and turn off specific rules.
- Open Websites › (website), WAF tab.
- Choose a Mode: Server default, Block, Detect only, or Off.
- If needed, fill Disabled rules with OWASP CRS rule IDs, separated by commas. At most 100 rules.
- Save.
Clients can only change the mode, and only when the admin allows it. Only staff can turn off rules.
WAF events
The WAF events table shows requests that matched OWASP CRS rules on the selected server, newest first: time, host, source IP with its country flag, request, rule, and Blocked or Logged. Search by host, IP, or rule, and filter by Period and Result.
Request bodies, cookies, and Authorization headers are never stored.
Handling a false positive:
- Click an event to open its details and read the Message and Matched data of each rule.
- Open the website's WAF tab (Websites › (website)). Its event list shows the same events for that website only.
- Click the event, then Turn off on this site on the rule that misfired.
The rule is turned off only for that website. Other websites stay protected.
WAF ruleset provider
The Ruleset provider button in the WAF policy card picks the WAF ruleset for the selected server. Only one provider is active per server, and only admins can change it.
| Provider | Ruleset | Web server modes |
|---|---|---|
| Built-in (default) | OWASP CRS managed by MoorCP | apache, nginx-proxy, openlitespeed |
| Imunify360 | Imunify360 Stand-alone | apache, nginx-proxy |
| cPGuard | cPGuard Standalone | apache, nginx-proxy, openlitespeed |
Switching to a licensed vendor:
- Choose the Provider.
- Fill License key. The key is only passed to the vendor installer. MoorCP does not store it.
- Click Install and activate, then confirm. The vendor installer runs as root and takes a few minutes.
The server is never without a WAF during this process. OWASP CRS is removed only after the vendor installs successfully. If the installer fails, CRS stays active. Per-website WAF modes and the allowlist still apply on top of the vendor ruleset.
WARNING
Switching back to the built-in provider is refused while the vendor is still installed. Remove the vendor first with its official uninstall procedure.
INFO
The Imunify360 and cPGuard integrations are ready on the MoorCP side but have not been tested with real licenses yet.
Record vendor licenses in Settings › Vendor licenses so the panel alerts you before a license expires. See Panel settings.
Network & Access tab
The Network & Access tab covers CrowdSec, the firewall, and login protection for the selected server. The top cards show CrowdSec, Firewall, Blocked IPs, and Login protection. Below them are the CrowdSec and Login protection cards, then four sub-tabs: Blocked IPs, Detections, Firewall ports, and Lockouts.
CrowdSec
CrowdSec reads server logs, detects brute force and scanners, and blocks IPs in the firewall. CrowdSec also uses the community blocklist.
The CrowdSec card shows the Engine and nftables bouncer status with their versions, and the active Collections. Click Install CrowdSec or Reapply to set it up again.
Installed collections: linux, sshd, nginx, apache2, basic HTTP scenarios, http-cve, wordpress, modsecurity, postfix, and dovecot.
Blocked IPs
The Blocked IPs sub-tab shows active CrowdSec decisions from this server's detections and manual blocks: IP address, reason, source, expiry, and status. Search by IP or reason, or filter by Source. The community blocklist also applies but is not listed.
Blocking an IP manually:
- Click Block IP.
- Fill IP or CIDR, for example
203.0.113.5or203.0.113.0/28. - Choose a Duration: 1 hour, 4 hours, 24 hours, 7 days, 30 days, or 1 year.
- Fill Reason, for example
brute force wp-login. - Click Block.
To lift a block, click Unblock on the IP's row.
INFO
IPs on the allowlist, server IPs, and the panel IP are refused when you try to block them, so the panel cannot cut itself off.
Detections
The Detections sub-tab shows the latest CrowdSec alerts from the SSH, email, and web scenarios: time, scenario, source, location, event count, and whether the IP was blocked.
Blocked customer
If a customer cannot reach the server, look up their IP in Blocked IPs. Unblock it, then find the cause in Detections, for example an email app with an old password that keeps trying to log in.
Firewall ports
The Firewall ports sub-tab opens and closes TCP/UDP ports in the server's firewalld, in the default zone. It also shows the zone name and the firewalld services that are already allowed.
Opening a port:
- Fill Port or range, for example
3000or30000-30100. A range can span at most 10000 ports. - Choose a Protocol: TCP or UDP.
- Click Open port.
To close a port, click Close on its row, then Close port. Connections from outside to that port are refused right away. Services listening on it keep running but can no longer be reached from the internet.
Rules are written to the runtime and permanent configuration at once, without reloading firewalld, so CrowdSec IP blocks are not disturbed. Only admins can open and close ports. Every change is recorded in the audit log (server.port_open, server.port_close).
Protected ports
The following ports cannot be closed from the panel, so admins cannot lock themselves out of the server. The Used by column marks what uses them.
| Port | Used by |
|---|---|
| Every port the system SSH server listens on/tcp (default 22) | SSH |
| The client SFTP/SSH port/tcp, when a separate port is set | Client SFTP/SSH |
| 80/tcp, 443/tcp | HTTP, HTTPS |
| 443/udp | HTTP/3 |
| 8443/tcp | Admin panel and agent |
| 2083/tcp | Client panel |
| 2085/tcp, 2086/tcp | Applications and application admin |
| Agent port (default 7443)/tcp | MoorCP agent |
Email, FTP, and DNS ports may be closed if the server does not use them. The SSH ports are set in Server settings › Apps & tools.
Turning on firewalld
When firewalld is not installed or not running, the sub-tab shows a warning, and every port a service listens on is reachable from outside. Admins can turn it on from the panel:
- Click Install & enable firewalld (when it is not installed) or Enable firewalld.
- Read the impact, then click Enable.
What happens:
- firewalld is installed if it is missing;
- before it starts, these ports are opened: the SSH ports the server really uses (root and the client SFTP/SSH port), the panel and agent ports, and web, mail, FTP (with its passive range), and DNS when they are installed;
- any other port a service listens on is closed from the internet. Open it afterwards in this sub-tab if it is needed;
- a safety timer runs: if the panel cannot reach the server again within 90 seconds, firewalld turns itself off so you are not locked out.
The result says when firewalld is running and the panel can still reach the server. This can take up to a minute. Firewall rules for remote database access are added again automatically. See Databases › Remote database access.
Cloud firewalls
MoorCP only manages firewalld on the server. Ports must also be open in your cloud provider's firewall or security group, which the panel cannot change.
Panel login protection
Click Manage login protection. This feature temporarily locks out IPs that fail to log in many times on the admin panel, the client panel, or with a wrong API key. The settings apply to the whole panel, not one server. Only admins can change them.
| Rule | Default | Notes |
|---|---|---|
| Failures per IP | 10 failures / 15 minutes | All usernames. |
| Failures per user + IP | 5 failures / 15 minutes | |
| Failures per account | 20 failures / 15 minutes | From all IPs. Only locks IPs that have never logged in to that account successfully, so an attacker cannot lock out the owner. |
| Window (minutes) | 15 | The period failures are counted in. |
| Lock (minutes) | 15 minutes | Doubles when locked again within 24 hours, up to 24 hours. |
Fill Never lock these IPs with office or billing server IPs, one per line. Protection enabled turns the feature on or off.
While locked, logins are refused even with the right password, until the lock expires. Valid API keys are never held back.
The Lockouts sub-tab shows the lock type, panel, user, IP, failure count, and expiry. Click Unlock to lift a lock early.
Firewall layer
Every failed login is also logged for CrowdSec on the panel server. An attacker who keeps trying after being locked out gets blocked in the firewall.
Malware scanning
MoorCP scans account home directories with ClamAV. YARA web shell rules add a second check for PHP, JavaScript, and HTML files.
Installing ClamAV
You can install ClamAV when adding a server (tick Install ClamAV in the token window), or later from the panel:
Pick the server, then click Install ClamAV in Protection controls (Overview tab) or in the Scanner card of the Malware Report tab.
If the result asks for an SELinux boolean, run this once on the server as root:
bashsetsebool -P antivirus_can_scan_system 1Click Install / start ClamAV.
When installed by the installer, MoorCP's clamd configuration is written, signatures are downloaded, and clamd is started if SELinux allows it. The installer's --clamd-selinux option also turns the boolean on. See Installer options. clamd uses about 1 GB of RAM.
MoorCP does not turn on that SELinux boolean from the panel, because it gives clamd read access to the whole system. Without clamd, scheduled scans still run with clamscan, but realtime scanning cannot be turned on.
Malware Report tab
The Malware Report tab shows, for the selected server:
- Open findings, Quarantined, Completed scans, and Last scan cards;
- Malware findings: search by file or signature, and filter by Account, status, and Period. Click a finding to open it;
- Scan history: the latest scan of each account;
- the Scanner card: realtime scanning status, files scanned in realtime, YARA rules, and the scan schedule.
Export CSV downloads the server's findings. Run scan queues a full scan of every active account on the server. Scans run one at a time per server.
Scheduled and manual scans
Every account is scanned on a schedule. To change it, click Change next to Schedule in the Scanner card:
| Field | Notes |
|---|---|
| Scan every account on a schedule | Turns scheduled scans on or off. |
| Scan interval | Every 24, 48, or 72 hours, 7, 14, or 30 days. |
| Start scans from, Until | New scheduled scans only start in this window, in panel server time. A scan already running finishes normally. The same start and end hour means any time. |
Manual scans, realtime scanning, and the scan after a migration keep running when the schedule is off. Until the schedule is saved from the panel, it follows the MOORCP_MALWARE_SCAN_HOURS variable (default 24, 0 = off).
Scans run in the background with low CPU and IO priority. For a manual scan of one account, open Accounts › (account), the Malware protection card, and click Scan now.
An account with open findings raises the critical alert malware_found.
Realtime scanning
Realtime scanning watches file writes in account home directories. Turn it on with Turn on in Protection controls, or Turn on realtime in the Scanner card.
- Every file that finishes writing (web upload, FTP/SFTP, file manager, archive extraction, scripts) is scanned by ClamAV. PHP files are also checked with YARA, in batches every 2 seconds.
- Infected files are quarantined right away and appear in the account's malware report.
- The warning alert
malware_quarantinedis shown for 24 hours. - The card shows the Watching status and the number of files scanned and quarantined.
To keep clamd light, realtime scanning skips log files (*.log, error_log, and everything in ~/logs/) and non-script files in plugin cache folders such as wp-content/cache/. Server scripts (.php, .phtml, .phar, .inc, .cgi, .pl, .py, .sh, .htaccess, .user.ini) are always scanned, wherever they are. Scheduled scans still check every file.
INFO
Realtime scanning happens after a file is saved, not before. An infected file sits on disk for a moment until the scan finishes. For web uploads, the WAF adds another layer.
YARA web shell rules
YARA uses the web shell rules from signature-base (Neo23x0, Detection Rule License 1.1). The rule author is shown in each finding's signature, for example YARA.<rule> (<author>).
- Click Install in Protection controls, or Install YARA and rules in the Scanner card. The agent installs
yara, downloads the rules, and compiles them. - The agent updates the rules once a day. Update rules now updates them right away. If an update fails, the previous rules stay in use and the error is shown.
- Turn off YARA and Turn on YARA switch it per server.
YARA checks .php, .phtml, .phar, .inc, .js, .html, and similar files up to 5 MB during full scans.
Scanner tab
The Scanner tab manages the scanner for all servers at once. Settings and signatures are stored in the panel and pushed to every server, so new servers get the same set automatically.
Scanner settings:
| Setting | Default | Notes |
|---|---|---|
| Max file size (MB) | 25 | 1 to 1024. Larger files are skipped, in scheduled and realtime scans. |
| Max scan size (MB) | 100 | 1 to 4096. Data read per file or archive. |
| CPU limit for clamd | Automatic | Automatic is 1/8 of the server's CPUs, at least 1 core. Or 1 to 8 cores. |
| Detect PUA (potentially unwanted apps) | Off | |
| Scan inside archives | On | |
| Realtime exclusions | Empty | One pattern per line, relative to the account home. A pattern ending in / is a folder (public_html/backup/). Otherwise it is a glob for the path or file name (*.mp4). Scheduled scans still check everything. |
| Signature reload | Automatic | See below. |
| Use the signature-base web shell rules | On | Individual rules can be turned off in the rule list below. |
Click Save and apply to all servers.
Signature reload decides how clamd loads new signatures, which freshclam downloads several times a day. The signature database takes about 1 GB of RAM.
| Option | Effect |
|---|---|
| Automatic | Blocking on servers with 8 GB of RAM or less; concurrent on larger servers. |
| Concurrent (faster, more RAM) | Scans do not pause during a reload, but clamd briefly needs twice its memory and settles around 1.5 to 2 GB after a few days. |
| Blocking (saves RAM) | clamd stays around 1 GB. Scans pause for 30 to 60 seconds at each signature update. |
The effective mode and the server's RAM are shown in Rules in use on this server. When the configuration on a server no longer matches the setting, for example after an agent upgrade or a RAM change, the panel applies it again and restarts clamd once.
Custom signatures and rules holds your own ClamAV signature databases (.ndb, .hdb, .hsb, .ldb, .cdb, .fp, .ign2, and others) and YARA rule files, up to 64 MB per file.
- Choose Upload as and click Upload file, or click New ClamAV signature or New YARA rule to write one in the editor.
- Fill File name, Description, and Content, then Save.
Each server validates a ClamAV database before loading it, and compiles each YARA file separately. YARA include directives are not allowed. A file that fails on a server is reported for that server and skipped, without affecting the others. Use Edit, Turn off/Turn on, Download, and Delete on each row. Deleting removes the file from every server.
Synchronization shows each server's last sync, files sent, and problems. Changes are pushed right away and checked again every 10 minutes. Click Sync now to push now.
Rules in use on this server lists, for the selected server, the ClamAV databases clamd has loaded (source Official (freshclam), Panel, or Installed outside the panel) and the YARA rules the agent compiled. Search the YARA rules and click Turn off on a rule that causes false positives. That applies to every server.
Handling findings
The account's malware report (Findings history) shows the file, signature, result, and action. Finding statuses: Detected, Quarantined, Deleted, Ignored, Restored, or Gone.
| Action | Result |
|---|---|
| Quarantine | The file is moved to ~/.moorcp-quarantine/ outside the document root, with mode 0000. |
| Restore | The file goes back to its original location and is ignored by later scans. |
| Ignore (false positive) | The file is marked as a false detection and not reported again. Report again undoes this. |
| Delete permanently | The file is deleted from its original location or from quarantine. |
Delete permanently
A permanently deleted file cannot be restored from the panel. Quarantine first if you are not sure, then inspect its contents.
The quarantine folder and Trash are not scanned.
Isolation checks
The agent checks account separation on every heartbeat: hidepid on /proc, /home permissions, filesystem quota, cgroup v2, and on CloudLinux also LVE and CageFS. The results are in Servers › (server) › Settings › Isolation & limits. See Server settings.
