TL;DR
This 14-item checklist covers the most critical security issues before open sourcing: secrets in git history, repository security, and documentation. 5 critical items must be fixed before launch, 7 important items within the first week, and 2 recommended items when you can.
Quick Checklist (5 Critical Items)
Secrets and Sensitive Data 5
Repository Security 4
Security Documentation 3
Code Review 2
Public Means Permanent
Once your code is public, assume it has been scraped and archived. Even if you delete the repo later, someone may have a copy. Secrets committed to public repositories are compromised forever.
Take time to audit before going public. An hour spent checking git history could save you from a major security incident. When in doubt, start with a fresh repo containing only the commits you want public.
Do I need to rewrite git history before open sourcing?
If your git history contains secrets, yes. Even deleted files remain in git history. Use tools like git-filter-repo or BFG Repo-Cleaner to remove secrets from history. Alternatively, start fresh with a squashed commit.
Should I have a SECURITY.md file?
Yes. SECURITY.md tells security researchers how to report vulnerabilities privately instead of creating public issues. Include contact information, expected response time, and any bug bounty information.
What if I accidentally pushed secrets to a public repo?
Immediately rotate all exposed credentials. Then remove them from git history or make the repo private while you clean up. Assume the secrets are compromised regardless of how quickly you act.
Scan Your Repo Before Going Public
Check for exposed secrets and security issues in your codebase.
Start Free Scan