Skip to content

Security: RidgetopAi/shelldo

Security

SECURITY.md

Security Policy

Security Best Practices

This document outlines the security measures implemented in Shelldo and best practices for deployment.

Environment Variables Security

⚠️ NEVER commit these files:

  • .env - Contains actual secrets and keys
  • .env.local
  • .env.production.local
  • Any files with real OAuth secrets

✅ Always commit:

  • .env.example - Template with placeholder values

OAuth Security

Google OAuth

  • Client ID: Safe to be public (already in frontend)
  • Client Secret: Must be kept secure, never commit to Git
  • Redirect URIs are restricted in Google Console

GitHub OAuth

  • Client ID: Safe to be public
  • Client Secret: Must be kept secure, never commit to Git
  • Callback URLs are restricted in GitHub settings

Database Security

  • Uses Prisma ORM to prevent SQL injection
  • Prepared statements for all queries
  • Foreign key constraints enforced
  • Audit logging for all user actions

Authentication Security

  • JWT tokens with secure secrets
  • Session-based authentication with NextAuth.js
  • Rate limiting: 100 requests/hour per user
  • Secure cookie settings in production

API Security

  • Rate limiting on all endpoints
  • Input validation with Zod schemas
  • CORS protection
  • Security headers (HSTS, CSP, etc.)

Production Security Checklist

Before Deployment:

  • Change all default secrets in .env
  • Use complex, randomly generated secrets
  • Enable HTTPS in production
  • Set NODE_ENV=production
  • Configure proper CORS origins
  • Set up database connection pooling
  • Enable Redis for production caching
  • Configure monitoring and logging
  • Set up error tracking (Sentry)
  • Enable rate limiting
  • Configure security headers

Secrets Management:

# Generate secure secrets
openssl rand -base64 32  # For JWT_SECRET
openssl rand -base64 32  # For NEXTAUTH_SECRET

Security Headers (configured in next.config.js):

  • X-Frame-Options: DENY
  • X-Content-Type-Options: nosniff
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: camera=(), microphone=(), geolocation=()

Reporting Security Issues

If you discover a security vulnerability, please report it to:

Please do NOT:

  • Create public GitHub issues for security vulnerabilities
  • Disclose vulnerabilities publicly before they are fixed

Security Features

Implemented Protections:

  1. Input Validation: All user inputs validated with Zod
  2. SQL Injection Protection: Prisma ORM with prepared statements
  3. XSS Protection: React's built-in XSS protection + CSP headers
  4. CSRF Protection: NextAuth.js built-in CSRF protection
  5. Rate Limiting: Redis-based rate limiting
  6. Audit Logging: All user actions logged
  7. Secure Sessions: JWT with secure httpOnly cookies
  8. OAuth Security: Proper OAuth 2.0 implementation

Monitoring:

  • Failed login attempts tracking
  • Rate limit breach detection
  • Unusual activity patterns
  • Database query monitoring
  • Error rate monitoring

Compliance

Data Protection:

  • GDPR compliant user data handling
  • Right to deletion implemented
  • Data export functionality
  • Privacy policy compliance

Security Standards:

  • OWASP Top 10 protections implemented
  • Regular security dependency updates
  • Automated vulnerability scanning in CI/CD

Emergency Response

In case of security breach:

  1. Immediate: Rotate all secrets and API keys
  2. Assess: Determine scope of potential data exposure
  3. Notify: Inform affected users if personal data involved
  4. Document: Log incident for future prevention
  5. Patch: Fix vulnerability and deploy immediately

Contact Information:


Security is everyone's responsibility. Report issues promptly and follow secure coding practices.

There aren’t any published security advisories