You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(backups): reject unknown consumer identities before maintenance - #427
Backup and restore maintenance previously treated an unreadable, empty or malformed process identity as a non-consumer. Require fresh, complete identity evidence before export or consumer restart; an identity that remains unknown after three bounded reads now fails closed.
Preserve the owned Valkey and verified retained-Caddy exceptions, restore-only web preservation, mixed-UID rejection and exited/disappeared-process handling. No new process or Rust service is introduced.
Related issue
Refs #426, item 1 only. Worker telemetry and PostgreSQL efficiency are handled separately, so this PR does not close the parent issue.
Type of change
Bug fix
Testing
New identity regression fails against the original supervisor with “empty identity was accepted as a non-consumer” and passes with the fix.
Isolated Linux/Bun 1.4.4: 12/12 backup-supervisor, fault-supervisor and maintenance-subprocess tests passed.
Real Linux process fixtures passed, including the owned Valkey exception and a detached surviving UID-10001 consumer.
Shell syntax and diff whitespace checks passed.
Independent source review found no actionable issue.
Fixtures also cover transient/finally unreadable identities, missing/malformed UID fields, bounded fresh-read retries, process disappearance, zombie/exited states, mixed credentials, restore preservation and exact retained-Caddy verification.
Commands already executed (replace with the isolated checkout's absolute path):
The first command uses a container-private tmpfs for test scratch files. Before the supervisor fix, running the new shell fixture against the original source exited 1 at the empty-identity regression; the corrected source passes.
Checklist
Relevant behavior and failure cases tested.
Existing ownership, maintenance and restore contracts preserved.
No secrets, production data, documentation files or screenshots added.
Related parent issue linked.
Breaking changes
Maintenance now stops explicitly when it cannot prove a surviving process safe, rather than proceeding with an unknown identity.
No actionable comments were generated in the recent review.
Walkthrough
The backup maintenance process scan now retries process status reads, validates UID evidence, and blocks when a surviving process identity remains unknown. Tests cover identity outcomes, retry behavior, exceptions, and retained Caddy ownership checks.
Changes: Backup consumer identity checks
Layer / File(s)
Summary
Read and classify process identity docker/production/backups/supervisor.sh, docker/production/tests/backups.sh
The identity check retries status reads up to three times, validates all four UID fields, and distinguishes consumer, safe or vanished, and unknown identities. Tests cover malformed or unavailable status data, fresh retry evidence, preserve-web, and exited processes.
Apply identity checks in consumer scan docker/production/backups/supervisor.sh, docker/production/tests/backups.sh
The scan fails if a surviving process identity is unknown. Tests cover that failure and verify the retained Caddy ownership check against the maintenance operation.
Backup maintenance now stops when it cannot prove a surviving process is safe, instead of skipping it. No merge-blocking issue was identified.
Security architecture risk: Minimal · up to 0b140
The change strengthens maintenance admission without granting additional authority. Persistent identity uncertainty now stops maintenance, while the existing ownership checks and shutdown paths remain in place. No material security risk introduced or worsened by this PR was identified.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The relevant failure scope is the production supervisor’s visible process namespace and managed services. Persistent identity uncertainty can stop those services rather than permit export or restart under uncertain quiescence; the changed gate grants no additional execution authority.
Security Findings and Attack Paths
inferred — The comparison closes the permissive identity-read-failure path at this checkpoint: a surviving process with persistently unreadable or malformed identity no longer passes as a non-consumer. No introduced or worsened attack path was identified in the inspected gate and lifecycle paths.
Trust Boundaries and Controls
observed — The retained-Caddy exception is bound to a root-controlled receipt, maintenance UUID, exact PID, and recorded process start ticks. Its identity helper also checks all credentials and the expected executable, with start-tick reads before and after inspection. Removing the unreadable-status skip makes this verifier load-bearing even when the scan cannot read Caddy’s status.
Resilience and Maintainability Implications
observed — Retries are bounded to three reads with at most two 0.1-second delays per uncertain entry. Waiting alone never admits the process: a fresh safe classification or disappearance is required, otherwise maintenance terminates through the established failure path.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the backup maintenance now rejects consumer process identities it cannot prove, instead of treating them as non-consumers. It follows the conventional commit format an…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the repository template. It states the problem and fix in the Summary, links Refs #426 with a clear scope note, marks Bug fix, and gives concrete testing commands and results. …
Full details: Title check
Explanation
The title names the main change: the backup maintenance now rejects consumer process identities it cannot prove, instead of treating them as non-consumers. It follows the conventional commit format and is specific enough for a reviewer scanning history. The summary and objectives both describe the same fail-closed behavior.
Full details: Description check
Explanation
The description follows the repository template. It states the problem and fix in the Summary, links Refs #426 with a clear scope note, marks Bug fix, and gives concrete testing commands and results. The Checklist and Breaking changes sections are filled in. Minor gaps: the Related issue uses "Refs" rather than "Fixes"/"Closes", which the author explains as partial scope, and the Checklist's "Existing tests pass" and "I updated documentation where necessary" items are not explicitly ticked. The content is still substantively complete.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 8ac0e3c and 0b1409f.
Files selected for processing: 2
docker/production/backups/supervisor.sh
docker/production/tests/backups.sh
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backup and restore maintenance previously treated an unreadable, empty or malformed process identity as a non-consumer. Require fresh, complete identity evidence before export or consumer restart; an identity that remains unknown after three bounded reads now fails closed.
Preserve the owned Valkey and verified retained-Caddy exceptions, restore-only web preservation, mixed-UID rejection and exited/disappeared-process handling. No new process or Rust service is introduced.
Related issue
Refs #426, item 1 only. Worker telemetry and PostgreSQL efficiency are handled separately, so this PR does not close the parent issue.
Type of change
Testing
Fixtures also cover transient/finally unreadable identities, missing/malformed UID fields, bounded fresh-read retries, process disappearance, zombie/exited states, mixed credentials, restore preservation and exact retained-Caddy verification.
Commands already executed (replace with the isolated checkout's absolute path):
The first command uses a container-private tmpfs for test scratch files. Before the supervisor fix, running the new shell fixture against the original source exited 1 at the empty-identity regression; the corrected source passes.
Checklist
Breaking changes
Maintenance now stops explicitly when it cannot prove a surviving process safe, rather than proceeding with an unknown identity.