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

Uploaded Python 3

File details

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

File metadata

  • Download URL: terok_sandbox-0.3.0.tar.gz
  • Upload date:
  • Size: 253.4 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.0.tar.gz
Algorithm Hash digest
SHA256 9c3ebace7016586a671fbf741d960c7e0dec19bfc031933ed6a6eb6424b8de2b
MD5 54e2e83e6a68af4c20ea5f577de19ca4
BLAKE2b-256 1fb55bd3cf5b11c594fcf69c2de7befe7a2ddc054074bcb398429bc97beb8614

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: terok_sandbox-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 304.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54739389a0c13be67b5a86ad79d1e9cba852d33ba685b75f2f4f2604e36e4f14
MD5 bc44f82d5c591b0afc7228c59c3a8837
BLAKE2b-256 cab28dd670c979d573ffd6a90aa0e281cfaf0bee60aa4c9e3cee43df09b6bca5

See more details on using hashes here.

Provenance

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