Skip to main content

Hardened Podman container runner with gate server and shield integration

Project description

terok-sandbox

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
terok-gate Long-running gate daemon (systemd unit entry point)
terok-vault Long-running vault token broker (systemd unit entry point)

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.1.0.tar.gz (239.7 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.1.0-py3-none-any.whl (291.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terok_sandbox-0.1.0.tar.gz
  • Upload date:
  • Size: 239.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 3b2eec3c5a5f76aace67fd15a8b11a60f675812ae10ec8745f3ed815e2296842
MD5 c81c7e622772b10e5b0e2ed10e07508e
BLAKE2b-256 5e5a1ad3ccadad693c2dee9aaf91abd7c00fc3e6e8c785a168e1fab010ca2710

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: terok_sandbox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 291.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 466b2cfa856c9ae8ca6f0d6666800c5cc4db8b276266d46481c3de8a5e5f192b
MD5 7b941c46e6f39acefccb9742ab550b77
BLAKE2b-256 ffdb10153780abcab3f34054618c709d23f8b4c5b5fedcbe0e0a06fe4f686e3f

See more details on using hashes here.

Provenance

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