This project requires sensitive credentials including Telegram bot tokens and chat IDs. Follow these guidelines to keep your credentials secure:
-
Never commit secrets to version control
- Always keep your
.envfile local and never commit it to Git - The
.gitignorefile is configured to exclude.envand similar files - Double-check before committing that no secrets are included in your changes
- Always keep your
-
Use environment variables
- Store all sensitive configuration in the
.envfile - Use the provided
.env.exampleas a template - Never share your actual
.envfile with others
- Store all sensitive configuration in the
-
Rotate tokens if exposed
- If you accidentally commit or expose your Telegram bot token, rotate it immediately:
- Go to @BotFather on Telegram
- Use the
/mybotscommand - Select your bot
- Choose "Bot Settings" → "Regenerate Token"
- Update your
.envfile with the new token
- If your bot token is exposed in a Git repository, rotating the token is essential as the repository history will still contain the old token
- If you accidentally commit or expose your Telegram bot token, rotate it immediately:
-
State files and local data
- Files like
config_state.json,trades.json, and other state files may contain sensitive information - These files are automatically ignored by
.gitignore - Do not manually commit these files to version control
- Files like
If you discover a security vulnerability in this project, please report it by:
- Opening a GitHub issue with the "security" label (if it doesn't expose sensitive details)
- For sensitive vulnerabilities, contact the repository maintainer directly
- Regularly review your
.envfile to ensure all credentials are current - Use different bot tokens for development and production environments
- Limit access to your production
.envfile - Regularly check for dependency updates to address security vulnerabilities
- Only share your chat ID with trusted users who should have access to the bot
The bot includes security features:
- Single chat ID restriction to prevent unauthorized access
- Configuration stored locally in
.envand state files - No hardcoded credentials in the codebase
Always follow the security guidelines in this document to maintain the security of your bot deployment.