Infrabroker

io.github.luisgf由 GitHub 账号 luisgf 发布v3.1.3更新于 Oct 24, 2026

SSH & Kubernetes access broker for AI agents; the model never touches a credential.

概览

AI 生成的概览

Infrabroker 让 AI 助手通过代理执行 SSH 命令和 Kubernetes 操作,凭据不会进入模型上下文。

可以做什么
Infrabroker 是一个基础设施访问代理,向 MCP 客户端提供 SSH 和 Kubernetes 工具。代理请求执行操作,例如在主机上运行命令或查询集群,代理会按策略检查,用为该次操作临时签发的凭据执行,并只返回输出。SSH 工具包括 ssh_execute、会话打开/执行/关闭、服务器列表和文件上传下载;Kubernetes 工具包括 k8s_get、k8s_list、k8s_logs、k8s_apply、k8s_delete 和 k8s_list_clusters。它还支持命令策略、dry-run、审批门、操作预算、RBAC、会话录制和链式审计日志。
适用场景
当助手需要操作真实服务器或 Kubernetes 集群,但不应该持有 SSH 密钥、证书或集群令牌时使用。它适合希望为 AI 代理提供按策略检查、可审计、按次授权的访问,而不是把静态 SSH 密钥暴露给模型的团队。
运行要求
作为本地进程通过 stdio 运行,通常由 MCP 客户端带配置文件路径启动。单二进制本地模式不需要 signer 或 PKI;完整远程部署使用独立的 signer 服务、mTLS 和生成的 PKI。可选的远程模式使用 OIDC bearer 令牌。以预编译二进制、Go 安装或容器镜像分发。
安装前请注意
代理会执行命令,并可应用或删除 Kubernetes 资源,因此策略、审批门和 dry-run 设置很重要。它可以配置 sudo 提权和 PTY 会话。凭据、CA 密钥和令牌由代理和 signer 处理而非模型,但配置文件和 PKI 材料必须妥善保护。审计日志可能逐字记录机密,部分会话模式仅经代理预检而未在主机端强制执行。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Infrabroker,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

infrabroker

[CI] [Release] [Go Report Card] [License: GPL-3.0] [Docs]

Infrastructure access broker for AI agents — SSH & Kubernetes. The model never touches a credential. (formerly ssh-broker)

The agent requests an action — run a command on a host, query or change a cluster. infrabroker checks it against policy, executes it with a credential minted for that single operation — an ephemeral, scope-limited SSH certificate from its own CA, or a short-lived bound ServiceAccount token — and returns only the output. Keys, certificates and tokens live in the broker's memory and are discarded after the call: nothing enters the model's context, so a prompt-injected agent has nothing to exfiltrate.

One binary — infrabroker — exposes the same engine (internal/broker) and tool surface (internal/mcpserver) over three transports, chosen by subcommand. (The legacy per-transport binaries broker / mcp-broker / mcp-broker-http remain as thin deprecated wrappers over these subcommands, so existing configs keep working.)

  • MCP stdio (local, recommended for personal use) — infrabroker serve-mcp. Tools: ssh_execute, ssh_session_open / ssh_session_exec / ssh_session_close, ssh_list_servers, ssh_put_file / ssh_get_file; with clusters configured, also k8s_get / k8s_list / k8s_logs / k8s_apply / k8s_delete / k8s_list_clusters. No transport auth — isolation comes from the process being launched by the user (as the MCP spec recommends for stdio).
  • MCP HTTP + OAuth2/OIDC (remote, multi-user) — infrabroker serve-mcp-http, Streamable HTTP. Same tools, but each client authenticates with an OIDC bearer token validated locally against the issuer's JWKS; the user identity (and groups, for per-user RBAC) is propagated to the signer.
  • HTTP + mTLS — infrabroker serve-http, POST /v1/ssh_run (one-shot), for network agents authenticated with a client certificate.

Documentation

This README is a landing page. The detail lives in focused, single-source docs:

