Skip to main content

Hardened Podman container runner with gate server and shield integration

Project description

terok-sandbox

terok-sandbox

PyPI License: Apache-2.0 REUSE status Quality Gate Status

The hardened-Podman runtime — terok-sandbox launches per-task containers with a credential vault, a gated git server.

terok ecosystem — terok-sandbox sits between the per-task launcher and the firewall it installs

What it provides

  • Hardened container lifecycle — rootless Podman containers.
  • Credential vault — long-lived secrets stay in an encrypted database on the host. The container receives short-lived phantom tokens and do not see the real credentials
  • Per-task git gate — a token-authenticated HTTP mirror of an arbitrary upstream git repository. Tasks clone and push through the gate, and the operator forwards to upstream after review.
  • Shield firewall — installs the terok-shield OCI hooks at setup time and drives the firewall at runtime.
  • Clearance install — wires the desktop notifier daemon terok-clearance onto blocked outbound connections, so the operator can authorise destinations live.
  • Setup as one call — idempotent sandbox_setup() installs the OCI hooks; sandbox_uninstall() uninstalls.

Where it sits in the stack

terok-sandbox is the boundary layer. Above it, single-task callers (terok-executor) and multi-task orchestrators (terok) treat the sandbox as a black-box "give me a hardened container." Below it, it composes terok-shield for egress filtering and terok-clearance for the operator-in-the-loop verdict path.

Public API

from terok_sandbox import (
    # Lifecycle
    Sandbox, SandboxConfig, RunSpec, VolumeSpec, Sharing,
    # Runtime backends
    PodmanRuntime, NullRuntime, ContainerRuntime,
    # Vault
    VaultManager, CredentialDB, SSHManager,
    start_vault, stop_vault, ensure_vault_reachable,
    # Gate
    GateServerManager, TokenStore, GitGate,
    start_daemon, stop_daemon, create_token,
    # Shield adapter
    ShieldState, make_shield,
    # Setup / teardown
    sandbox_setup, sandbox_uninstall, needs_setup,
)

The full export list lives in src/terok_sandbox/__init__.py.

CLI

Command Purpose
terok-sandbox setup Install hooks, vault, gate, notifier; idempotent
terok-sandbox uninstall Reverse of setup
terok-sandbox doctor Run health checks against installed services
terok-sandbox vault … Vault management subcommands
terok-sandbox gate … Gate management subcommands
terok-sandbox shield … Shield install / status / direct control
terok-sandbox ssh … Per-container SSH key provisioning

Requirements

  • Linux with Podman (rootless, ≥ 5.6 recommended)
  • systemd user session — optional; backs the systemd-creds vault passphrase tier (gate / vault / clearance run inside the per-container supervisor, no systemd units)
  • nftables (nft binary) — provided by terok-shield's runtime
  • D-Bus session bus — for the clearance notifier path; the system degrades gracefully when D-Bus is absent
  • Python 3.12+

Installation

pip install terok-sandbox

For most users this dependency is pulled in transitively by terok-executor or terok. Install it directly only when building a custom orchestrator on top of the sandbox API.

License

Apache-2.0 — see LICENSES/Apache-2.0.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terok_sandbox-0.3.1.tar.gz (254.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terok_sandbox-0.3.1-py3-none-any.whl (305.9 kB view details)

Uploaded Python 3

File details

Details for the file terok_sandbox-0.3.1.tar.gz.

File metadata

  • Download URL: terok_sandbox-0.3.1.tar.gz
  • Upload date:
  • Size: 254.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for terok_sandbox-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1b55652a2b8bef7660f5fd66416719528b555a3fabab9a729f8cc36e9244df74
MD5 efc090a8123db4a0485256b976c8e735
BLAKE2b-256 0ffae899021f1c84747be1aa17f8f0fdacb5b640cd9f19e6eaccc671e4a6cb3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for terok_sandbox-0.3.1.tar.gz:

Publisher: release.yml on terok-ai/terok-sandbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terok_sandbox-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: terok_sandbox-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 305.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for terok_sandbox-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df18ad21af47e0743c9600d01e02236b2cc590cfe07a9624a8da07615302a60e
MD5 ff84e8a089ad8b3b645a8d369ab3dcb5
BLAKE2b-256 c75253e0213cce6a85094e4f6330781730543db889db320d8d4d99217780f6f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for terok_sandbox-0.3.1-py3-none-any.whl:

Publisher: release.yml on terok-ai/terok-sandbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page