Skip to content

JITSU-260: enforce connector images and supervise isolated sync shutdown - #1602

Merged
sahiltyagi-jitsu merged 2 commits into
newjitsufrom
fix/jitsu-260-sync-pod-isolation
Nov 17, 2026
Merged

sahiltyagi-jitsu merged 2 commits into
newjitsufrom
fix/jitsu-260-sync-pod-isolation

Conversation

@sahiltyagi-jitsu

@sahiltyagi-jitsu sahiltyagi-jitsu commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

JITSU-260 (T2), part of JITSU-250.

Connector Pods retain unconditional process isolation from the merged security fix. This change adds image enforcement in syncctl and an optional, per-sync supervisor that shortens the time a connector can continue after lease loss.

Behavior

  • shareProcessNamespace: false remains unconditional. There is no isolation-disable flag and no cross-container PID 1 signaling.
  • SYNCCTL_SYNC_ALLOWED_IMAGE_PREFIXES checks manual spec/check/discover/read before creating a Pod or Secret, and checks scheduled syncs during CronJob reconciliation. Empty preserves compatibility. Disallowed scheduled syncs lose their CronJob; inventory required images before enabling enforcement.
  • SYNCCTL_SYNC_FAST_SHUTDOWN_IDS selects exact comma-separated sync IDs for canary rollout; empty keeps existing controller cleanup, and * enables supervision for all connector tasks. This setting never changes isolation.
  • For selected syncs, lease loss creates /shared/terminate and the source supervisor exits promptly, terminating that container's PID namespace. Ordinary SIGTERM/SIGINT is forwarded to the connector entrypoint and the supervisor waits for graceful exit; kubelet retains the configured termination deadline.
  • The sidecar always exits nonzero on lease loss, preserving controller cleanup if the marker write fails or the watcher is disrupted. Marker creation is exclusive: existing files, symlinks and FIFOs cannot cause truncation, target creation, or a blocking open.
  • Connector exit codes are preserved. Shell PID/command substitutions are escaped against Kubernetes command expansion.

Validation

  • go test -short ./sync-controller ./sync-sidecar passes.
  • Six opt-in Docker tests pass with Alpine and Debian shells, isolated PID namespaces, and a non-root UID: normal completion, lease loss with a TERM-ignoring connector, and graceful SIGTERM cleanup.
  • Subprocess tests verify sidecar exit 1 for normal marker creation, missing parent directory, disabled supervision, pre-existing marker, symlink, dangling symlink and FIFO; symlink targets remain untouched.
  • Fake Kubernetes client tests verify rejected manual tasks create no resources, disallowed CronJobs are removed, allowed schedules are restored, and canary selection updates existing templates.
  • Local security/correctness review found and fixed unsafe marker creation; the correction was independently verified before final review.

Rollout and limits

Deployment remains manual. First publish updated syncctl/sidecar and update the sidecar image while fast-shutdown IDs remain empty. Review the image inventory before enabling the allowlist. Then enable fast shutdown for one disposable test sync, validate a real connector through completion/cancellation/lease takeover, and expand the selected IDs before using *.

See ISOLATION_ROLLOUT.md for inventory commands, rollout, rollback and tests. Existing Pods are not retrofitted. Clearing the fast-shutdown list rolls back supervision while keeping isolation. Connector entrypoints must forward graceful termination to subprocesses.

This revision has not been deployed or validated through a complete real Airbyte sync/Kubernetes lease takeover. The shared marker is coordination, not a hostile-code boundary; controller cleanup remains necessary.

@sahiltyagi-jitsu
sahiltyagi-jitsu marked this pull request as ready for review October 27, 2026 07:42
jitsu-code-review[bot]
jitsu-code-review Bot previously approved these changes Oct 27, 2026

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 5515f9b9408f7d3a4cd640a8037dd11001622463

Reviewed the entire diff; no high-confidence defects found. Controller tests and the new sidecar sentinel test passed. The full sidecar suite was stopped during lengthy existing timeout tests.

@absorbb
absorbb force-pushed the fix/jitsu-260-sync-pod-isolation branch from 5515f9b to db5999d Compare October 30, 2026 15:55
@absorbb absorbb changed the title JITSU-260: connector image allowlist and opt-in sync Pod process isolation JITSU-260: enforce connector images and supervise isolated sync shutdown Oct 30, 2026

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of db5999d91782e35172f90481efba1336263a1422

Reviewed the full diff and relevant callers. No high-confidence actionable defects found. Short Go tests passed for sync-controller and sync-sidecar; opt-in Docker tests were not run.

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of db5999d91782e35172f90481efba1336263a1422

Reviewed the full supplied diff and relevant callers and configuration. No high-confidence actionable defects found. Focused Go tests and signed-request checks passed.

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 4b1c5a8103a4644e0086cf957925cadddb6dc9a4

Reviewed the full diff and relevant callers. No high-confidence defects found. Short Go tests passed for sync-controller and sync-sidecar; shell lifecycle checks passed with the system shell and BusyBox.

@sahiltyagi-jitsu
sahiltyagi-jitsu merged commit e071269 into newjitsu Nov 17, 2026
17 checks passed
@sahiltyagi-jitsu
sahiltyagi-jitsu deleted the fix/jitsu-260-sync-pod-isolation branch November 17, 2026 16:24
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