Security Best Practices

Overview

This guide covers security best practices for using the Form Platform securely.

For Users

API Key Management

Key Security:

  • ✅ Rotate API keys regularly (every 90 days)

  • ✅ Use environment-specific keys

  • ✅ Never commit keys to version control

  • ✅ Store keys in environment variables

  • ✅ Delete unused keys immediately

  • ✅ Monitor key usage regularly

Key Rotation:

# 1. Create new key
curl -X POST /keys/secrets?environment=production

# 2. Update integrations with new key
# Update your code/config

# 3. Delete old key
curl -X DELETE /keys/secrets/{oldKeyId}

Environment Management

Best Practices:

  • ✅ Use separate environments for dev/staging/production

  • ✅ Never share API keys between environments

  • ✅ Test changes in development first

  • ✅ Use environment-specific publishable keys

Spam Protection

Enable Protection:

  • ✅ Enable honeypot fields

  • ✅ Configure reCAPTCHA for public forms

  • ✅ Set up custom spam rules

  • ✅ Monitor spam detection rates

Configuration:

PII Handling

Configure Policies:

  • ✅ Mark sensitive fields with pii: true

  • ✅ Use appropriate PII policies

  • ✅ Review PII handling regularly

  • ✅ Use encrypted or dropped for highly sensitive data

Example:

Rate Limiting

Monitor Usage:

  • ✅ Check quota regularly

  • ✅ Upgrade plan before hitting limits

  • ✅ Implement retry logic for 429 errors

  • ✅ Distribute load over time

For Developers

Code Security

Never Commit Secrets:

Environment Variables:

Input Validation

Always Validate:

  • ✅ Validate all user inputs

  • ✅ Use form schema validation

  • ✅ Sanitize user-provided data

  • ✅ Check field types and formats

Example:

Error Handling

Secure Error Messages:

  • ✅ Don't expose sensitive data in errors

  • ✅ Log errors securely

  • ✅ Handle errors gracefully

  • ✅ Don't leak internal details

Example:

Webhook Security

Verify Signatures:

  • ✅ Always verify webhook signatures

  • ✅ Use webhook secrets

  • ✅ Validate payload structure

  • ✅ Handle errors securely

Example:

CORS Configuration

Configure Allowed Origins:

  • ✅ Set specific allowed origins (not * for authenticated endpoints)

  • ✅ Use environment-specific origins

  • ✅ Review CORS settings regularly

Security Checklist

Setup

Configuration

Development

Monitoring

Common Mistakes

❌ Don't Do This

✅ Do This Instead

Next Steps

  • Security - Security overview

  • Data Protection - Encryption and PII

  • Rate Limiting - Rate limits and quotas

  • Compliance - Compliance and audit logging

Last updated