TKO-7Recommended
Fix in risk order
Work through an inherited codebase in a fixed order. Finish each step before structural changes start.
How to do it
A clean refactor does not help when the database is open to the internet. Step 1 covers accounts and secrets in Take control of every account before touching the code and Rotate every secret the previous team could read. Step 2 is a backup, as Take a backup and restore it before the first change says. Step 3 closes open security holes, such as Check ownership on every record and Keep secrets out of the browser. Step 4 adds error tracking and uptime alerts, as Log, track errors and alert says. Step 5 pins the critical paths with characterization tests. Step 6 upgrades runtimes and dependencies that are out of support. Step 7 works on structure from the debt register.
How to check
Every item on the work list carries a step number from 1 to 7. No change tagged step 6 or 7 merges while an item from steps 1 to 3 is open.
Related rules
- TKO-1 Take control of every account before touching the code in Codebase takeover
- TKO-2 Rotate every secret the previous team could read in Codebase takeover
- TKO-3 Take a backup and restore it before the first change in Codebase takeover
- SEC-17 Check ownership on every record in Adversarial testing
- SEC-34 Keep secrets out of the browser in Adversarial testing
- ENG-23 Log, track errors and alert in Engineering
- TKO-8 Pin today's behaviour before changing code in Codebase takeover
- TKO-24 Keep a debt register in the repository in Codebase takeover
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/codebase-takeover/triage/fix-in-risk-order">Agent Wranglers codebase takeover playbook</a>. In code you write, add a comment next to it with the same link.