DocumentContents
QUICKSTART.mdFirst ssh_execute in under 10 minutes — single-binary local mode, no signer/PKI
ARCHITECTURE.mdDiagram, request flow, design decisions, sudo elevation, sessions, multi-CA
THREAT_MODEL.mdActors, trust boundaries, security controls, and explicit non-goals/gaps
OPERATIONS.mdRunbook: startup, adding hosts, hot-reload, broker-ctl, PKI rotation, configs
MESH.mdRunning infrabroker over a NetBird / Tailscale mesh — the session layer on top of the overlay path
SANDBOX.mdinfrabroker with a sandboxed agent (ASP): the agent's code in a microVM, the credential and the action behind the broker — what each layer enforces, the OIDC recipe, the honest limits
HA.mdWhy it is single-instance today: state inventory, the blockers, and what degrades under replication
API.mdHTTP endpoint reference for all services
USAGE.mdGuide to the MCP tools (SSH + Kubernetes), dry-run, and audit review (for the model / operator)
SECURITY.mdVulnerability disclosure policy
CONTRIBUTING.md · CODING_STYLE.mdWorkflow, versioning, Go style

Why infrabroker

  • Anti-exfiltration (prompt injection): the ephemeral key/cert/token live only in the broker's memory; they never enter the model's context.
  • Kubernetes without kubeconfigs: the signer mints a short-lived bound ServiceAccount token (TokenRequest API) per operation; every cluster is default-deny with per-verb/resource/namespace policy and the same dry-run, approval and audit path as SSH.
  • Anti-reuse: each cert carries a TTL of minutes, source-address (broker or bastion IP), and — for one-shot — a force-command. Useless outside its host/time/IP.
  • Controlled escalation: allow_sudo / allowed_sudo_users live in the signer; a compromised broker cannot escalate where policy forbids it.
  • CA compromise bounded: one CA per host group (ca_keys), each key optionally in Azure Key Vault or ssh-agent (YubiKey PIV / SoftHSM / TPM) — the private key never leaves the HSM.
  • Audit / non-repudiation: append-only, Ed25519-chained log correlated by serial across signer, broker, and sshd.

The full threat model — including what the system deliberately does not defend — is in THREAT_MODEL.md.

How it works

AI model ──tool call──> broker ──mTLS──> [control-plane] ──mTLS──> signer   (no credential)      (ephemeral key      (approval +          (CA key +                         in RAM, never        guardrails,          policy + RBAC,                         on disk)             no CA key)           signs the cert)                            │                            └── SSH with the ephemeral cert ──> bastion ──> target host                                                                 └─ stdout/stderr/exit_code ─> model

The broker sends an intent ({host, role, purpose, command?, sudo?, pty?, pubkey, …}); the signer derives every certificate constraint from policy and returns the signed cert. The ephemeral private key is generated in the broker and never leaves it. See ARCHITECTURE.md for the request flow, the design decisions, and the per-hop ProxyJump certificate diagrams.

Feature overview

CapabilityOne-linerMore
Ephemeral certificatesEd25519 pair in RAM per operation; minutes-long, scoped cert. No reusable secret.ARCHITECTURE
External signerA separate cmd/signer holds the CA key and policy; the broker never does.ARCHITECTURE
Multi-CA + HSMOne CA key per host group via ca_keys; local PEM, Azure Key Vault, or ssh-agent/HSM.ARCHITECTURE
AI-action firewallPer-host or composable-by-group command policy (allow/deny/require_approval), POSIX-sh AST parsing, dry-run. Authoritative for one-shot.ARCHITECTURE · USAGE
Human-in-the-loop approvalOptional control plane gates require_approval commands behind out-of-band approval; the signer enforces it.ARCHITECTURE · API
Action budgets (behaviour guardrails)Budget how much an agent can do: per-CN sign-rate cap plus per-subject rate limit and novelty escalation (a subsequent new host / novel command → approval); observe or enforce. Network tools budget what an agent can reach or spend; this budgets the actions themselves.OPERATIONS · ARCHITECTURE
Kill switchFreeze a subject (caller CN, end user, session id or certificate serial): no new certificates, grants revoked, and live sessions are force-closed within revocation_poll_seconds.OPERATIONS
Sealed execOpt-in per host (sealed_exec): every session command carries a signer-signed envelope that infrabroker-shim verifies on the target, so per-command authorization survives a compromised broker.THREAT_MODEL gap 1 · deploy
Approval bridgeapproval-bridge posts pending approvals to Slack (Socket Mode) with Allow / Deny buttons; outbound-only, so nothing with approval authority becomes internet-facing.OPERATIONS
Secret redactionOn by default: credentials inline in commands are masked in audit logs, session recordings and approval notifications (best-effort pattern matching, not DLP).THREAT_MODEL gap 8
RBACBroker-CN groups (mTLS) + per-end-user OIDC groups; fail-closed.ARCHITECTURE
sudo / PTYPolicy-gated elevation (sudo -n) and PTY allocation, per host.ARCHITECTURE
Kubernetes brokerk8s_* tools with per-operation bound SA tokens, default-deny verb/resource/namespace policy, dry-run.USAGE §10
Session recordingshell/pty sessions to ASCIIcast v2 (.cast), indexed by session_id.USAGE §8
Chained auditAppend-only, Ed25519-signed, SHA-256-chained; correlated by serial.USAGE §7 · API
Hot reloadsigner.json re-read (and validated) without restart, via POST /v1/reload or SIGHUP.OPERATIONS §3

Comparison with existing solutions

Several tools address SSH access control or AI-agent credential security, but none cover the full combination that infrabroker targets in a lightweight, self-hosted package.

FeatureinfrabrokerTeleportVault + SSH engineStrongDMssh-mcp
Ephemeral cert in memory (no disk)✅✅✅❌❌
Separate broker / signing service✅✅Partial❌❌
MCP-native (AI agents)✅✅ (2025)✅ (2025)❌✅
OAuth2/OIDC on MCP transport✅✅✅❌❌
Per-command policy + dry-run (AI-action firewall)✅❌❌❌❌
Human-in-the-loop approval for AI commands✅❌❌❌❌
Per-agent behavioral guardrails (anomaly/rate)✅❌❌❌❌
Session recording (ASCIIcast v2, stdin+stdout+stderr)✅✅❌Partial❌
Cryptographically chained audit log✅❌❌Partial❌
Single-binary / simple self-hosted✅❌❌❌✅
HSM/KMS for CA key✅ (AKV, ssh-agent/HSM)✅✅——

Teleport is the closest commercial equivalent — short-lived SSH certs, RBAC, and since 2025 Secure MCP; its Jan-2026 Agentic Identity Framework targets the same threat model. The difference is operational weight: Teleport needs a dedicated control-plane cluster, recording proxy, and web UI — orders of magnitude heavier than a Go binary + signer.

HashiCorp Vault SSH secrets engine is an SSH CA with full HSM/KMS support and (2025) its own MCP server, but it provides only the signing piece — you still build the execution layer (engine.go, session.go, the MCP tools) yourself.

StrongDM hides credentials but stores long-lived secrets rather than generating ephemeral certs in memory, making it weaker against exfiltration. Smallstep SSH CA is a lightweight OIDC-integrated SSH CA (close to cmd/signer) with no execution broker or MCP layer. ssh-mcp exposes SSH to LLMs over MCP but uses a static SSH key — the exact vulnerability this broker prevents. CyberArk PAM offers comparable JIT cert access but is a closed enterprise platform for human operators, not AI workloads.

Where it fits: MCP-native AI-agent access + in-memory ephemeral certs + separate signer + ASCIIcast recording + chained audit, as a small set of Go binaries without a cluster. Enterprise features (web UI, multi-region HA) are on the roadmap (see HANDOFF.md).

Install

  • Prebuilt binaries — each release ships infrabroker_<ver>_{linux,darwin}_{amd64,arm64}.tar.gz with all binaries, plus the installer tarball (infrabroker-v<ver>.tar.gz) that deploy/install.sh consumes for the systemd production path.
  • go install — go install github.com/luisgf/infrabroker/cmd/infrabroker@latest (pure Go, no CGO; same for the other cmd/ binaries).
  • Container — ghcr.io/luisgf/infrabroker (docker or podman, multi-arch; entrypoint is the stdio MCP frontend). See CONTAINERS.md, including a compose demo that runs the full stack against a toy host: cd examples/compose && docker compose up --build -d (or make demo).
  • From source — the Quickstart below.

