You must add .secrets to your .gitignore file immediately when initializing a project.
Your future self—and your security team—will thank you. Have a story about a .secrets leak that almost ruined your weekend? Share it in the comments below. Let's learn from our collective scars. .secrets
# Install pre-commit pre-commit install If you must share a .secrets file via email or cloud storage, use GPG (GNU Privacy Guard) or age encryption. Do not use password-protected ZIP files (they are trivial to crack). Rule 5: The .secrets.template Pattern Instead of committing a real .secrets file, commit a .secrets.template file. You must add
If you take only one thing away from this article, remember this: Share it in the comments below
In the future, you won't have a file at all. Your application will ask the cloud provider: "Who am I?" The cloud says: "You are EC2 instance i-1234." The application then gets a short-lived token (valid for 1 hour) from the vault. No static .secrets file exists anywhere.