Skip to Content
📚 MyStoryFlow Docs — Your guide to preserving family stories
Security

Security & Privacy

MyStoryFlow takes security and privacy seriously. Family stories are deeply personal, and we’ve implemented comprehensive security measures to protect your data and ensure your privacy.

Security Overview

Core Security Principles

  • Privacy by Design - Privacy considerations built into every feature
  • Data Minimization - Collect only necessary data
  • Encryption Everywhere - Data encrypted in transit and at rest
  • Access Control - Granular permissions and family-only access
  • Transparency - Clear privacy policies and data handling practices

Compliance Standards

  • GDPR Compliant - European data protection regulations
  • CCPA Compliant - California consumer privacy act
  • SOC 2 Type II - Security and availability controls
  • ISO 27001 - Information security management

Authentication & Authorization

User Authentication

MyStoryFlow uses Supabase Auth for secure user authentication.

Supported Methods:

  • Email/Password - Traditional email-based authentication
  • Magic Links - Passwordless email authentication
  • Social Login - Google, Facebook, Apple sign-in
  • Multi-Factor Authentication - Optional 2FA for enhanced security

Security Features:

  • Password Requirements - Minimum 8 characters, complexity rules
  • Account Lockout - Protection against brute force attacks
  • Session Management - Secure JWT tokens with expiration
  • Password Reset - Secure password recovery process

Authorization Model

