Overview
We define trust boundaries, then enforce them with authentication, authorization and network rules.
Security events are logged so incidents can be reconstructed.
Trade-offs
- Friction vs protection
- Step-up checks only for sensitive actions keep everyday use smooth.
- Row-level vs app-level access
- Database policies are a second line that holds when app code has a bug.
Architecture
Users & internet
Controls at this boundary · typical examples
Public edge
- TLS everywhere
- Web application firewall
- Rate limiting
- DDoS protection
Illustrative diagram. For the end-to-end view, see the architecture on the Developers home.
Workflow
Threat model
What could go wrong.
What we design for
- Shared admin accounts
- Secrets in source code
- No audit trail
Row-level policy
create policy "own rows" on public.tickets
for select to authenticated
using (owner_id = auth.uid());