Skip to content

Security: Junaid-sadiq/multinode-gitops-cluster

Security

SECURITY.md

Security Guidelines

πŸ”’ Sensitive Files (Never Commit!)

The following files contain sensitive information and are protected by .gitignore:

Credentials

  • .argocd-credentials - Argo CD login credentials
  • terraform/terraform.tfvars - OpenStack API credentials
  • .env files - Environment variables

SSH Keys

  • terraform/cpouta_key.pem - Auto-generated SSH private key
  • Any *.pem or *.key files

Terraform State

  • terraform/*.tfstate - Contains resource IDs and sensitive data
  • terraform/*.tfstate.backup - Backup of state files

βœ… Verification

Before committing to Git, verify sensitive files are ignored:

# Check if sensitive files are tracked
git status

# Verify .gitignore is working
git check-ignore .argocd-credentials
git check-ignore terraform/cpouta_key.pem
git check-ignore terraform/terraform.tfvars

All three commands should return the filename if properly ignored.

πŸ›‘οΈ Security Best Practices

1. Credential Rotation

After deployment, consider:

  • Changing the Argo CD admin password
  • Rotating OpenStack API credentials periodically

2. SSH Key Management

  • The SSH key cpouta_key.pem is auto-generated by Terraform
  • Keep it secure and don't share it
  • Use -i flag when SSHing: ssh -i terraform/cpouta_key.pem ubuntu@<IP>

3. Infrastructure Security

  • Security groups restrict access by IP (0.0.0.0/0 by default)
  • Consider restricting to your IP range for production
  • Update terraform/network_and_secgroups.tf to limit access

4. Argo CD Security

  • Change the default admin password after first login
  • Use RBAC to create limited users
  • Enable SSO if available

5. Git Repository

  • Never force-add ignored files: git add -f <file> ❌
  • Review files before committing: git diff --staged
  • Use .gitignore consistently across environments

🚨 If You Accidentally Commit Secrets

  1. Don't just delete and recommit - secrets remain in Git history
  2. Remove from history:
    git filter-branch --force --index-filter \
      "git rm --cached --ignore-unmatch <FILE>" \
      --prune-empty --tag-name-filter cat -- --all
  3. Rotate the compromised credentials immediately
  4. Force push (if remote exists): git push --force --all

πŸ“‹ Pre-Commit Checklist

Before committing:

  • .gitignore exists in root
  • No *.pem or *.key files staged
  • No terraform.tfvars staged
  • No .argocd-credentials staged
  • No *.tfstate files staged
  • Run git status to verify

πŸ” Files Safe to Commit

These files are safe and should be committed:

  • βœ… terraform/*.tf files (except *.tfvars)
  • βœ… deploy-k8s-cluster.ps1
  • βœ… README.md, QUICKSTART.md, SECURITY.md
  • βœ… .gitignore
  • βœ… ansible-reference-backup/*.yml (playbooks only)

πŸ“ž Security Contacts

If you discover a security issue:

  1. Rotate affected credentials immediately
  2. Update the relevant services
  3. Review access logs for suspicious activity

There aren't any published security advisories