This document outlines the security measures implemented in the Void-basic project, particularly focusing on API key management and protection against accidental credential exposure.
- β
Automatic
.envexclusion: All.envfiles are automatically ignored by git - β GitHub secret scanning: Push protection prevents accidental key exposure
- β
Environment templates:
.env.exampleprovides safe configuration templates - β Pre-commit hooks: Additional validation before commits
- π Multiple provider support: xAI, OpenAI, Anthropic integration
- π Key rotation: Support for multiple API keys with fallback mechanisms
- π Environment isolation: Development and production key separation
- π Usage monitoring: Built-in tracking and alerting capabilities
-
Remove from Git History:
git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch .env' \ --prune-empty --tag-name-filter cat -- --all -
Regenerate Exposed Keys:
- xAI: Visit xAI Console to rotate keys
- OpenAI: Visit OpenAI Platform to regenerate
- Anthropic: Visit Anthropic Console to rotate keys
-
Update Local Environment:
# Update your .env file with new keys nano .env -
Force Push (if necessary):
git push origin --force
# Verify no secrets in git history
git log --all --full-history -- .env
# Check current git status
git status
# Verify .env is ignored
grep .env .gitignore- β
Never commit
.envfiles - Use.env.exampleas template - β Use different keys for development and production
- β Rotate keys regularly - Especially after team changes
- β Monitor API usage - Check provider dashboards regularly
- β Use environment variables - For production deployments
- β Test with placeholder keys before using real keys
- β Check git status before committing
- β Use pre-commit hooks for additional validation
- β Report security issues immediately to maintainers
- β
Use environment variables instead of
.envfiles - β Implement key rotation in CI/CD pipelines
- β Monitor for unusual usage patterns
- β Use least privilege - Only grant necessary permissions
# 1. Copy template
cp .env.example .env
# 2. Add your keys (replace with actual values)
XAI_API_KEY=xai-your-actual-key-here
OPENAI_API_KEY=sk-your-actual-key-here
ANTHROPIC_API_KEY=sk-ant-your-actual-key-here
# 3. Verify configuration
grep .env .gitignore
git status # Should not show .envThe project includes these security measures in .gitignore:
.env
.env.local
.env.*.local
- Secret Scanning: Automatically detects API keys in commits
- Push Protection: Blocks pushes containing detected secrets
- Branch Protection: Prevents force pushes to main branch
- Code Review: Requires review for security-sensitive changes
# Test environment setup
python test_model_integration.py
# Check for exposed secrets
git log --all --full-history -- .env
# Verify gitignore configuration
grep .env .gitignore
# Test API connectivity
python -c "
import os
keys = ['XAI_API_KEY', 'OPENAI_API_KEY', 'ANTHROPIC_API_KEY']
for key in keys:
value = os.getenv(key)
print(f'{key}: {\"SET\" if value else \"NOT SET\"}')
"-
.envfile exists locally but is not tracked by git -
.env.examplecontains all required variables with placeholders - API keys are valid and functional
- No secrets in git history
- GitHub secret scanning is enabled
- Pre-commit hooks are installed and working
- GitHub Issues: Use the Issues page
- Security Labels: Tag issues with
securitylabel - Private Reports: For sensitive issues, contact maintainers directly
- Repository Owner: Zykairotis
- Security Team: Contact through GitHub issues with
[SECURITY]prefix
- β OWASP Guidelines: Follows web application security best practices
- β GitHub Security: Implements GitHub's recommended security measures
- β API Security: Proper key management and rotation procedures
- β Environment Security: Secure handling of configuration and secrets
- π Commit History: All changes tracked and auditable
- π Issue Tracking: Security issues documented and resolved
- π Key Rotation: Log of key changes and rotations
- π Access Control: Repository permissions and access logs
This document is updated whenever:
- New security features are implemented
- Security incidents occur and lessons are learned
- Best practices evolve
- New API providers are integrated
Last Updated: January 5, 2025
Security Status: β
ACTIVE AND MONITORED
Next Review: Monthly security audit