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, and an egress firewall.

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 never sees 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 gate forwards to upstream automatically (online mode) or after operator review (gatekeeping mode).
  • Shield firewall — installs the terok-shield OCI hooks at setup time and drives the firewall at runtime.
  • Clearance in-supervisor — each container's supervisor hosts the terok-clearance hub, verdict server, and desktop notifier, so the operator can authorise blocked outbound connections live.
  • Setup as one call — idempotent terok-sandbox setup installs the shield + supervisor OCI hooks and provisions the encrypted credentials DB; terok-sandbox uninstall reverses it.

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, KrunRuntime, NullRuntime, ContainerRuntime,
    # Vault + credentials
    CredentialDB, SSHManager, NoPassphraseError, WrongPassphraseError,
    # Gate
    GateServer, GitGate, mint_gate_token,
    # Shield adapter
    ShieldManager, ShieldHooks, check_environment,
    # Per-container wiring / setup state
    write_sidecar, remove_container_state, sandbox_uninstall, needs_setup,
)

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

CLI

Command Purpose
terok-sandbox setup Install shield + supervisor OCI hooks, provision the credentials DB; idempotent
terok-sandbox uninstall Reverse of setup
terok-sandbox prepare / run / cleanup Wire a user-owned container into the sandbox services
terok-sandbox doctor Run host-side sandbox health checks
terok-sandbox vault … Vault status / unlock / lock / passphrase-tier management
terok-sandbox gate … Git gate inspection (gate path <project>)
terok-sandbox shield … Shield hooks install / status / direct control
terok-sandbox ssh … Per-scope SSH key management in the credentials DB
terok-sandbox credentials encrypt-db Encrypt (migrate) a plaintext credentials DB

Requirements

  • Linux with Podman (rootless, ≥ 5.6 recommended)
  • systemd ≥ 257 — 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.4.1.tar.gz (262.1 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.4.1-py3-none-any.whl (314.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terok_sandbox-0.4.1.tar.gz
  • Upload date:
  • Size: 262.1 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.4.1.tar.gz
Algorithm Hash digest
SHA256 964496ebb768c7f7e1e4dabcf3be98bc389f118885664f97ab961c45d65f0401
MD5 69df457ddf8bbf5b4c47bd67337e4369
BLAKE2b-256 3fa70b615c661a72c04ce90cca593d17e1ccc7e236cbd71ee8856baf4b112c25

See more details on using hashes here.

Provenance

The following attestation bundles were made for terok_sandbox-0.4.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.4.1-py3-none-any.whl.

File metadata

  • Download URL: terok_sandbox-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 314.0 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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b834cd6d69f4c5b8d5fbfec417b31f041ef4f9e0505961e6a13a64a519b25631
MD5 ae343883f5122f496dfd5687cd28761a
BLAKE2b-256 56f6bd7bc7c5aceb3536708b7a44365413f0c52aefc29951ddb2646d677221bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for terok_sandbox-0.4.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