Security best practices for `.env.vault` and `DOTENV_KEY`
masterCommitting .env.vault
DO commit your .env.vault file to your code repository. It contains AES-256 encrypted ciphertext and is safe to store.
DO NOT commit your .env files.
Handling a leaked DOTENV_KEY
If your DOTENV_KEY is leaked:
- If the attacker does not have your
.env.vaultfile: No immediate action is required, as they need both to access secrets. - If the attacker does have your
.env.vaultfile:- Immediately rotate secrets at your third-party providers.
- Rotate your
DOTENV_KEYusing therotatekeycommand. - Rebuild your
.env.vaultfile. - Redeploy.