// Role-based access control interface UserRole { campaign_owner: { permissions: [ 'create_stories', 'edit_stories', 'delete_stories', 'invite_family', 'manage_settings', 'create_books', 'view_analytics', ] } family_contributor: { permissions: [ 'create_stories', 'edit_own_stories', 'comment_on_stories', 'upload_photos', ] } family_viewer: { permissions: ['view_stories', 'comment_on_stories'] } } ``` --> ### Family Access Control - **Campaign Ownership** - Only campaign creators can manage settings - **Invitation-Only** - Stories only accessible to invited family members - **Permission Levels** - Granular control over what family members can do - **Access Revocation** - Remove family member access instantly ## Data Protection ### Encryption **Data in Transit:** - **TLS 1.3** - All communications encrypted with latest TLS - **HSTS** - HTTP Strict Transport Security enforced - **Certificate Pinning** - Protection against man-in-the-middle attacks **Data at Rest:** - **AES-256** - Military-grade encryption for stored data - **Encrypted Backups** - All backups encrypted with separate keys - **Database Encryption** - PostgreSQL transparent data encryption - **File Storage Encryption** - Photos and audio files encrypted ### Key Management ```typescript // Encryption key hierarchy interface EncryptionKeys { master_key: { algorithm: 'AES-256-GCM' rotation_period: '90 days' storage: 'Hardware Security Module (HSM)' } data_encryption_keys: { algorithm: 'AES-256-GCM' per_campaign: true auto_rotation: true } file_encryption_keys: { algorithm: 'AES-256-GCM' per_file: true ephemeral: true } } ``` --> ### Data Anonymization - **Personal Identifiers** - Removed from analytics and logs - **IP Address Masking** - Last octet removed from stored IP addresses - **Pseudonymization** - Personal data replaced with pseudonyms for processing ## Privacy Controls ### Data Collection MyStoryFlow collects only the minimum data necessary to provide services: **Required Data:** - Email address (for account creation) - Stories and content you create - Photos you upload - Basic usage analytics **Optional Data:** - Name and profile information - Voice recordings - Family member contact information ### User Rights Under GDPR and CCPA, users have the following rights: **Right to Access:** ```bash # Request all personal data GET /api/user/data-export Authorization: Bearer {token} # Response includes: # - User profile data # - All campaigns and stories # - Photos and files # - Family member relationships ``` --> **Right to Rectification:** - Edit profile information - Update story content - Correct family member details **Right to Erasure (Right to be Forgotten):** ```bash # Delete user account and all data DELETE /api/user/account Authorization: Bearer {token} # Permanently removes: # - User profile # - All campaigns owned by user # - All stories created by user # - Uploaded photos and files ``` --> **Right to Data Portability:** ```bash # Export data in machine-readable format GET /api/user/data-export?format=json Authorization: Bearer {token} # Available formats: # - JSON (structured data) # - PDF (formatted stories) # - ZIP (includes all files) ``` --> ### Privacy Settings ```typescript interface PrivacySettings { data_sharing: { analytics: boolean // Anonymous usage analytics improvements: boolean // Product improvement insights marketing: boolean // Marketing communications } family_visibility: { profile_photo: 'family' | 'campaign' | 'private' activity_status: 'visible' | 'hidden' story_notifications: boolean } communication: { email_notifications: boolean family_updates: boolean product_updates: boolean } } ``` --> ## Infrastructure Security ### Cloud Security MyStoryFlow is hosted on secure cloud infrastructure: **Hosting Provider:** - **Vercel** - Edge network with global CDN - **Supabase** - Postgres database with built-in security - **AWS S3** - Encrypted file storage with access controls **Network Security:** - **DDoS Protection** - Automatic mitigation of attacks - **WAF (Web Application Firewall)** - Protection against common attacks - **Rate Limiting** - API endpoint protection - **IP Whitelisting** - Admin access restrictions ### Monitoring & Logging ```typescript // Security monitoring interface SecurityMonitoring { access_logs: { retention: '90 days' includes: ['IP', 'user_agent', 'endpoint', 'response_code'] excludes: ['personal_data', 'story_content'] } security_events: { failed_logins: 'alert after 5 attempts' suspicious_activity: 'immediate alert' data_access: 'audit trail maintained' } compliance_reporting: { gdpr_requests: 'tracked and reported' data_breaches: 'immediate notification' access_reviews: 'quarterly' } } ``` --> ### Backup & Recovery - **Automated Backups** - Daily encrypted backups - **Geographic Distribution** - Backups stored in multiple regions - **Point-in-Time Recovery** - Restore to any point in last 30 days - **Disaster Recovery** - RTO: 4 hours, RPO: 1 hour ## Application Security ### Input Validation & Sanitization ```typescript // Input validation example interface StoryValidation { title: { max_length: 200 required: true sanitize: 'html_escape' } content: { max_length: 50000 required: true sanitize: 'html_purify' allowed_tags: ['p', 'br', 'strong', 'em', 'ul', 'ol', 'li'] } photos: { max_count: 10 max_size: '5MB' allowed_types: ['image/jpeg', 'image/png', 'image/webp'] virus_scan: true } } ``` --> ### SQL Injection Prevention - **Parameterized Queries** - All database queries use parameters - **ORM Protection** - Supabase client prevents SQL injection - **Input Validation** - All user input validated and sanitized - **Least Privilege** - Database users have minimal required permissions ### Cross-Site Scripting (XSS) Prevention ```typescript // XSS protection measures const securityHeaders = { 'Content-Security-Policy': "default-src 'self'; script-src 'self' 'unsafe-inline'", 'X-Frame-Options': 'DENY', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Permissions-Policy': 'camera=(), microphone=(), geolocation=()', } ``` --> ### File Upload Security - **File Type Validation** - Only allowed file types accepted - **Size Limits** - Maximum file size enforced - **Virus Scanning** - All uploads scanned for malware - **Content Validation** - File headers verified - **Secure Storage** - Files stored with restricted access ## API Security ### Rate Limiting ```typescript // API rate limits const rateLimits = { authentication: '5 requests per minute', story_creation: '10 requests per minute', file_upload: '20 requests per hour', family_invites: '5 requests per hour', general_api: '100 requests per minute', } ``` --> ### API Key Management - **JWT Tokens** - Secure, stateless authentication tokens - **Token Expiration** - Automatic token expiry (24 hours) - **Refresh Tokens** - Secure token renewal process - **Token Revocation** - Immediate token invalidation on logout ### CORS Configuration ```typescript // Cross-Origin Resource Sharing const corsConfig = { origin: [ 'https://app.mystoryflow.com', 'https://mystoryflow.com', 'http://localhost:3000', // Development only ], credentials: true, methods: ['GET', 'POST', 'PUT', 'DELETE'], allowedHeaders: ['Content-Type', 'Authorization'], } ``` --> ## Incident Response ### Security Incident Response Plan 1. **Detection** - Automated monitoring and manual reporting 2. **Assessment** - Severity classification and impact analysis 3. **Containment** - Immediate steps to limit damage 4. **Investigation** - Root cause analysis and evidence collection 5. **Recovery** - System restoration and security improvements 6. **Communication** - User notification and regulatory reporting ### Data Breach Response ```typescript interface DataBreachResponse { immediate_actions: [ 'Contain the breach', 'Assess the scope', 'Preserve evidence', 'Notify security team', ] within_24_hours: [ 'Notify affected users', 'Report to authorities (if required)', 'Implement additional security measures', 'Begin forensic investigation', ] within_72_hours: [ 'Submit regulatory notifications', 'Provide detailed user communications', 'Implement long-term fixes', 'Conduct security review', ] } ``` --> ## Security Best Practices ### For Users - **Strong Passwords** - Use unique, complex passwords - **Enable 2FA** - Add multi-factor authentication - **Regular Reviews** - Review family member access periodically - **Secure Devices** - Keep devices updated and secure - **Report Issues** - Report suspicious activity immediately ### For Developers ```typescript // Secure coding practices const securityGuidelines = { authentication: 'Always verify user identity', authorization: 'Check permissions for every action', input_validation: 'Validate and sanitize all input', error_handling: 'Never expose sensitive information', logging: 'Log security events without personal data', dependencies: 'Keep all dependencies updated', secrets: 'Never commit secrets to version control', } ``` --> ### Environment Security ```bash # Environment variable security SUPABASE_KEY=sb_*** # Service role key (server-side only) SUPABASE_ANON_KEY=sb_*** # Anonymous key (client-side safe) JWT_SECRET=*** # Strong random secret ENCRYPTION_KEY=*** # AES-256 encryption key DATABASE_URL=*** # Connection string with SSL ``` --> ## Compliance & Auditing ### Regular Security Audits - **Quarterly Internal Audits** - Comprehensive security reviews - **Annual External Audits** - Third-party security assessments - **Penetration Testing** - Simulated attacks to identify vulnerabilities - **Code Security Reviews** - Static and dynamic analysis ### Compliance Monitoring ```typescript interface ComplianceChecks { gdpr_compliance: { data_processing_records: 'maintained' consent_management: 'documented' data_subject_rights: 'implemented' privacy_impact_assessments: 'completed' } security_standards: { access_controls: 'reviewed monthly' encryption_standards: 'verified quarterly' incident_procedures: 'tested annually' employee_training: 'completed annually' } } ``` --> ### Audit Trail - **User Actions** - All user actions logged (without personal data) - **System Access** - Administrator access tracked - **Data Changes** - Database changes audited - **Security Events** - All security-related events recorded ## Contact & Reporting ### Security Contact - **Email**: security@mystoryflow.com - **Response Time**: 24 hours for critical issues - **PGP Key**: Available on request for sensitive communications ### Vulnerability Reporting We welcome responsible disclosure of security vulnerabilities: 1. **Email**: security@mystoryflow.com with details 2. **Include**: Steps to reproduce, potential impact 3. **Response**: Acknowledgment within 24 hours 4. **Resolution**: Fix deployed within 30 days (critical issues: 7 days) ### Bug Bounty Program - **Scope**: All MyStoryFlow applications and APIs - **Rewards**: $100-$5000 based on severity - **Rules**: Responsible disclosure, no data access/modification --- ## Security Updates Stay informed about security updates: - **Security Newsletter**: Monthly security updates - **Status Page**: Real-time security status - **Release Notes**: Security fixes documented For more information about our security practices, contact our security team at security@mystoryflow.com.