9d43e4b113
CRITICAL — Authentication & Access: - TOTP MFA: otpauth-based, QR setup UI, sign-in flow integration, admin disable override, /account/security self-service page - Session Timeouts: 8h absolute (maxAge), 30min idle (updateAge) - Failed Auth Logging: Pino warn for invalid password/user/totp, info for successful login, audit entries for all auth events - Concurrent Session Limit: ActiveSession model, oldest-kick strategy, max 3 per user (configurable in SystemSettings) CRITICAL — HTTP Security: - HSTS: max-age=31536000; includeSubDomains - CSP: script/style/img/font/connect-src with Gemini/OpenAI whitelist - X-XSS-Protection: 0 (CSP replaces legacy) - Auth page cache: no-store, no-cache, must-revalidate - Rate Limiting: 100/15min general API, 5/15min auth (Map-based) Data Protection: - XSS Sanitization: DOMPurify on comment bodies - autocomplete="new-password" on all password/secret fields - SameSite=Strict on all cookies (Credentials-only, no OAuth) - File Upload Magic Bytes validation (PNG/JPEG/WebP/GIF/BMP/TIFF) Logging & Monitoring: - Login/Logout audit entries (Auth entityType) - External API call logging with timing (OpenAI, Gemini) - Input validation failure logging at warn level - Concurrent session tracking in ActiveSession table Documentation: - docs/security-architecture.md (11 sections) - docs/sdlc.md (CI pipeline, security gates, incident response) - .gitea/PULL_REQUEST_TEMPLATE.md (security checklist) Schema: User.totpSecret/totpEnabled, SystemSettings.sessionMaxAge/ sessionIdleTimeout/maxConcurrentSessions, ActiveSession model Tests: 310 engine + 37 staffing pass. TypeScript clean. Co-Authored-By: claude-flow <ruv@ruv.net>
42 lines
1.1 KiB
JSON
42 lines
1.1 KiB
JSON
{
|
|
"name": "@capakraken/api",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./src/index.ts",
|
|
"./router": "./src/router/index.ts",
|
|
"./trpc": "./src/trpc.ts",
|
|
"./sse": "./src/sse/event-bus.ts",
|
|
"./lib/reminder-scheduler": "./src/lib/reminder-scheduler.ts",
|
|
"./lib/logger": "./src/lib/logger.ts",
|
|
"./middleware/rate-limit": "./src/middleware/rate-limit.ts"
|
|
},
|
|
"scripts": {
|
|
"typecheck": "tsc --noEmit",
|
|
"test:unit": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@capakraken/application": "workspace:*",
|
|
"@capakraken/db": "workspace:*",
|
|
"@capakraken/engine": "workspace:*",
|
|
"@capakraken/shared": "workspace:*",
|
|
"@capakraken/staffing": "workspace:*",
|
|
"@node-rs/argon2": "^2.0.2",
|
|
"@trpc/server": "^11.0.0",
|
|
"@types/nodemailer": "^7.0.11",
|
|
"ioredis": "^5.10.0",
|
|
"nodemailer": "^8.0.1",
|
|
"openai": "^6.27.0",
|
|
"otpauth": "^9.5.0",
|
|
"pino": "^10.3.1",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"devDependencies": {
|
|
"@capakraken/tsconfig": "workspace:*",
|
|
"@types/node": "^22.10.2",
|
|
"typescript": "^5.6.3",
|
|
"vitest": "^2.1.8"
|
|
}
|
|
}
|