Skip to main content

Security Best Practices

Recommendations for securing your Lordbase databases and API access.


Credential Management

PracticeDescription
Use environment variablesNever hardcode passwords or tokens in source code
Rotate credentialsPeriodically reset database user passwords
Least privilegeGrant minimum required permissions to database users
One credential per serviceUse separate database users for each application

Database User Security

Permission Levels

  • Use Read Only for analytics, reporting, and dashboards
  • Use Read/Write for application services that modify data
  • Use Admin only for migration scripts and trusted admin tools

Password Management

  • Reset passwords immediately if a credential is compromised
  • Use strong, auto-generated passwords (Lordbase generates these by default)
  • Never share admin credentials with team members — create individual accounts

Developer Access Token Security

PracticeDescription
Set expiration datesUse expires_in_days when creating tokens
Use minimum scopesOnly grant the permissions your automation needs
Revoke immediatelyRevoke tokens when no longer needed or if compromised
Never commit to gitAdd tokens to .gitignore and use CI/CD secret management
Monitor usageReview last_used_at and last_used_ip regularly

Network Security

PracticeDescription
Always use SSLConnect with sslmode=require for production databases
Use PgBouncerConnect via port 6432 for pooled, isolated connections
Limit connectionsSet appropriate max_connections for your plan

Workspace Security

PracticeDescription
Separate environmentsUse different workspaces for dev, staging, and production
Review membershipRegularly audit who has access to each workspace
Remove inactive membersRevoke access for former team members
Use descriptive namesClearly label workspaces to avoid accidental operations

Backup Security

PracticeDescription
Regular backupsConfigure scheduled backups for all production databases
Test restoresPeriodically verify that backups can be restored successfully
Monitor failuresSet up alerts for failed backup schedules
Retention policiesBalance data safety with storage optimization

Monitoring & Auditing

  • Enable and regularly review Audit Logs for all databases
  • Monitor slow queries and optimize them proactively
  • Track cache hit ratio — target above 95%
  • Review active connections to detect unusual patterns

Next Steps