Security Rulebook¶
Last updated: 2026-02-22
This rulebook defines mandatory security workflow for this repository.
1. Core Principles¶
- Stop the line on security risks.
- Secrets never belong in tracked files.
- Tracked app manifests must reference secrets by name, not value.
- Run security checks before pushing.
- Treat any leak as a formal incident.
2. Non-Negotiable Rules¶
- Never commit:
- tokens, API keys, kubeconfigs, or private keys
- machine-specific credentials and runtime secrets
- local files like
.k3s-node-token,kubeconfig-raw.yml,terraform/terraform.tfvars - Keep tracked app manifests secret-free (no plaintext
stringDatavalues). - Use placeholders in docs and examples:
CHANGE_ME_*${ENV_VAR}- Required local checks before push:
pre-commit run --all-filesbash -n scripts/*.shpython3 scripts/security_scrub.py --no-history
3. Standard Workflow¶
Before coding¶
- Pull latest
main. - Confirm no secret-bearing local files are staged.
- Use placeholders for new secret fields in manifests/docs.
During coding¶
- Keep credentials in local password manager or local-only files.
- Do not place real values in
stringDatain tracked manifests.
Before commit¶
git status
pre-commit run --all-files
bash -n scripts/*.sh
python3 scripts/security_scrub.py --no-history
Before push¶
After push¶
- Confirm CI
.github/workflows/ci.ymlpassed. - If any leak is found, start incident handling immediately.
4. Security Incident Playbook¶
Trigger conditions¶
- Secret/token/key appears in tracked content.
security_scrub.pyreports high-severity findings.- Sensitive local file is committed by mistake.
Immediate response¶
- Freeze pushes and merges on affected branch.
- Revoke or rotate exposed credentials immediately.
- Remove leaked content from current branch.
- Re-run local checks.
If history is affected¶
- Create safety tag:
- Rewrite with
git-filter-repousing: --replace-textfor leaked literals--invert-pathsfor files that should never be tracked- Verify removal:
- Force-push rewritten refs:
- Notify collaborators to re-clone or hard reset.
Collaborator recovery¶
5. Documentation Rules¶
- Keep
SECURITY.mdand this rulebook aligned. - Never include realistic secrets in docs or examples.
- Replace exposed values with
REDACTED_*markers. - Update docs in the same PR as security-sensitive changes.