Security is a System, Not a Single Tool
There is no single setting, plugin, or service that makes a web server "secure." Effective security in 2026 is a layered system — each layer covering the gaps left by the others. This checklist covers every layer from SSL to firewall to backups, specifically tailored for chat platform owners running CodyChat or similar systems.
Use this as a recurring audit checklist — run through it quarterly and after any major changes.
Layer 1: Network & DNS Security
- ✅ Enable Cloudflare proxy (orange cloud): Hides your real server IP — prevents direct-to-IP attacks that bypass Cloudflare
- ✅ Set DNS TTL low initially, high after stabilization: 300 seconds during setup, 86400 seconds once stable for faster propagation if you need to failover
- ✅ Enable DNSSEC: Prevents DNS hijacking (available in Cloudflare dashboard, free)
- ✅ Use SPF, DKIM, and DMARC records: Prevents email spoofing from your domain
- ✅ Disable unused DNS records: Remove old A/CNAME records that might point to stale servers
- ✅ Never share your real server IP publicly: Don't use origin IP in emails, error pages, or commit history
Layer 2: SSL/TLS Configuration
- ✅ Valid SSL certificate on all domains and subdomains
- ✅ Force HTTPS redirect: All HTTP requests should 301 redirect to HTTPS
- ✅ Set Cloudflare SSL mode to "Full (Strict)": Validates your origin certificate — prevents SSL stripping
- ✅ Disable TLS 1.0 and 1.1: Only TLS 1.2 and 1.3 should be accepted
# In Nginx ssl block ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384; - ✅ Enable HSTS:
Strict-Transport-Security: max-age=31536000; includeSubDomains - ✅ Set SSL certificate to auto-renew: Let's Encrypt via certbot, or managed renewal on X-Store hosting
Layer 3: Web Application Firewall (WAF)
- ✅ Enable Cloudflare WAF (Pro plan minimum) — activate managed OWASP ruleset
- ✅ Enable rate limiting on authentication endpoints: Login, registration, password reset — max 5 attempts per minute per IP
- ✅ Block known malicious user agents: Scanner tools, old browsers used by bots
- ✅ Enable bot fight mode (Cloudflare) or equivalent bot protection
- ✅ Add custom WAF rules for your platform:
- Block requests with SQL keywords in URL/body
- Block path traversal attempts (
../) - Block requests to sensitive files (
.env,config.php,.git)
- ✅ Install ModSecurity or Imunify360 at server level as secondary WAF
Layer 4: Server Firewall (UFW / iptables)
- ✅ Default deny all incoming — only allow ports you explicitly need
ufw default deny incoming ufw default allow outgoing ufw allow 22/tcp # SSH ufw allow 80/tcp # HTTP ufw allow 443/tcp # HTTPS ufw allow 3000/tcp # CodyChat voice server (WebSocket) ufw enable - ✅ Change SSH port from 22 to a non-standard port (reduces automated scan noise)
- ✅ Restrict SSH to specific IPs if you have a static IP:
ufw allow from YOUR_IP to any port 22 - ✅ Enable SYN flood protection:
# In /etc/sysctl.conf net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.tcp_synack_retries = 3 - ✅ Install Fail2Ban — auto-bans IPs with repeated failed SSH/HTTP auth attempts
Layer 5: Access Control
- ✅ Disable root SSH login:
PermitRootLogin noin/etc/ssh/sshd_config - ✅ Use SSH key authentication — disable password authentication for SSH
- ✅ Restrict admin panel access by IP: If possible, whitelist your IP for CodyChat admin at
/admin - ✅ Use strong, unique passwords for: MySQL root, CodyChat admin, hosting control panel, FTP
- ✅ Enable 2FA on your hosting control panel (Plesk supports TOTP 2FA)
- ✅ Remove default/test accounts: Delete demo users, test logins from CodyChat admin
- ✅ Set correct file permissions:
find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \; chmod 600 config.php # Protect config file
Layer 6: Application-Level Security
- ✅ Keep CodyChat updated — apply all updates within 7 days of release
- ✅ Update all addons regularly — outdated addons are a common attack vector
- ✅ Keep PHP updated: PHP 8.3 as of 2026, disable older PHP versions
- ✅ Disable PHP functions that aren't needed:
# In php.ini disable_functions = exec, passthru, shell_exec, system, proc_open, popen expose_php = Off - ✅ Set up CAPTCHA on registration and login — Cloudflare Turnstile (free) recommended
- ✅ Enable email verification for new registrations — prevents spam account creation
- ✅ Implement rate limiting in application code for API endpoints
Layer 7: Database Security
- ✅ MySQL not accessible from internet — bind to localhost only:
bind-address = 127.0.0.1 - ✅ Remove anonymous MySQL users:
DELETE FROM mysql.user WHERE User=''; - ✅ Use dedicated MySQL user for CodyChat with only necessary privileges
- ✅ Rename or hide database prefix if using a predictable default
- ✅ Enable MySQL binary logging for audit trail
Layer 8: Backup & Recovery
- ✅ Daily automated backups of both files and database
- ✅ Off-server backup storage — local-only backups don't protect against server compromise
- ✅ Test backup restoration quarterly — an untested backup is not a backup
- ✅ Retain 7 daily + 4 weekly backups minimum
- ✅ Encrypt backup files before remote transfer
Layer 9: Monitoring & Incident Response
- ✅ UptimeRobot or Freshping — external uptime monitoring, alerts in < 5 minutes
- ✅ Netdata or Grafana — real-time server resource monitoring
- ✅ Fail2Ban active and sending alerts on bans
- ✅ Log rotation configured — logs don't fill your disk
- ✅ Written incident response plan — what to do when the site goes down or is hacked
Quick Security Score Card
| Layer | Min. Required | Recommended |
|---|---|---|
| DDoS Protection | Cloudflare Free | Cloudflare Pro + Hardware-level |
| SSL | Let's Encrypt | Commercial SSL + HSTS Preloading |
| WAF | ModSecurity (free) | Cloudflare WAF Pro + Imunify360 |
| Firewall | UFW with default deny | UFW + Fail2Ban + CSF |
| Monitoring | UptimeRobot Free | UptimeRobot + Netdata + Fail2Ban |
| Backups | Daily local backup | Daily off-server encrypted backup |
Get a Pre-Secured Foundation from X-Store
Implementing all of these layers from scratch takes significant time and expertise. X-Store hosting plans come with DDoS protection, Imunify360 WAF, Fail2Ban, Plesk firewall, daily backups, and SSL management pre-configured. You get a hardened foundation from day one. Start with secured hosting →