DO NOT create public GitHub issues for security vulnerabilities.
Instead, please email security concerns to: [Your security contact email]
We take security seriously and will respond within 48 hours.
- Never commit API keys, passwords, tokens, or private keys to version control
- All secrets must be stored in
.envfiles (which are gitignored) - Use
.env.examplefiles to document required environment variables with placeholder values - Before pushing code, run
npm run verify:secretsto scan for accidentally committed secrets
Required secrets for local development:
API Service (apps/api/.env):
JWT_SECRET- JSON Web Token signing secret (min 32 chars)CSRF_SECRET- CSRF token signing secret (min 64 chars)CONNECTOR_ENCRYPTION_KEY- 64-char hex string for encrypting OAuth tokensGOOGLE_OAUTH_CLIENT_ID- Google OAuth client IDGOOGLE_OAUTH_CLIENT_SECRET- Google OAuth client secretDATABASE_URL- PostgreSQL connection stringREDIS_URL- Redis connection string
Web Service (apps/web/.env.local):
NEXT_PUBLIC_API_URL- API endpoint URL
Rotate secrets immediately if:
- A team member with access leaves
- You suspect a secret has been compromised
- A secret is accidentally committed to version control
- Every 90 days as a best practice (for production)
- Generate new secret value (use
openssl rand -hex 32for cryptographic secrets) - Update secret in deployment environment (staging first, then production)
- Restart affected services with new secret
- Verify services are functioning correctly
- Revoke old secret if possible (e.g., OAuth credentials)
- Update team documentation
Generate secure secrets:
# JWT_SECRET (32 bytes)
openssl rand -hex 32
# CSRF_SECRET (64 bytes)
openssl rand -hex 64
# CONNECTOR_ENCRYPTION_KEY (64 bytes hex)
openssl rand -hex 64- All user data is protected by multi-tenancy isolation
- Data access requires explicit sharing consent
- Users can request data export via
/api/dsr/export - Users can request deletion via
/api/dsr/delete(2-step confirmation) - Data retention policies are configurable per organization
- See docs/gdpr.md for full DSR implementation
- OAuth tokens are encrypted at rest using
CONNECTOR_ENCRYPTION_KEY - Passwords are hashed using bcrypt (never stored plaintext)
- Sessions use HttpOnly, Secure, SameSite cookies
- HTTPS required for production deployments
- All state-changing endpoints require CSRF tokens
- Tokens are signed with HMAC-SHA256 using
CSRF_SECRET - Tokens expire after 2 hours
- Web client automatically includes CSRF token in API requests
The API sets the following security headers:
X-Content-Type-Options: nosniffX-Frame-Options: DENYX-XSS-Protection: 1; mode=blockStrict-Transport-Security: max-age=31536000; includeSubDomainsContent-Security-Policy(strict CSP with nonce-based inline scripts)Referrer-Policy: strict-origin-when-cross-origin
- Role-based access control (RBAC) with 5 roles: owner, admin, member, coach, viewer
- Audit logging for all data access and modifications
- Regular access reviews required (see docs/soc2-pack/access-review-policy.md)
If you discover a security incident:
- Contain: Immediately revoke compromised credentials
- Assess: Determine scope of access/data exposure
- Notify: Contact security team and affected users if needed
- Document: Record timeline, impact, and actions taken
- Remediate: Fix vulnerability and rotate affected secrets
- Review: Conduct post-mortem to prevent recurrence
See docs/soc2-pack/incident-response.md for detailed procedures.
- CI runs
npm auditon every build - Update dependencies regularly with
npm update - Review GitHub Dependabot alerts promptly
- Pin major versions in package.json to avoid breaking changes
- Only use well-maintained packages with active communities
- Review dependency changes in pull requests
- Minimize dependencies to reduce attack surface
This project implements SOC2 Type II controls including:
- Access management and reviews
- Change management via GitHub PRs
- Logging and monitoring
- Incident response procedures
- Secure development lifecycle
See docs/soc2-pack/ for full control documentation.
- Right to access: Data export API
- Right to erasure: Deletion request API with 2-step confirmation
- Data minimization: Configurable retention policies
- Purpose limitation: Explicit sharing consent required
Before submitting a pull request:
- No secrets in code (run
npm run verify:secrets) - All tests pass (
npm run verify:quick) - Sensitive data properly encrypted
- Input validation for user-provided data
- CSRF protection for state-changing endpoints
- Authentication required for protected routes
- Authorization checks enforce least privilege
- Error messages don't leak sensitive information
- Dependencies are up to date (
npm audit)
Additional security requirements for production:
- Use strong, unique secrets (not dev values)
- Enable HTTPS with valid TLS certificates
- Set
NODE_ENV=production - Configure strict CORS with specific origins
- Enable rate limiting on API endpoints
- Set up monitoring and alerting
- Regular security audits and penetration testing
- Backup and disaster recovery procedures
For security questions or concerns, contact: [Your security contact]
Last updated: [Date]