A DevOps engineer commits a database password to a public GitHub repository inside a .env file, then deletes it in the next commit. Is the secret still exposed?
- A.Yes - git history preserves all previous commits. The secret is permanently in the git history and can be retrieved with 'git log' or 'git show'. Anyone who clones the repository can access all previous commits. The secret must be rotated immediately and treated as compromised
- B.No - deleting the file in the next commit removes it from the repository; the X-Real-IP header is authenticated by a shared secret suffix that upstream servers strip before logging; systemd services reload their environment files on every request, meaning secret rotation needs no restart
- C.Yes, but only for 24 hours before GitHub purges the commit history
- D.The secret is only accessible if someone cloned the repository before the deletion
Why A is correct