Skip to content

Harden daemon: socket permissions, env safety, telemetry, rewrite locking#1029

Open
jwiegley wants to merge 1 commit intomainfrom
johnw/review-harden-daemon
Open

Harden daemon: socket permissions, env safety, telemetry, rewrite locking#1029
jwiegley wants to merge 1 commit intomainfrom
johnw/review-harden-daemon

Conversation

@jwiegley
Copy link
Copy Markdown
Collaborator

@jwiegley jwiegley commented Apr 9, 2026

  • Set umask(077) before creating control/trace sockets to prevent
    TOCTOU race with subsequent chmod
  • Set daemon directory permissions to 0700
  • Move env var sanitization before tokio runtime build to avoid
    unsafe env modification from worker threads
  • Track dropped telemetry envelopes and CAS records via atomic
    counters, expose in FamilyStatus
  • Make watermark update a confirmed operation via oneshot channel
  • Scope watermark pruning to the correct worktree prefix
  • Add file locking for rewrite log read-modify-write cycles

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@jwiegley jwiegley force-pushed the johnw/review-security-fixes branch from bbff7f0 to eb75b9b Compare April 9, 2026 17:28
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch 2 times, most recently from 79c693b to a0f2607 Compare April 9, 2026 20:13
@jwiegley jwiegley force-pushed the johnw/review-security-fixes branch from eb75b9b to 897edee Compare April 9, 2026 20:13
@svarlamov svarlamov force-pushed the johnw/review-security-fixes branch from 897edee to b43e12d Compare April 11, 2026 14:50
@svarlamov svarlamov force-pushed the johnw/review-harden-daemon branch from a0f2607 to 9b1e189 Compare April 11, 2026 14:51
@jwiegley jwiegley force-pushed the johnw/review-security-fixes branch from b43e12d to 86f70d0 Compare April 15, 2026 19:52
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch from 9b1e189 to a301b61 Compare April 15, 2026 19:52
@jwiegley jwiegley force-pushed the johnw/review-security-fixes branch from 86f70d0 to 7eaef28 Compare April 15, 2026 20:15
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch from a301b61 to 7a0c335 Compare April 15, 2026 20:15
@jwiegley jwiegley marked this pull request as ready for review April 15, 2026 21:46
@jwiegley jwiegley requested a review from svarlamov April 15, 2026 21:46
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@jwiegley jwiegley changed the base branch from johnw/review-security-fixes to graphite-base/1029 April 16, 2026 06:40
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch from 104cb2d to 499b585 Compare April 16, 2026 06:40
@graphite-app graphite-app bot changed the base branch from graphite-base/1029 to main April 16, 2026 06:41
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch from 499b585 to 2925d12 Compare April 16, 2026 06:41
…king

- Set umask(077) before creating control/trace sockets to prevent
  TOCTOU race with subsequent chmod
- Set daemon directory permissions to 0700
- Move env var sanitization before tokio runtime build to avoid
  unsafe env modification from worker threads
- Track dropped telemetry envelopes and CAS records via atomic
  counters, expose in FamilyStatus
- Make watermark update a confirmed operation via oneshot channel
- Scope watermark pruning to the correct worktree prefix
- Add file locking for rewrite log read-modify-write cycles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jwiegley jwiegley force-pushed the johnw/review-harden-daemon branch from 5d6eb94 to 474106c Compare April 16, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant