Skip to main content

Security Best Practices

Learn how to secure your Cocobase applications and protect your users’ data.

API Key Security

Never Expose API Keys

Use Different Keys for Environments

  • Development: Use a separate API key for development
  • Staging: Use a separate API key for staging
  • Production: Use your production API key only in production

Rotate Keys Regularly

  1. Go to your Cocobase Dashboard
  2. Navigate to Settings > API Keys
  3. Click Generate New Key
  4. Update your applications with the new key
  5. Revoke the old key

Authentication Security

Strong Password Requirements

Secure Session Management

OAuth Security


Data Protection

Input Validation

Always validate user input before storing:

XSS Prevention

SQL Injection Prevention

Cocobase uses a NoSQL database and parameterized queries, but always validate filter inputs:

Access Control

Role-Based Permissions

Document-Level Security


Network Security

Use HTTPS Only

Cocobase API always uses HTTPS. Ensure your application also uses HTTPS:

CORS Configuration

Configure allowed origins in your Cocobase dashboard:
  1. Go to Settings > Security
  2. Add your domain to Allowed Origins
  3. Remove any wildcard (*) entries in production

Sensitive Data Handling

Never Store Sensitive Data in Plain Text

PII Protection

Data Encryption

For highly sensitive data, encrypt before storing:

Audit Logging

Track Important Actions

Monitor Suspicious Activity


Security Checklist

Before Going to Production

  • API keys stored in environment variables
  • HTTPS enabled for all endpoints
  • CORS configured with specific domains
  • Input validation on all user inputs
  • XSS protection in place
  • Role-based access control implemented
  • Audit logging enabled
  • Password requirements enforced
  • Session timeout configured
  • Sensitive data encrypted or not stored

Regular Security Reviews

  • Review API key usage monthly
  • Check audit logs for anomalies weekly
  • Update dependencies for security patches
  • Test authentication flows quarterly
  • Review access permissions quarterly

Reporting Security Issues

If you discover a security vulnerability in Cocobase:
  1. Do not disclose it publicly
  2. Email security@cocobase.cc with details
  3. Include steps to reproduce
  4. We’ll respond within 24 hours

Next Steps

Role-Based Access

Configure user roles and permissions

Authentication

Learn about authentication options

Best Practices

General development best practices

Troubleshooting

Debug common security issues