EVID-DGC implements multiple security layers:
- Database Row Level Security (RLS)
- Password hashing with salt
- Rate limiting on API endpoints
- Input validation and sanitization
- CORS protection
- Audit logging for all actions
- Minimum 6 characters (configurable)
- Stored using bcrypt (via bcryptjs) with salt and configurable work factor
- No plaintext password storage
- Password verification via bcrypt-based comparison
- Wallet address validation (0x + 40 hex chars)
- No private key access or storage
- Client-side signature verification
- Network validation (Polygon)
- User sessions tracked in database
- Session timeout configurable
- Activity logging for all logins
- Failed login attempt tracking
// Authentication endpoints: 5 requests/15 minutes
// General API: 100 requests/15 minutes
// Admin endpoints: 50 requests/15 minutes
// Export endpoints: 100 requests/hour- Wallet address format validation
- Email format validation
- File type and size validation
- SQL injection prevention via parameterized queries
- XSS prevention via input sanitization
// Development: localhost:3000, 127.0.0.1:3000
// Production: blockchain-evidence.onrender.com
// Credentials: true for authenticated requestsAll tables have RLS enabled with policies:
- Users can view active users only
- Evidence access based on role permissions
- Admin actions logged and restricted
- Service role has full access for API operations
- Passwords hashed with bcrypt (via bcryptjs) with salt and configurable work factor
- Sensitive data encrypted at rest (Supabase)
- HTTPS for all data in transit
- Database connections encrypted
All actions logged in activity_logs table:
- User authentication events
- Evidence upload/download
- Admin actions
- Role changes
- System access attempts
// Allowed file types
('application/pdf',
'image/jpeg',
'image/png',
'image/gif',
'video/mp4',
'video/avi',
'video/mov',
'audio/mp3',
'audio/wav',
'audio/m4a',
'application/msword',
'text/plain',
'application/zip');
// Size limits: 100MB per file
// Virus scanning: Not implemented (add if needed)- SHA-256 hash generation for all files
- Hash verification on download
- Watermarking for downloaded files
- Chain of custody tracking
- Files processed through Multer middleware
- Temporary storage during processing
- Metadata stored in database
- Access controlled by user roles
- public_viewer: Read-only access to public data
- investigator: Create cases, upload evidence
- forensic_analyst: Analyze evidence, generate reports
- legal_professional: Legal review access
- court_official: Court proceeding management
- evidence_manager: Evidence lifecycle management
- auditor: System audit and compliance access
- admin: Full system access
Action | Public | Investigator | Analyst | Legal | Court | Manager | Auditor | Admin
View Cases | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
Create Cases | ✗ | ✓ | ✗ | ✓ | ✓ | ✗ | ✗ | ✓
Upload Evidence | ✗ | ✓ | ✓ | ✗ | ✗ | ✓ | ✗ | ✓
Download Evidence | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓
Manage Users | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓
View Audit Logs | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✓
- All database queries use parameterized statements
- Supabase client handles query sanitization
- No dynamic SQL construction
- Input validation before database operations
- Input sanitization on all user inputs
- Output encoding in frontend
- Content Security Policy headers (recommended)
- No innerHTML usage with user data
- CORS configuration restricts origins
- State-changing operations require authentication
- No cookies used for authentication
- API-based architecture reduces CSRF risk
- File type validation by MIME type
- File size limits enforced
- No executable file uploads allowed
- Files processed in isolated environment
All security events logged:
-- Activity logs table tracks:
- User login/logout events
- Failed authentication attempts
- Evidence access and modifications
- Admin actions and user management
- System configuration changes- Generic error messages to prevent information disclosure
- Detailed errors logged server-side only
- Rate limiting prevents brute force attacks
- Failed attempts tracked and monitored
- All environment variables secured
- Database RLS policies tested
- Rate limiting configured
- CORS origins restricted
- HTTPS enabled
- Error handling implemented
- Audit logging enabled
- File upload validation working
- Password hashing verified
- Admin access restricted
- Review audit logs weekly
- Update dependencies monthly
- Security scan quarterly
- Backup verification monthly
- Access review quarterly
- Incident response plan updated
- Detection: Monitor logs and alerts
- Assessment: Determine severity and impact
- Containment: Disable affected accounts/features
- Investigation: Analyze logs and determine cause
- Eradication: Fix vulnerability and clean up
- Recovery: Restore normal operations
- Lessons Learned: Update procedures and training
- System Administrator: admin@evid-dgc.com
- Technical Support: DGC2MHNE@proton.me
- Security Issues: Report via GitHub issues
- Never commit secrets to version control
- Use environment variables for configuration
- Validate all inputs before processing
- Log security events appropriately
- Follow principle of least privilege
- Keep dependencies updated
- Use HTTPS for all communications
- Use strong, unique passwords
- Keep MetaMask extension updated
- Never share private keys or passwords
- Log out when finished
- Report suspicious activity immediately
- Use secure networks for access
- Regularly review user access
- Monitor audit logs for anomalies
- Keep system updated with security patches
- Backup data regularly and test restores
- Document all security procedures
- Train users on security best practices