.envfiles- API keys or secrets
- Private keys or certificates
- Database passwords
- Any sensitive configuration
.env.examplefiles with placeholder values- Documentation about required environment variables
- Security guidelines (like this file)
All examples in this repository require the following environment variables:
XERO_CLIENT_ID=your-xero-client-id-here
XERO_CLIENT_SECRET=your-xero-client-secret-hereChoose one of the following:
OpenAI (for OpenAI examples):
OPENAI_API_KEY=sk-your-openai-api-key-hereGoogle AI Studio (for Google ADK examples):
GOOGLE_API_KEY=your-google-ai-studio-api-key-hereGoogle Vertex AI (alternative for Google ADK):
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=us-central1
GOOGLE_GENAI_USE_VERTEXAI=TRUE- Copy
.env.exampleto.envin each project directory - Fill in your actual credentials in
.env - Never commit
.envfiles to version control
- Rotate API keys regularly (every 3-6 months)
- Immediately rotate if you suspect exposure
- Use different keys for development vs production
- Always check
git statusbefore committing - Use
git diff --cachedto review staged changes - Consider using git hooks to prevent credential commits
# β
GOOD: Copy example and fill with real values
cp .env.example .env
# Edit .env with your credentials
# β
GOOD: Check what you're committing
git status
git diff --cached
# β BAD: Never do this
git add .env- Go to Xero Developer Portal
- Create a new app or use existing one
- Get your Client ID and Client Secret
- Configure redirect URI if needed
- Go to OpenAI Platform
- Navigate to API Keys section
- Create a new secret key
- Copy and store securely
- Go to Google AI Studio
- Create a new API key
- Copy and store securely
-
Revoke the exposed credentials immediately
- Xero: Regenerate Client Secret in developer portal
- OpenAI: Delete the exposed API key, create new one
- Google: Disable the exposed key, create new one
-
Remove from public repositories
- Delete the repository if possible
- Use git history rewriting tools (BFG Repo-Cleaner)
- Contact platform support for cache removal
-
Monitor for abuse
- Check usage logs for unauthorized activity
- Monitor billing for unexpected charges
- Review access logs
- Use this SECURITY.md as a checklist
- Set up git hooks to prevent credential commits
- Use environment variable managers
- Regular security audits of repositories
Before pushing to any repository:
- No
.envfiles are being committed - All
.env.examplefiles have placeholder values only - No hardcoded API keys in source code
- No private keys or certificates included
-
.gitignoreproperly excludes sensitive files - README includes security setup instructions
Remember: It's easier to prevent credential exposure than to clean it up afterward!