Security Configuration
v1.0.0
5 min read
6 views
Last updated: 11 hours ago
Security Configuration
Protect your marketplace from threats, spam, and abuse with proper security configuration.
Google reCAPTCHA Setup
Step 1: Create reCAPTCHA Keys
- Go to Google reCAPTCHA Admin
- Sign in with your Google account
- Fill in the registration form:
- Label: Enter "GigsRabbit" or your site name
- reCAPTCHA Type: Choose reCAPTCHA v2 > "I'm not a robot" Checkbox
- Domains: Add your domain(s):
yourdomain.com
www.yourdomain.com
- Add
localhost
for testing
- Accept Terms of Service
- Click Submit
Step 2: Copy Your Keys
After registration, you'll receive:
- Site Key:
6Lc...
(public key for frontend) - Secret Key:
6Lc...
(private key for backend)
Copy both keys - you'll need them in the next step.
Step 3: Configure in Admin Panel
- Go to
yourdomain.com/admin
- Navigate to Services > reCAPTCHA
- Enter your keys:
- Site Key: Paste your site key
- Secret Key: Paste your secret key
- reCAPTCHA Version: Select v2
- Click Save Changes
Step 4: Enable reCAPTCHA on Forms
- Go to Settings > Security
- Find reCAPTCHA Settings section
- Enable for:
- User Registration
- User Login
- Contact Forms
- Password Reset
- Support Tickets
- Click Save Changes
Step 5: Test reCAPTCHA
- Logout from admin panel
- Go to registration page
- Verify reCAPTCHA appears
- Test form submission
Security Settings Configuration
Step 1: Basic Security Settings
Navigate to Settings > Security and configure:
Session Security:
- Session Lifetime: 120 minutes (recommended)
- Session Timeout on Inactivity: 30 minutes
- Single Session per User: Enable (prevents multiple logins)
Password Requirements:
- Minimum Length: 8 characters
- Require Uppercase: Yes
- Require Numbers: Yes
- Require Special Characters: Yes
- Password History: 5 (prevents reusing last 5 passwords)
Login Security:
- Max Login Attempts: 5
- Lockout Duration: 15 minutes
- Show Login Attempts: Yes
- Email on Suspicious Login: Enable
Step 2: Two-Factor Authentication
Enable 2FA:
- Go to Settings > Security
- Find Two-Factor Authentication
- Set Enable 2FA to Yes
- Choose methods:
- Email OTP
- SMS OTP (requires SMS gateway)
- Google Authenticator
Step 3: IP Restrictions
Block Suspicious IPs:
- Go to Settings > Security > IP Management
- Add IPs to blocklist:
- Single IP:
192.168.1.1
- IP Range:
192.168.1.0/24
- Country blocking (if available)
- Single IP:
Whitelist Admin IPs:
- Add your office/home IP to whitelist
- Enable "Restrict Admin Access to Whitelist"
SSL Certificate Installation
Option 1: Let's Encrypt (Free SSL)
Via cPanel:
- Login to cPanel
- Go to SSL/TLS Status
- Select your domain
- Click AutoSSL
- Wait for installation (5-15 minutes)
Via SSH (Ubuntu/Debian):
# Install Certbot
sudo apt update
sudo apt install certbot python3-certbot-nginx
# Get certificate
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Follow prompts and enter email
Option 2: Purchased SSL
- Purchase SSL from provider (Namecheap, GoDaddy, etc.)
- Generate CSR in cPanel or server
- Validate domain ownership
- Download certificate files
- Install via cPanel or server panel
Step 3: Force HTTPS
- Go to Settings > Security
- Enable Force HTTPS
- Update
.htaccess
if needed:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Spam Protection
Configure Anti-Spam Measures
1. Rate Limiting:
- Go to Settings > Security > Rate Limiting
- Set limits:
- Registration: 3 per hour per IP
- Login: 10 per hour per IP
- Contact Form: 5 per hour per IP
- API Calls: 60 per minute
2. Content Filtering:
- Enable spam word filtering
- Add prohibited words list
- Set moderation rules
- Enable link restrictions
3. Email Verification:
- Require email verification for new users
- Block disposable email domains
- Verify email domain MX records
4. User Verification Levels:
- Email verified
- Phone verified (optional)
- ID verified (for sellers)
- Payment method verified
Backup Configuration
Automated Backups
1. Database Backup:
# Create backup script
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
mysqldump -u username -p'password' database_name > /backups/db_$DATE.sql
gzip /backups/db_$DATE.sql
# Delete backups older than 30 days
find /backups -name "*.sql.gz" -mtime +30 -delete
2. File Backup:
# Backup files
tar -czf /backups/files_$DATE.tar.gz /path/to/gigsrabbit --exclude=node_modules --exclude=vendor
3. Setup Cron Jobs:
# Daily database backup at 2 AM
0 2 * * * /path/to/backup_db.sh
# Weekly full backup on Sunday at 3 AM
0 3 * * 0 /path/to/backup_files.sh
Backup Storage
Recommended Solutions:
- Amazon S3: Reliable, affordable
- Google Cloud Storage: Good integration
- Dropbox: Simple setup
- External Server: Via SFTP/rsync
Security Monitoring
Activity Monitoring
Track Suspicious Activities:
- Go to Settings > Security > Activity Log
- Monitor:
- Failed login attempts
- Multiple account creation from same IP
- Rapid transactions
- Unusual API usage
- Mass messages/emails
Security Alerts
Configure Alerts:
- Go to Settings > Security > Alerts
- Enable notifications for:
- Admin login from new IP
- Multiple failed logins
- Large withdrawal requests
- Suspicious payment patterns
- Server resource alerts
Security Checklist
Regular Security Tasks:
- [ ] Weekly: Review activity logs
- [ ] Monthly: Check for updates
- [ ] Monthly: Review user permissions
- [ ] Quarterly: Security audit
- [ ] Quarterly: Update passwords
- [ ] Yearly: Penetration testing
Additional Security Measures
File Upload Security
- Restrict file types: Only allow safe formats
- Scan uploads: Use antivirus API
- Limit file size: Set reasonable limits
- Rename files: Use random names
- Store outside web root: When possible
Database Security
- Use prepared statements: Prevent SQL injection
- Encrypt sensitive data: Passwords, payment info
- Regular updates: Keep MySQL updated
- Restrict privileges: Minimal required permissions
- Change default ports: If possible
Server Hardening
- Disable unnecessary services
- Configure firewall rules
- Use SSH keys instead of passwords
- Regular security updates
- Monitor server logs
- Implement DDoS protection
Tags:
security
captcha
protection