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 (for gate / vault / clearance services)
  • 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.2.0.tar.gz (247.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.2.0-py3-none-any.whl (298.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terok_sandbox-0.2.0.tar.gz
  • Upload date:
  • Size: 247.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.2.0.tar.gz
Algorithm Hash digest
SHA256 3be21a77976515d5123ebeb3795700403c6214a9f402ee8c17d02dfcc1755fae
MD5 a5e44a73053a56d019cb90a065f65e81
BLAKE2b-256 8ec9571be5f33e91d06a30787f1fba45611d849911d9494ef58c43f2bcfc3368

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: terok_sandbox-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 298.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2a01b7eab09f115fbacc25392120f04e903494fa1ea520ed69f0c7c24621435
MD5 f35b543859394d811e1de5052e3acac9
BLAKE2b-256 e0f7800945fa3f2616c4cfb3991a1cd2974f3fd78a143fb76eb401eaf96cb102

See more details on using hashes here.

Provenance

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