Keep secrets out of git: store values elsewhere and commit only templates
The author argues that code repositories are a poor place for secrets, since they get copied to clones, mirrors and tools indefinitely. Their approach keeps real values in a self-hosted password manager, with repos holding only placeholder example files that list required variable names. Real values are written to the target machine at deploy time and never committed, and scripts contain no fallback defaults. Safeguards include checking staged changes, ignoring the real environment file from the first commit, and running a pre-commit secret scanner. If a secret is committed, the author stresses that it must be rotated at its source, since deleting it from later commits leaves it exposed in history.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in