Skip to content

Security: vilaswasnik/AIX-Lab-Simulation

Security

SECURITY.md

Security & Git Best Practices

βœ… Protected Files (via .gitignore)

The .gitignore file now protects sensitive data from being pushed to git:

πŸ”’ API Keys & Secrets

  • .env and .env.* files
  • *.key files
  • *.pem files
  • secrets.txt
  • api_keys.txt
  • Any *_secrets.* files

πŸ“¦ Compressed Archives

  • *.tar.gz
  • *.tgz
  • *.tar
  • *.zip
  • *.rar
  • *.7z

πŸ—‚οΈ Temporary & Cache Files

  • *.tmp, *.temp
  • *.log
  • /tmp/ directory
  • .bash_history
  • IDE files (.vscode/, .idea/)

πŸ›‘οΈ API Key Safety

βœ… DO:

# Store API key in environment variable
export OPENAI_API_KEY='your-key-here'

# Add to ~/.bashrc for persistence
echo 'export OPENAI_API_KEY="your-key"' >> ~/.bashrc

❌ DON'T:

  • Never commit API keys in code files
  • Don't store keys in plain text files in the repo
  • Avoid hardcoding keys in scripts

πŸ“‹ What's Protected

File Type Protected Reason
*.tar.gz βœ… Yes Archives excluded
.env βœ… Yes Contains secrets
*.key βœ… Yes Private keys
*.log βœ… Yes May contain sensitive data
.bash_history βœ… Yes May contain keys typed in terminal

πŸ” Check What's Tracked

# See what files are being tracked
git ls-files

# Check if sensitive files are tracked
git ls-files | grep -E '\.tar\.gz|\.env|\.key'

🚨 If You Accidentally Committed Secrets

1. Remove from Git History

# Remove specific file
git rm --cached filename

# Commit the removal
git commit -m "Remove sensitive file"

# Push changes
git push origin main

2. Rotate Your API Keys

If you pushed an API key:

  1. Go to OpenAI Platform
  2. Delete the exposed key
  3. Generate a new key
  4. Update your local environment

3. Clean Git History (Advanced)

# Use git filter-branch or BFG Repo-Cleaner
# This rewrites history - use with caution!

βœ… Verify Protection

# Try to add a protected file
touch test.tar.gz
git add test.tar.gz

# Should see: "The following paths are ignored..."
# This means .gitignore is working!

πŸ“š Additional Resources


Remember: The .gitignore file is now protecting your sensitive data! πŸ”’

There aren’t any published security advisories