Security Best Practices

Security should be a top priority for any web application handling user data and communications. This section outlines essential security measures for your ChatNet installation including changing default secret keys, enforcing SSL/HTTPS, setting strong passwords, securing your database, configuring file upload restrictions, and implementing regular backups. Following these practices helps protect your platform and users from common security threats.

Changing Default Secret Keys

Edit config/init.php:

// Change this to a unique random string define('SECRET_KEY', 'your-unique-random-string-here');

Generate a secure key:

echo bin2hex(random_bytes(32));

SSL/HTTPS Enforcement

Secure all communications by enabling HTTPS on your server.

  1. Obtain an SSL certificate (Let's Encrypt is free)
  2. Configure your web server for HTTPS
  3. Add redirect from HTTP to HTTPS
  4. Update site URL in admin to use https://

Strong Admin Passwords

Use strong, unique passwords for all administrator accounts.

Database Security

Protect your database from unauthorized access.

  1. Use a strong database password
  2. Limit database user permissions
  3. Don't use root for production
  4. Keep database on localhost when possible

File Upload Restrictions

In Chat & Features > Chat Settings:

Regular Backups

See the Backup & Maintenance section for details.

IP Logging & Blacklist

Navigate to Moderation > IP Access

IP logging and blacklisting help protect your platform from malicious users, spam bots, and repeated abuse.

Enabling IP Logging

SettingDescription
Enable IP LoggingTrack IP addresses for user actions
Log Login AttemptsRecord IPs during login
Log RegistrationRecord IPs during signup
Log Password ResetsTrack password reset requests

Viewing IP Logs

  1. Navigate to Reports > IP Logs
  2. View logged activities by IP address
  3. Filter by action type (login, register, etc.)
  4. Identify suspicious patterns

Blocking IP Addresses

  1. Navigate to Moderation > IP Access
  2. Click "Add IP"
  3. Enter the IP address to block
  4. Optionally add a reason/note
  5. Save

Blocked IPs will be denied access to the entire platform.

IP Blacklist Best Practices

Domain Filter

Navigate to Moderation > Domain Filter

The domain filter controls which URLs and links can be shared in chat messages, helping prevent spam and malicious links.

Filter Modes

ModeDescription
WhitelistOnly allow links from specified domains
BlacklistBlock links from specified domains
DisabledAllow all links

Configuring Domain Filter

  1. Navigate to Moderation > Domain Filter
  2. Choose filter mode (whitelist or blacklist)
  3. Add domains to the list
  4. Save changes

Adding Domains

Enter domains without http:// or www:

example.com trusted-site.org your-company.com

Only links from these domains will be allowed:

All other links will be blocked or stripped from messages.

Blacklist Mode

Links from these domains will be blocked:

All other links will be allowed.

Depending on configuration:

Additional Security Measures

Extra steps to further harden your ChatNet installation.