This document outlines the security measures taken before publishing Containarium to a public repository.
Created .gitignore with comprehensive exclusions:
- ✅ Terraform state files (
*.tfstate,*.tfstate.*) - ✅ Terraform variable files (
*.tfvars) - ✅ Terraform cache (
.terraform/) - ✅ Environment files (
.env,.env.*) - ✅ Credentials (
*.pem,*.key,credentials.json) - ✅ SSH keys (
id_rsa*) - ✅ Build artifacts (
bin/,*.exe) - ✅ Logs and reports (
*.log,*-report.txt)
Removed from git tracking:
- ✅
terraform/gce/terraform.tfstate(contained instance IPs, project IDs) - ✅
terraform/gce/terraform.tfvars(contained SSH keys, project ID, user IP)
Command used:
git rm --cached terraform/gce/terraform.tfstate terraform/gce/terraform.tfvarsCreated terraform/gce/terraform.tfvars.example:
- ✅ Contains placeholder values only
- ✅ No real project IDs, SSH keys, or IP addresses
- ✅ Documented for users to copy and customize
Verified no hardcoded secrets in:
- ✅ Go source code files
- ✅ Terraform configuration files
- ✅ Shell scripts
- ✅ Documentation files
Environment variables used instead:
GCP_PROJECT- For GCP project ID (in tests)- Users must provide their own:
- Project ID in
terraform.tfvars - SSH keys in
terraform.tfvars - Allowed IP addresses in
terraform.tfvars
- Project ID in
Run these commands to verify no sensitive data will be pushed:
# 1. Check git status
git status
# 2. Verify .gitignore is working
git status --ignored
# 3. Search for potential secrets in tracked files
git grep -i "<your-gcp-project>" -- ':!*.md' ':!SECURITY-CHECKLIST.md'
git grep -E "ssh-(rsa|ed25519) AAAA" -- ':!terraform/gce/terraform.tfvars.example'
git grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" -- ':!*.md' ':!SECURITY-CHECKLIST.md'
# 4. Check for accidentally staged files
git diff --cached --name-only | grep -E "(tfstate|tfvars|\.env|\.key|\.pem)"
# 5. Verify terraform.tfvars is ignored
ls terraform/gce/terraform.tfvars 2>/dev/null && echo "⚠️ WARNING: terraform.tfvars still exists (should be in .gitignore)" || echo "✅ terraform.tfvars not in working directory"Safe to commit:
- ✅
.gitignore - ✅
terraform/gce/terraform.tfvars.example - ✅ All Go source code
- ✅ All Terraform
.tffiles - ✅ Documentation files
- ✅ Shell scripts (startup scripts)
- ✅ Makefile
- ✅ README.md
DO NOT commit:
- ❌
terraform/gce/terraform.tfvars(personal config) - ❌
terraform/gce/terraform.tfstate*(state files) - ❌
terraform/gce/.terraform/(provider cache) - ❌
bin/(compiled binaries) - ❌ Any files with real credentials, IPs, or keys
Document for users to follow after cloning:
cd terraform/gce
cp terraform.tfvars.example terraform.tfvars
vim terraform.tfvarsRequired changes:
project_id = "your-gcp-project-id" # Your GCP project
admin_ssh_keys = {
admin = "ssh-ed25519 AAAA... your-email@example.com" # Your SSH public key
}
# Get your IP: curl ifconfig.me
allowed_ssh_sources = ["YOUR.IP.ADDRESS/32"] # Your IP, not 0.0.0.0/0!# For E2E tests
export GCP_PROJECT=your-gcp-project-id
# For local development (if needed)
export CONTAINARIUM_ENV=development# Authenticate with GCP
gcloud auth login
gcloud auth application-default login
# Set default project
gcloud config set project your-gcp-project-id- Never commit
terraform.tfvars- Always in.gitignore - Use narrow IP ranges - Don't use
0.0.0.0/0forallowed_ssh_sources - Rotate SSH keys regularly - Update
admin_ssh_keysperiodically - Enable MFA on GCP - Require multi-factor authentication
- Use service accounts - For CI/CD, create dedicated service accounts
- Review Terraform plan - Always run
terraform planbeforeapply - Enable audit logging - Monitor all infrastructure changes
- Never commit secrets - Use environment variables
- No hardcoded IPs - Use Terraform outputs and variables
- No real emails - Use
user@example.comin examples - Review diffs - Check
git diffbefore committing - Use pre-commit hooks - Install secret scanning tools
| File | Sensitive Data | Status |
|---|---|---|
terraform/gce/terraform.tfvars |
SSH keys, project ID, IP address | ✅ Removed |
terraform/gce/terraform.tfstate |
Instance IPs, project ID, resource IDs | ✅ Removed |
terraform/gce/terraform.tfstate.backup |
Previous state data | ✅ Never committed |
- ❌ GCP Project IDs (except in examples as placeholders)
- ❌ SSH Public/Private Keys (except in examples as placeholders)
- ❌ IP Addresses (except in examples as placeholders)
- ❌ Instance IPs and Resource IDs
- ❌ Email addresses (except in documentation as examples)
- ❌ Authentication tokens or credentials
- Run all verification commands above
- Confirm
.gitignoreis committed - Confirm
terraform.tfvars.exampleexists and has placeholders only - Confirm
terraform.tfvarsis NOT in git (git ls-files | grep tfvarsshould show only examples) - Confirm
terraform.tfstateis NOT in git - Review
git log --statto ensure no sensitive files in history - Test that repository builds without secrets:
make build - Update README.md with current architecture (completed ✅)
- Create release notes if applicable
After making the repository public:
- Monitor Issues - Watch for security reports
- Enable GitHub Security Features:
- Dependabot alerts
- Secret scanning
- Code scanning (CodeQL)
- Add SECURITY.md - Describe security policy
- Tag Release - Create v1.0.0 tag when ready
- Documentation - Ensure all docs are up to date
For security issues, please email: [your-security-email@example.com]