Add governance key rotation runbook and rehearsal (SEC-D10, #408) #979
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!979
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-408-governance-key-rotation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements SEC-D10 (#408) — the rotation cookbook + LocalTerra rehearsal that key custody (#398) forward-references. Implements backlog DEX-P2-026.
Stacked on !978 (#398) — branched from
issue-398-key-custody-roster. Merge !978 first; after that this MR shows only its own diff. (Both editlaunch-checklist.md+Makefile, so stacking avoids the cross-MR conflict.)New
docs/runbooks/governance-key-rotation.md:terrad tx wasm set-contract-admin, terrad v4.x) and factorygovernancepointer (UpdateConfig)New
scripts/rehearse-governance-key-rotation.sh— rehearses the wasm contract-admin round-trip (admin -> 2-of-3 multisig -> back, multisig-signed return) on LocalTerra and restores the original admin (EXIT/INT/TERM trap + self-healing re-run). Never touches the governance pointer; safe on a shared deploy.Wiring:
check_governance_key_rotation_docs.py,verify-issue-408.sh,AGENTS_GOVERNANCE_KEY_ROTATION.md, Makefile targets intolint+help; cross-links fromwasm-admin-migration.md+launch-checklist.md; DEX-P2-026 marked shipped.make verify-issue-408-> 5/5 incl. a live LocalTerra round-trip (real tx hashes, admin restored). Verified the issue's suggestedterrad tx wasm update-adminis outdated — terrad 4.0.1 usesset-contract-admin.mentioned in issue #408
Security review — MR !979
Commit reviewed:
afc5c92acb89a964e6a9ca48c73540cb978f5d31Scope: SEC-D10 governance key rotation runbook (
docs/runbooks/governance-key-rotation.md), LocalTerra rehearsal script (scripts/rehearse-governance-key-rotation.sh), doc-invariant checks, Makefile/launch-checklist wiring, and stacked SEC-B10 key-custody artifacts from !978.Method: Full MR diff review; traced attacker-controlled inputs in the rehearsal/verify scripts (
FACTORY_ADDRESSfromindexer/.env,--output, env overrides forTERRAD_NODE/CHAIN_ID/multisig names) to sinks (docker exec,set-contract-admin, transcript write). Compared multisig shell pattern to existingscripts/lib/terrad-multisig-tx.shandrehearse-governance-emergency-controls.sh.Outcome:
FINDINGS: 0medium+Security review: no medium+ findings on this diff.
Notes (informational, below reporting threshold):
governancepointer. Admin round-trip is guarded by pre-checks, EXIT/INT/TERM trap +restore_admin, and stranded-multisig self-healing — operational safety for shared dev deploys, not an external exploit path.set_admin_from_msiginterpolates env/deploy values into adocker exec sh -cheredoc (same structural pattern as the existing emergency multisig lib). Values are bech32 addresses or operator-controlled env with safe defaults; no path from untrusted remote input to script execution.Inline threads: none (zero medium+ findings).
mentioned in commit
d5f277e85d