Repository navigation
initializer: require explicit trust before restoring persisted rules - #1243
csuzhangxc wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Superseded by #1245. The replacement preserves automatic current-version rule restoration without a new opt-in, retains filesystem safety checks, and supports reloader privilege reduction with existing initializer images. Verified actual saves, Prometheus reload, persistence and Pod rebuilds. |
Historical rule edits on the Prometheus PVC are restored automatically, including edits made before the API was authenticated. DM also leaves unrelated active rules behind on restart.
Install bundled rules on every current TiDB/DM initializer start and clear the dedicated active rules directory, including hidden leftovers. Skip persisted-rule restoration by default without deleting the PVC copy. Permit reviewed customizations only with
PROM_RESTORE_RULES=true; reject unknown names, symlink rule files/directories, invalid options and copy failures. This is an explicit administrator trust decision, not a cryptographic provenance claim.Compatibility: persisted custom rules no longer survive restart automatically.
cmd/PERSISTED_RULES.mddocuments backup/review/promtool validation and the existing Operatorspec.initializer.envsopt-in. Existing images and historical version snapshots are not rewritten. Rebuild and deploy the current initializer to obtain this protection.Validation:
go test -race ./cmd/monitoring.go ./cmd/dm_rules_test.go ./cmd/persisted_rules_test.go.