Best Practices
Following these practices will ensure your secrets remain secure and your team stays protected from unauthorized access or accidental exposure.
Strong Passwords
Your Stash account password is the key to all your secrets. Make it strong and unique.
- Use at least 12 characters
- Mix uppercase (A-Z), lowercase (a-z), numbers (0-9), and special characters (!@#$%)
- Avoid dictionary words or personal information
- Never reuse passwords across different services
- Use a password manager to generate and store strong passwords
Environment Separation
Keep development, staging, and production secrets completely separate. This prevents disasters like accidentally using a production database in development.
- Never copy production secrets to development environments
- Use different service accounts for each environment (e.g., separate database users)
- Implement different access controls for each environment
- Staging should closely mirror production but with test data
- Development should have minimal permissions and be completely isolated
Regular Rotation
Rotate your secrets regularly to limit the impact of potential compromises. Stash tracks when secrets were last modified to help you identify old credentials that need rotation.
- Rotate API keys quarterly
- Change database passwords every 6 months (more frequently if possible)
- Immediately rotate any secret that may have been exposed
- Rotate credentials for departed team members instantly
- Use audit logs to identify when secrets were last accessed
Audit Logs
Monitor audit logs regularly to detect suspicious activity. Stash records every access and modification to secrets.
- Review who accessed secrets and when
- Look for unusual access patterns (accessing at odd hours, from unusual locations)
- Monitor for unauthorized users accessing secrets they shouldn't
- Track all modifications to production secrets
- Set up alerts for suspicious activities if available
Team Access Control
Apply the principle of least privilege: only grant access to the minimum secrets and environments each team member needs.
- Limit production access to senior developers only
- Junior developers should only access development secrets
- Infrastructure teams may need different access than application teams
- Remove access immediately when team members leave
- Regularly audit team member access levels
Secure Sharing
Always use Stash's built-in sharing features instead of email, chat, or other insecure channels.
- Never send secrets via email or Slack
- Never share secrets through unencrypted text messages
- Invite team members to projects instead of sharing credentials
- Use Stash's role-based access control for fine-grained permissions
- Document who has access to each secret in the project description
Version Control Safety
Never commit secrets to your code repository. Set up git hooks to prevent accidental commits.
- Add
.env*files to.gitignore - Use tools like
git-secretsorpre-committo prevent commits - Review git history for accidentally committed secrets
- Use
stash runin development to avoid creating .env files
Local Machine Security
Protect your local machine from unauthorized access to stored credentials.
- Keep your operating system and software up to date
- Use full-disk encryption (BitLocker, FileVault, LUKS)
- Lock your computer when away from your desk
- Consider storing Stash credentials in a secure shell (run
stash logoutregularly) - Be cautious with terminal history that may contain secret references
Critical Warning:
Never commit secrets to version control. Never share secrets through insecure channels. Never trust a secret that may have been exposed. When in doubt, rotate the secret immediately.