Register with Claude Code in one line — native binary or container:

bash
claude mcp add infrabroker -- ~/bin/infrabroker serve-mcp -config /secure/path/config.jsonclaude mcp add infrabroker -- docker run -i --rm -v /secure/path:/config \  ghcr.io/luisgf/infrabroker -config /config/config.json

Quickstart

Fastest path (local, single binary): QUICKSTART.md takes you from git clone to your first ssh_execute in under 10 minutes with one binary and one config.json — no signer service, no PKI. The steps below set up the full remote stack (a separated signer); the containerised demo is under Install.

bash
# 1. Build (make injects the version from the git tag into every binary)make install                 # → ~/bin/{infrabroker,signer,broker,broker-ctl,mcp-broker,...}# or a single binary:        make signer# (plain `go build ./cmd/...` also works; it reports a dev-<commit> version)
# 2. Generate the local PKI + the two-service config (signer.json + config.json)infrabroker init             # writes pki/, signer.json, config.json; --force to redo# add --import-ssh-config to import hosts from ~/.ssh/config (Include followed;# ProxyJump/ProxyCommand hosts are skipped with a note), --register-mcp to run# `claude mcp add` for you
# 3. Start the signing service (must be running before the broker)./signer.sh start
# 4. Add a host and reloadbroker-ctl host add --name web01 --addr web01.example.com:22 --user deploy --scan \  --groups prod-web --sudobroker-ctl reload
# (--config is a global flag, before the subcommand; every binary takes --version)broker-ctl --config /secure/path/signer.json host listbroker-ctl --version            # short; add --verbose for build details

Register the stdio MCP with your client:

jsonc
// Claude Code — ~/.claude.json"infrabroker": { "type": "stdio", "command": "/Users/<you>/bin/infrabroker",                "args": ["serve-mcp", "-config", "/secure/path/config.json"] }
// OpenCode — ~/.config/opencode/opencode.json  (note: type "local", command is an array)"infrabroker": { "type": "local",                "command": ["/home/<you>/bin/infrabroker", "serve-mcp", "-config", "/secure/path/config.json"],                "enabled": true }

Full setup — local vs external signing mode, the remote OAuth frontend, host fields, sudoers, PKI, and broker-ctl — is in OPERATIONS.md. Tool usage for the model is in USAGE.md.

API

Full reference: API.md.

ServiceEndpointAuthDescription
SignerPOST /v1/signmTLSRequest an ephemeral SSH certificate
SignerGET /v1/hostsmTLSList accessible hosts (filtered by caller groups)
SignerPOST /v1/reloadmTLSHot-reload signer.json without restart
Control planePOST /v1/sign, /v1/approvals/{id}, …mTLSForwarding + human approval
Broker HTTPPOST /v1/ssh_runmTLSExecute a one-shot SSH command
MCP HTTP/.well-known/oauth-protected-resourceNoneOAuth2 discovery (RFC 9728)
MCP HTTPStreamable HTTPOIDC BearerMCP tools

Security

The security posture — trust boundaries, the layered controls (RBAC, command policy, approval gate, guardrails, source-address/TTL pinning, chained audit, default-on secret redaction), and the explicit non-goals (mode=exec sessions are broker-preflighted but not host-enforced unless the host opts into sealed_exec, no KRL, secret redaction is best-effort regex matching rather than a guarantee, …) — is documented in THREAT_MODEL.md.

To report a vulnerability, see SECURITY.md. CI enforces gofmt, go vet, go test -race, and govulncheck on every push and PR.

Testing

bash
make test                      # go test -race ./...  (cert build, policy/RBAC/sudo/PTY, hops, …)bash lab/run_signer_lab.sh     # external signer: broker without ca_key + policy + denialbash lab/run_mcp_lab.sh        # bastion + target (ProxyJump) MCP scenariobash lab/run_lab.sh            # HTTP/mTLS frontend

License

Copyright (C) 2026 Luis González Fernández.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See LICENSE for the full text.

来源:README.md,提交 cf5fa9d

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v3.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分