Skip to content

Security: emartai/remembr

Security

docs/security.md

Security Hardening Checklist

This checklist captures the MVP pre-launch hardening steps and links to automated validations where possible.

1) Secrets hygiene

  • No secrets committed in source.
  • Enforced via pre-commit scanning and CI checks.

Recommended local run:

pre-commit run --all-files

2) Protected endpoint auth verification

  • Automated test ensures protected /api/v1 routes reject unauthenticated calls.
  • Public exceptions are explicitly documented (/health, /auth/register, /auth/login, /auth/refresh, /auth/logout).

Run:

cd server
pytest tests/test_security_authz.py -v

3) RLS verification

  • RLS behavior is covered by existing tests (org-scope isolation and context propagation).

Run:

cd server
pytest tests/test_rls.py -v
pytest tests/test_context_integration.py -v

4) PII logging audit

  • Log statements avoid plaintext secrets (API keys, passwords, tokens).
  • Structured logging via Loguru enabled; avoid logging user payload bodies directly.

Recommended periodic audit:

rg "logger\.(debug|info|warning|error|exception)" server/app -n

5) CORS hardening

  • CORS origins are configurable from environment (cors_origins) instead of fixed code constants.
  • Local default remains permissive only when explicit origins are not set.

6) Rate limiting

  • Redis-backed rate limiting is enabled via SlowAPI.
  • Default global limit per API key/token is configurable.
  • Memory search has a stricter dedicated limit.
  • 429 responses include rate-limit headers and retry guidance.
  • Health endpoint is exempt.

7) Connection pool controls

  • Postgres async pool tuned for production defaults.
  • Redis pool max_connections=20 is configured.
  • Pool exhaustion timeout warnings are logged.

There aren’t any published security advisories