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.0.tar.gz (261.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.0-py3-none-any.whl (313.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terok_sandbox-0.4.0.tar.gz
  • Upload date:
  • Size: 261.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.0.tar.gz
Algorithm Hash digest
SHA256 99e51f07f4b0f74814ff472a8a04c8cda0c486f05c392e6ccd63dd2d25bc157c
MD5 221f18d61e5537a22c03a183cdee22c8
BLAKE2b-256 a5e51012e33bec7ad47797df7455b5f621a62f158a97627920f498f425f9fa01

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: terok_sandbox-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 313.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eabbeeca8fc5daca8a62f1448cfd2061351ddf8d82690d75e3e7a7a9cc213a8e
MD5 4722b05f59b50fa68c901204084831e8
BLAKE2b-256 53d3c18cff83adcb03a25921ab09582a7e21d1817a513600cb9b3f39f617a227

See more details on using hashes here.

Provenance

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