// RULES
Microservice rules
Best practices for microservices, one rule per page: why it matters, how to apply it and an example. They are grouped into checklists you can apply to a service.
6 rules of 70 · Clear filters
Security
- Callers are rate limited
Each caller has a request quota, enforced at the gateway or in the service, so one client cannot exhaust it for everyone.
MediumChecked by hand
- Dependencies and images are scanned for known vulnerabilities
Every build checks libraries and the base image against vulnerability databases, and someone owns fixing what is found.
MediumChecked by hand
- Scopes or permissions are declared
The service lists the scopes or permissions its API checks, so callers know what to ask for and reviewers know what is protected.
MediumChecked automatically
- Secrets can be rotated without a release
Every secret the service uses can be replaced on a schedule, or within the hour after a leak, without a code change.
MediumChecked by hand
- Sensitive actions leave an audit trail
The service records who did what to what, and when, for actions that matter in a dispute or an investigation.
MediumChecked by hand
- The database account has only the rights it needs
The service connects to its data store with an account limited to its own schema and to the operations it performs.
MediumChecked by hand