mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 04:57:00 +01:00
* feat(terminal): a plain shell on the builder, operator-only behind the PIN Sessions -> Plain shell opens a real bash login shell in a PTY the builder owns: no project, no agent, no inject wrapper. It is one more kind of session on the existing transport (open_shell command, peek-stream, the rawkey lane, tab-memory), not a second terminal. Security: operator account only (browser session, never a bearer token); a PIN must be set and the shell's own unlock (10 min idle, 60 max) entered; opens rate-limited and capped at 3 per builder; no queued command except open/close/peek may name a shell tab (queue, validator and injectPty); tenant and sealed builders never offer one; shell environment carries no engine keys. Every open/close/denied/unlock is on an append-only audit trail with no content. Threat model: docs/architecture/plain-shell.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE * test(terminal): keep the repo's gates true for the plain shell Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE * docs(plain-shell): name where provision-service.py lives Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE --------- Co-authored-by: Claude <noreply@anthropic.com>
14 lines
626 B
SQL
14 lines
626 B
SQL
CREATE TABLE "shell_audit_events" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"user_id" uuid NOT NULL,
|
|
"event" text NOT NULL,
|
|
"channel" text,
|
|
"tab" text,
|
|
"ip" text,
|
|
"user_agent" text,
|
|
"detail" jsonb,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "shell_audit_events" ADD CONSTRAINT "shell_audit_events_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
CREATE INDEX "idx_shell_audit_user_time" ON "shell_audit_events" USING btree ("user_id","created_at"); |