You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: ashlessscythe/staff-stack
Security
docs/security.md
StaffStack — Security
Goals
Tenant isolation: no cross-tenant data reads/writes.
RBAC: least privilege; server-side enforcement for every mutation and sensitive query.
OWASP-aligned mitigations for common web risks.
Authentication
Argon2id password hashing for credentials provider.
Auth.js session cookies: HttpOnly, Secure in production, SameSite=Lax (tighten where appropriate).
Authorization
Central assertPermission(ctx, permission, { siteId? }) used by Server Actions and API routes.
Permission matrix (excerpt): see product spec; implement full matrix in src/lib/rbac.ts and tests.
Tenant isolation
Repository pattern: all queries include where: { tenantId: ctx.tenantId }.
CI grep / tests to catch raw queries without tenant scope where applicable.
Headers (middleware)
HSTS (production), X-Frame-Options / frame-ancestors via CSP, Referrer-Policy, baseline CSP (tighten iteratively for inline needs).
CSRF / XSS
SameSite cookies + Auth.js for session mutations.
React escaping by default; sanitize any future rich text.
Prisma parameterized queries only (no string-concat SQL).