Skip to content

Security: MatthewJamisonJS/discord_audio_archive_bot

Security

SECURITY.md

Security Policy

πŸ”’ Our Commitment to Security

The Discord Audio Archive Bot handles sensitive data including Discord tokens, email credentials, and voice recordings. We take security seriously and are committed to protecting users and their data.

πŸ“‹ Supported Versions

Version Supported
0.1.x βœ…

🚨 Reporting Security Vulnerabilities

DO NOT create public issues for security vulnerabilities.

If you discover a security vulnerability, please follow responsible disclosure:

  1. Email: Send details to the project maintainers via GitHub Issues (mark as security vulnerability)
  2. Include:
    • Description of the vulnerability
    • Steps to reproduce
    • Potential impact assessment
    • Suggested fix (if known)
  3. Timeline: Allow 90 days for response and fix before public disclosure

What NOT to report as security issues:

  • Questions about configuration
  • Feature requests
  • Non-security bugs
  • Issues requiring physical access to the host machine

πŸ›‘οΈ Security Features

Built-in Protections

  • Environment Variable Isolation: All credentials stored in .env files
  • Input Validation: Discord user IDs and email addresses validated
  • Error Sanitization: No credentials exposed in logs or error messages
  • File Path Restrictions: Audio files saved to controlled directories only
  • SMTP Security: TLS/SSL encryption for email communications

Access Controls

  • Administrator Commands: Recording controls require Discord admin permissions
  • Token Scope: Bot tokens should have minimal required permissions
  • Email Authentication: App passwords recommended over regular passwords

⚑ Security Best Practices

For Developers

  • Never commit .env files or credentials
  • Use virtual environments for dependency isolation
  • Regularly update dependencies: pip install -r requirements.txt --upgrade
  • Review logs for suspicious activity
  • Monitor Discord API usage and rate limits

For Operators

  • Bot Permissions: Grant only necessary Discord permissions:
    • Connect (to join voice channels)
    • Speak (for voice activity)
    • Use Voice Activity (for recording)
    • Read Message History (for commands)
  • Email Security: Use Gmail App Passwords, not regular passwords
  • System Security: Run bot in isolated environment or container
  • Network Security: Restrict outbound connections if possible

For Users

  • Only invite the bot to servers you trust
  • Understand that voice communications will be recorded
  • Verify bot permissions before granting access
  • Report suspicious bot behavior immediately

πŸ” Security Checklist

Before deploying:

  • All credentials stored in .env file
  • .env file added to .gitignore
  • Bot has minimal Discord permissions
  • Email uses App Password authentication
  • FFmpeg installed from trusted source
  • Log files secured and rotated
  • Network access restricted if possible
  • Regular dependency updates scheduled

🚨 Incident Response

If you suspect a security incident:

  1. Immediate Actions:

    • Disable the bot (Ctrl+C or process termination)
    • Rotate Discord bot token
    • Change email passwords
    • Review recent logs for suspicious activity
  2. Assessment:

    • Determine scope of potential breach
    • Check for unauthorized recordings
    • Verify email account security
    • Review Discord server audit logs
  3. Recovery:

    • Apply security updates
    • Reconfigure with new credentials
    • Monitor for continued suspicious activity
    • Document incident for future prevention

πŸ”§ Security Configuration

Discord Bot Setup

# Create bot with minimal permissions
# In Discord Developer Portal:
# - Scopes: bot
# - Bot Permissions: Connect, Speak, Use Voice Activity
# - Never share bot token publicly

Email Security

# Gmail App Password Setup:
# 1. Enable 2FA on Gmail account
# 2. Generate App Password at myaccount.google.com/apppasswords
# 3. Use App Password in EMAIL_PASSWORD, not regular password

Environment Variables

# Secure .env configuration
DISCORD_TOKEN=your_bot_token_here          # Never share
TARGET_USER_ID=123456789012345678          # Specific user only
EMAIL_ADDRESS=your_secure_email@gmail.com  # Dedicated email recommended
EMAIL_PASSWORD=your_app_password_here      # App password only
RECIPIENT_EMAIL=recordings@yourdomain.com  # Secure recipient

πŸ”— Security Resources

🏷️ Security Labels

When reporting issues, use these labels:

  • security - General security concerns
  • vulnerability - Potential security vulnerabilities
  • credentials - Credential-related issues
  • privacy - Privacy and data protection issues

πŸ“ž Contact

For security-related questions (non-vulnerabilities):

  • Open a GitHub Discussion
  • Tag with security label
  • Follow the issue template

Remember: This bot records voice communications. Ensure proper consent and compliance with local laws regarding recording and data retention.


This security policy is reviewed quarterly and updated as needed. Last updated: [Current Date]

There aren’t any published security advisories