Security Hygiene and Secrets¶
What Not to Commit¶
Do not commit:
- API keys, tokens, passwords, private keys, or recovery codes.
.envfiles with real credentials.- Packet captures from sensitive networks.
- Client data, internal IP lists, or vulnerable target details.
- Malware samples or exploit code in a public repo.
Use .gitignore¶
Create ignore rules early:
.gitignore prevents untracked files from being added accidentally. It does not remove secrets already committed.
If a Secret Was Committed¶
- Revoke or rotate the secret immediately.
- Remove the secret from the current files.
- Decide whether history rewrite is needed.
- Notify anyone who may be affected.
- Add prevention rules and review the process.
Warning
Deleting a file in a later commit does not erase it from earlier Git history.