Exercise 07: Secret Prevention¶
Goal¶
Prevent unsafe files from entering a repository.
Tasks¶
- Create a
.gitignore. - Add patterns for
.env,*.key,*.pem,*.pcap, andevidence/. - Create example files that match those patterns.
- Run
git status. - Confirm ignored files do not appear as untracked changes.
Reflection¶
- What should you do if a token was already committed?
- Why is
.gitignorenot enough after a leak?