Skip to content

feat(gate): systemd socket activation + daemon client + protocol test + runbook updates#8

Merged
mdheller merged 8 commits intomainfrom
feat/gate-systemd-socket-20260419
Apr 20, 2026
Merged

feat(gate): systemd socket activation + daemon client + protocol test + runbook updates#8
mdheller merged 8 commits intomainfrom
feat/gate-systemd-socket-20260419

Conversation

@mdheller
Copy link
Copy Markdown
Member

Follow-on to merged PR #7. Adds host-grade operationalization for the egress gate.

  1. systemd units
  • systemd/sourceos-gate-egress.socket
  • systemd/sourceos-gate-egress.service
  1. daemon socket activation
  • src/sourceos_gate/daemon.py now supports systemd socket activation via LISTEN_FDS.
  1. daemon client
  • tools/sourceos_gate_egressctl.py: unix-socket client for health/snapshot/grant/prune/apply/verify.
  1. tests
  • tests/test_gate_daemon.py: protocol smoke test (health + snapshot).
  1. docs
  • docs/TRUTH_PLANE_RUNBOOK.md updated to document daemon mode, egressctl, and systemd units.

Security posture preserved:

  • unix socket only (no TCP)
  • auth via socket filesystem permissions
  • explicit allowlist set mutation only
  • audit remains append-only

@mdheller
Copy link
Copy Markdown
Member Author

@copilot fix failed checks and any conflicts

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

@copilot fix failed checks and any conflicts

Addressed in 06fad20: fixed the failing markdownlint check (MD032 in docs/RELEASES.md) and verified there are no merge conflicts with main (merge-base is current origin/main, no conflict markers).

@mdheller mdheller merged commit ff46ac8 into main Apr 20, 2026
2 checks passed
Copy link
Copy Markdown
Member Author

Update pushed: systemd correctness + packaging-lane primitives.

  • Removed bogus Environment=LISTEN_PID=%p (systemd sets LISTEN_PID/LISTEN_FDS).
  • Added RuntimeDirectory=sourceos + RuntimeDirectoryMode=0755 and RestrictAddressFamilies=AF_UNIX AF_NETLINK to the service.
  • Added DirectoryMode=0755 to the socket unit.
  • Added systemd/sysusers.d/sourceos.conf to ensure the sourceos group exists.
  • Added systemd/tmpfiles.d/sourceos.conf to ensure /run/sourceos and /var/lib/sourceos/... dirs exist.

This keeps auth on filesystem perms and keeps the daemon unix-socket-only.

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.

2 participants