Prompt
I want a simple but secure way to store passwords, API keys, and certificates. What’s the best approach?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
The best simple-and-secure approach is:
Use a dedicated secrets manager, not plain files or environment variables alone
Good options:
- Cloud-native: AWS Secrets Manager, Azure Key Vault, Google Secret Manager
- Self-hosted: HashiCorp Vault
- Lightweight/local: OS keychain / credential manager, or an encrypted password manager for personal use
What to store there
- Passwords
- API keys / tokens
- Private keys and certificates
- Database credentials
- Any app secret you wouldn’t want in source control
Basic best-practice setup
- Encrypt secrets at rest
- The secrets manager should handle this automatically.
- Restrict access
- Give each app/user only the minimum permissions needed.
- Rotate secrets regularly
- Especially API keys, DB passwords, and certificates.
- Never hard-code secrets
- Don’t put them in code, git, tickets, or plaintext config files.
- Use short-lived credentials when possible
- Temporary tokens are safer than long-lived passwords.
- Audit access
- Keep logs of who accessed what and when.
- Protect backups
- Backups often leak secrets if not encrypted too.
For certificates specifically
- Store the private key in the secrets manager or hardware-backed storage
- Keep the public cert in normal config if needed
- Prefer automated certificate management/rotation where possible
If you want the simplest practical choice
- For a team or production app: use a cloud secrets manager
- For self-hosted infrastructure: use Vault
- For personal use: use a reputable password manager with file attachment/support for certs, plus encrypted backups
What to avoid
- Plaintext
.envfiles in shared folders - Secrets in source control
- Reusing the same secret everywhere
- “Security by obscurity” like hiding files without encryption
If you tell me your environment (personal, small team, AWS/Azure/GCP, self-hosted, etc.), I can recommend the simplest specific setup.