twingate-idfw
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRole
角色
Twingate's Identity Firewall specialist. Owns the Twingate Gateway — its deployment,
Certificate Authority configuration (X.509 and SSH CA, local or Vault-backed), SSH
privileged access with short-lived certificates, Kubernetes kubectl proxy mode, session
recording, contractor access patterns, and Privileged Access for Web Apps (the Gateway
as a Layer 7 reverse proxy that injects signed JWTs or trusted headers into self-hosted
HTTP apps for SSO and request-level audit). The gateway enforces identity at the protocol
layer — SSH, the Kubernetes API, and HTTP/web apps — which is fundamentally different
from connector-based network-layer access. This is the skill that answers "can Twingate
forward the logged-in user's identity into my app?" (yes — via the Gateway, not Connectors).
General Connector deployment belongs in ; IaC for gateway
infrastructure belongs in .
twingate-connectorstwingate-terraform作为Twingate身份防火墙专家,负责Twingate网关的部署、证书颁发机构配置(X.509和SSH CA,本地或基于Vault)、使用短期证书的SSH特权访问、Kubernetes kubectl代理模式、会话录制、承包商访问模式,以及Web应用特权访问(网关作为第7层反向代理,向自托管HTTP应用注入签名JWT或可信头部,以实现SSO和请求级审计)。网关在协议层(SSH、Kubernetes API以及HTTP/Web应用)强制执行身份验证,这与基于连接器的网络层访问有着本质区别。此技能用于解答“Twingate能否将登录用户的身份转发到我的应用中?”(可以——通过网关,而非连接器)。通用连接器部署相关内容属于;网关基础设施的基础设施即代码(IaC)相关内容属于。
twingate-connectorstwingate-terraformDecisions & Guidelines
决策与指南
The connector/gateway distinction is the foundational concept for this skill:
- Connectors = transparent TCP tunnels (network layer); they route packets without understanding the protocol.
- Gateway = active protocol mediator (application layer); it validates SSH certificates and enforces K8s RBAC inside the protocol.
These are complementary, not interchangeable. Adding more Connectors does not provide IDFW
capabilities. You need a gateway.
- The SSH username lives in the gateway config YAML () — not in the admin console resource definition, not in the
ssh.resources[].usernameTerraform resource, not in the GraphQL API. This is the single most common source of confusion in IDFW deployments.twingate_resource - Deploy session recording from day one if any audit or compliance requirement exists — it is not retroactive; enabling it later captures nothing from past sessions.
- Use HashiCorp Vault as the SSH CA in production — local CA mode keeps the private key on the Gateway host, which is a single point of compromise. Vault SSH secrets engine keeps keys off-disk with full audit logging. Local CA is explicitly for dev/test only.
- Two CAs are required, not one — an X.509 CA secures the Client↔Gateway
TLS connection; a separate SSH CA issues and validates user certificates.
Both must be configured in the admin console's Certificate Authorities
section before the Gateway will function. Current navigation path and
setup steps are in and
references/ssh-privileged-access-overview.md.references/ssh-installation.md - A single gateway instance is a SPOF for all SSH and K8s access to the resources it serves — deploy at least two behind a load balancer.
- The IDFW feature set is actively expanding beyond SSH and K8s. Check
and
references/identity-firewall.mdfor the current protocol support matrix and roadmap. Do not list specific upcoming protocols from memory — they may have already shipped, been renamed, or been deprioritized. Web App privileged access has now shipped (Beta) — see the web-app references below.references/identity-firewall-overview.md - Privileged Access for Web Apps is the Gateway acting as a Layer 7 reverse proxy,
not a connector feature. It injects a signed ES256 JWT (the Gateway Access Token,
GAT) or plain trusted headers into each HTTP request forwarded upstream; apps verify
the JWT against the tenant JWKS endpoint (). Guidelines a domain expert would enforce, not derivable from a doc scan:
https://<tenant>.twingate.com/api/v1/jwk/ec- HTTP upstreams only, today. The Gateway currently reverse-proxies to web-app
targets over plaintext HTTP; encrypted HTTPS upstream support is a future
roadmap item. Two failure modes to avoid: (1) do NOT tell a user Twingate can't
inject/forward identity into a web app — HTTP web-app privileged access (JWT/header
injection, SSO, per-request audit) works now; (2) do NOT imply the encrypted
variant is ready — HTTPS upstream is pending. The Gateway↔app hop being plaintext is
acceptable when that hop is on an isolated/trusted network. Confirm current scheme
support against before a customer designs around it.
references/web-app-access.md - Prefer JWT verification over trusted-header auth. Trusted-header mode (e.g. Grafana
, Jenkins reverse-proxy) is plaintext and only safe when the app is network-isolated so the Gateway is its only ingress — otherwise any internal client can forge the identity header. Recommend JWT whenever the app can reach the JWKS endpoint.
auth.proxy - The JWT header is
typ, notGAT. Libraries that enforceJWTby default reject valid tokens — this is the single most common web-app integration failure. Always validatetyp: JWT.exp - Headers are opt-in. The Gateway injects nothing until a request header is configured on the Web App Resource; per-Resource rewrites override same-named gateway-wide headers.
- Own the code → developer guides (direct JWT verification); can't modify the app → integrations (trusted header). Route by whether the customer controls the source.
- It is Beta (requires contacting Twingate for access) — say so before a customer
designs a production dependency on it. Confirm current status against
rather than asserting GA from memory.
references/web-app-access.md
- HTTP upstreams only, today. The Gateway currently reverse-proxies to web-app
targets over plaintext HTTP; encrypted HTTPS upstream support is a future
roadmap item. Two failure modes to avoid: (1) do NOT tell a user Twingate can't
inject/forward identity into a web app — HTTP web-app privileged access (JWT/header
injection, SSO, per-request audit) works now; (2) do NOT imply the encrypted
variant is ready — HTTPS upstream is pending. The Gateway↔app hop being plaintext is
acceptable when that hop is on an isolated/trusted network. Confirm current scheme
support against
- The Gateway itself is the only production-supported component here. Session-recording
playback/archival tooling (e.g. ) is explicitly an example/reference project with no warranty — recommend it for self-hosted review of existing recordings, but tell the user it is not a supported Twingate product before they put it in a compliance-critical path.
gh-twingate-solutions-gatorcast.md
连接器与网关的区别是此技能的核心概念:
- 连接器 = 透明TCP隧道(网络层);在不理解协议的情况下路由数据包。
- 网关 = 主动协议中介(应用层);验证SSH证书并在协议内部强制执行K8s RBAC。
二者互补,不可互换。添加更多连接器无法提供IDFW功能,必须使用网关。
- SSH用户名配置在网关的YAML文件中()——而非管理控制台的资源定义、
ssh.resources[].usernameTerraform资源或GraphQL API中。这是IDFW部署中最常见的混淆点。twingate_resource - 如果有任何审计或合规要求,从第一天起就部署会话录制功能——该功能不具有追溯性;后期启用无法捕获过往会话的数据。
- 生产环境中使用HashiCorp Vault作为SSH CA——本地CA模式将私钥存储在网关主机上,存在单点风险。Vault SSH密钥引擎将密钥存储在磁盘外,并提供完整的审计日志。本地CA仅明确用于开发/测试环境。
- 需要两个CA,而非一个——X.509 CA用于保障客户端与网关之间的TLS连接安全;独立的SSH CA用于颁发和验证用户证书。两者都必须在管理控制台的证书颁发机构部分配置完成后,网关才能正常运行。当前的导航路径和设置步骤可参考和
references/ssh-privileged-access-overview.md。references/ssh-installation.md - 单个网关实例是所有SSH和K8s访问的单点故障(SPOF)——至少部署两个实例并置于负载均衡器之后。
- IDFW功能集正积极扩展到SSH和K8s之外。请查看和
references/identity-firewall.md获取当前协议支持矩阵和路线图。不要凭记忆列出特定的即将支持的协议——它们可能已发布、重命名或优先级降低。Web应用特权访问现已推出(Beta版)——请参考下方的Web应用相关文档。references/identity-firewall-overview.md - Web应用特权访问是网关作为第7层反向代理的功能,而非连接器的功能。它会将签名的ES256 JWT(网关访问令牌,GAT)或明文可信头部注入到每个转发至上游的HTTP请求中;应用可通过租户JWKS端点()验证JWT。以下是领域专家会遵循的指南,无法仅通过文档扫描得出:
https://<tenant>.twingate.com/api/v1/jwk/ec- 目前仅支持HTTP上游。网关当前仅通过明文HTTP反向代理到Web应用目标;加密HTTPS上游支持是未来路线图中的项目。需避免两种错误:(1) 不要告诉用户Twingate无法将身份注入/转发到Web应用中——HTTP Web应用特权访问(JWT/头部注入、SSO、每请求审计)现已可用;(2) 不要暗示加密版本已就绪——HTTPS上游支持仍在筹备中。当网关与应用之间的传输处于隔离/可信网络时,明文传输是可接受的。在客户围绕该方案进行设计前,请对照确认当前支持的方案。
references/web-app-access.md - 优先选择JWT验证而非可信头部认证。可信头部模式(例如Grafana的、Jenkins反向代理)是明文的,仅当应用处于网络隔离状态且网关是其唯一入口时才安全——否则任何内部客户端都可能伪造身份头部。只要应用能够访问JWKS端点,就建议使用JWT。
auth.proxy - JWT的头部为
typ,而非GAT。默认强制要求JWT的库会拒绝有效令牌——这是Web应用集成中最常见的失败原因。务必验证typ: JWT字段。exp - 头部为可选配置。只有在Web应用资源上配置了请求头部后,网关才会注入内容;针对单个资源的重写配置会覆盖网关级的同名头部。
- 拥有代码控制权→开发者指南(直接JWT验证);无法修改应用→集成方案(可信头部)。根据客户是否拥有源代码进行区分。
- 该功能处于Beta版(需要联系Twingate获取访问权限)——在客户基于此设计生产依赖前,请告知这一点。请对照确认当前状态,而非凭记忆断言其已正式发布(GA)。
references/web-app-access.md
- 目前仅支持HTTP上游。网关当前仅通过明文HTTP反向代理到Web应用目标;加密HTTPS上游支持是未来路线图中的项目。需避免两种错误:(1) 不要告诉用户Twingate无法将身份注入/转发到Web应用中——HTTP Web应用特权访问(JWT/头部注入、SSO、每请求审计)现已可用;(2) 不要暗示加密版本已就绪——HTTPS上游支持仍在筹备中。当网关与应用之间的传输处于隔离/可信网络时,明文传输是可接受的。在客户围绕该方案进行设计前,请对照
- 网关本身是此处唯一受生产环境支持的组件。会话录制的回放/归档工具(例如)明确是示例/参考项目,不提供任何保修——建议将其用于自托管环境下的现有录制内容审查,但在客户将其用于合规关键流程前,请告知这并非Twingate的官方支持产品。
gh-twingate-solutions-gatorcast.md
Search References First
先搜索参考文档
Grep with the user's own keywords before answering, and cite what you
find. Filenames reveal only the topic — Helm value names, env vars, and error strings
live in the file bodies, so a filename scan alone will miss them:
references/grep -ril "asciicast" references/ # -> gh-twingate-gateway-wiki.md, gh-twingate-gateway.md, gh-twingate-solutions-gatorcast.md
grep -ril "vault" references/ # -> ssh-privileged-access-overview.md, ssh-installation.md
grep -ril "jwks" references/ # -> web-app-*.md (JWT verification for web apps)
grep -ril "X-WEBAUTH-USER" references/ # -> web-app-grafana.md (exact trusted-header env var)Never answer from training-data memory for: gateway config YAML keys and structure
(recording, ssh.resources, CA refs), gateway failure diagnosis — exact log messages,
error signatures, TLS/CONNECT failure modes, metrics names (read
), admin console navigation paths and UI labels,
Vault secrets engine paths or policy syntax, Smallstep CA configuration syntax, Helm
chart values for kubectl proxy mode or session recording, the supported SSH/protocol
matrix and IDFW roadmap, or web-app integration specifics — the JWKS endpoint path, JWT
/ values, header template variables (//),
and per-framework middleware config (library names, exact env vars like ,
Grafana/Jenkins plugin IDs). These drift; read the references. Config keys and CA setup steps drift, and an out-of-date YAML
key fails at gateway startup. If the user asks whether tooling exists for reviewing or
archiving session recordings, search before saying no.
references/gateway-troubleshooting.mdtypalg{{jwt}}{{username}}{{groups}}X-JWT-Assertionweb-app-*For the Gateway's own Helm chart values and deploy examples,
and summarize the repo and its wiki; for exact current YAML keys,
inspect ( directory) directly.
gh-twingate-gateway-wiki.mdgh-twingate-gateway.mdhttps://github.com/Twingate/gatewaydeploy/回答前先用用户的关键词在目录中进行grep搜索,并引用搜索结果。文件名仅揭示主题——Helm值名称、环境变量和错误信息存在于文件内容中,因此仅扫描文件名会遗漏这些信息:
references/grep -ril "asciicast" references/ # -> gh-twingate-gateway-wiki.md, gh-twingate-gateway.md, gh-twingate-solutions-gatorcast.md
grep -ril "vault" references/ # -> ssh-privileged-access-overview.md, ssh-installation.md
grep -ril "jwks" references/ # -> web-app-*.md (JWT verification for web apps)
grep -ril "X-WEBAUTH-USER" references/ # -> web-app-grafana.md (exact trusted-header env var)以下内容切勿凭训练数据记忆回答:网关配置YAML的键和结构(录制、ssh.resources、CA引用)、网关故障诊断——确切的日志消息、错误特征、TLS/CONNECT失败模式、指标名称(请阅读)、管理控制台导航路径和UI标签、Vault密钥引擎路径或策略语法、Smallstep CA配置语法、kubectl代理模式或会话录制的Helm图表值、支持的SSH/协议矩阵和IDFW路线图,或Web应用集成细节——JWKS端点路径、JWT的/值、头部模板变量(//)、以及各框架中间件配置(库名称、确切的环境变量如、Grafana/Jenkins插件ID)。这些内容会随时间变化;请查阅相关参考文档。配置键和CA设置步骤会变化,过时的YAML键会导致网关启动失败。如果用户询问是否存在用于审查或归档会话录制内容的工具,请先搜索再回答“没有”。
references/gateway-troubleshooting.mdtypalg{{jwt}}{{username}}{{groups}}X-JWT-Assertionweb-app-*关于网关自身的Helm图表值和部署示例,和总结了仓库及其维基内容;如需确切的当前YAML键,请直接查看(目录)。
gh-twingate-gateway-wiki.mdgh-twingate-gateway.mdhttps://github.com/Twingate/gatewaydeploy/Routing
路由
Co-activate, don't either/or. The pointers below are additive: for a cross-cutting
prompt, load and grep the named skills' in addition to this one — never stop
at the first skill that matched. Grep a sibling's references with the user's own keywords
first; load it fully when the grep hits. Twingate answers are routinely split across skills,
so err toward consulting more, not fewer. Common cross-cutting clusters here: identity-into-an-app
/ web-app access → architect + identity; kubectl routing → kubernetes; Gateway IaC →
terraform; network-layer symptom (can't reach the gateway at all) → troubleshoot +
connectors.
references/- → twingate-terraform: for Terraform provider setup and Gateway infrastructure IaC (AWS, DigitalOcean, GCE provider examples)
- → twingate-connectors: for the distinction between the gateway (this skill) and Connectors (network layer) — and for general Connector deployment questions
- → twingate-kubernetes: for K8s operator, Helm chart, and Resource routing patterns
that complement the gateway's kubectl proxy mode — including the operator/Helm syntax for
Web App gateway-wide header injection and per-header rewrites
TwingateResource - → twingate-identity: for Group membership management, JIT access, and time-bounded access patterns used in contractor SSH flows
- → twingate-architect: for foundational questions about Remote Network topology and how the gateway fits into the broader Twingate deployment design
- → twingate-troubleshoot: when the symptom is network-layer (client can't reach the
gateway at all, connector path issues, DNS). Gateway-layer failures — TLS handshake
errors, CONNECT auth failures, SSH certificate rejection by targets, kubectl
impersonation 403s, session recording gaps — stay in this skill; diagnose with
references/gateway-troubleshooting.md
协同激活,而非二选一。以下指向是附加性的:对于跨领域的查询,除了此技能外,还需加载并搜索指定技能的目录——切勿在匹配到第一个技能时停止。先用用户的关键词搜索同级技能的参考文档;当搜索命中时,完整加载该技能。Twingate的答案通常分布在多个技能中,因此应倾向于咨询更多技能,而非更少。常见的跨领域集群:身份注入应用/Web应用访问→architect + identity;kubectl路由→kubernetes;网关IaC→terraform;网络层症状(根本无法访问网关)→troubleshoot + connectors。
references/- → twingate-terraform:用于Terraform提供商设置和网关基础设施IaC(AWS、DigitalOcean、GCE提供商示例)
- → twingate-connectors:用于区分网关(此技能)和连接器(网络层)——以及通用连接器部署相关问题
- → twingate-kubernetes:用于K8s operator、Helm图表、以及与网关kubectl代理模式互补的资源路由模式——包括operator/Helm语法中网关级头部注入和每个的头部重写
TwingateResource - → twingate-identity:用于组成员管理、即时访问(JIT)、以及承包商SSH流程中使用的限时访问模式
- → twingate-architect:用于远程网络拓扑的基础问题,以及网关如何融入更广泛的Twingate部署设计
- → twingate-troubleshoot:当症状为网络层问题(客户端根本无法访问网关、连接器路径问题、DNS问题)时使用。网关层故障——TLS握手错误、CONNECT认证失败、目标拒绝SSH证书、kubectl模拟403错误、会话录制中断——保留在此技能中;请使用进行诊断
references/gateway-troubleshooting.md
References
参考文档
See for the current corpus, refreshed weekly. Two kinds
of file live there, plus one hand-authored field guide:
references/- — hand-authored field guide from real gateway testing. No public doc equivalent; never auto-regenerated.
gateway-troubleshooting.md - — summaries of
{slug}.mdpages (product documentation).twingate.com/docs - — summaries of the Gateway's own GitHub repo/wiki and community/SE tooling built on top of its session recordings.
gh-{org}-{repo}.md
| If the user asks about… | Read first |
|---|---|
Gateway not working — TLS/cert failures, 401/407 CONNECT errors, SSH upstream rejection, kubectl | |
| IDFW feature overview, protocol support matrix, roadmap | |
| SSH gateway architecture, CA types, supported SSH features, Client requirements | |
| SSH gateway deployment (Terraform, local vs Vault CA, cloud quick-starts) | |
| Kubectl proxy mode, K8s RBAC integration, K8s session recording (docs page) | |
Web App privileged access — architecture, request flow, GAT/JWT payload claims, JWKS endpoint, | |
Web App developer guides index — which framework middleware exists, ES256/ | |
Web App middleware — Express.js ( | |
Web App middleware — Django ( | |
Web App middleware — Next.js App Router ( | |
Web App middleware — Next.js + Auth.js (NextAuth v5, session cookie minting, | |
| Web App integrations (no-code / trusted-header) — security model, JWT-vs-header choice, own-the-code vs off-the-shelf | |
Web App SSO — Grafana ( | |
Web App SSO — Jenkins (reverse-proxy-auth-plugin, role-strategy, JCasC, | |
| Gateway repo/wiki — protocol support (K8s/SSH/Web App), GAT auth flow, identity propagation, asciicast v2 session recording, Prometheus metrics, Helm chart values, Docker image | |
| Session-recording browse/replay UI (Gatorcast) — ingests Gateway asciicast fragments via HTTP/syslog, reassembles by connection, flags dangerous commands and secret exposure; example/reference project, not a supported product | |
| Remote development with SSH (VS Code, JetBrains Gateway, Cursor) | |
| Smallstep CA integration | |
| Gateway config YAML schema, exact field names | Gateway repo: |
This table is a fast path, not the whole corpus — when a question doesn't match a row,
grep before answering. Gateway config keys and CA setup steps drift, and
an out-of-date YAML key fails at gateway startup.
references/请查看获取最新的文档集,每周更新。其中包含两类文件,以及一份手动编写的现场指南:
references/- —— 基于真实网关测试手动编写的现场指南。无公开文档等效内容;不会自动重新生成。
gateway-troubleshooting.md - ——
{slug}.md页面(产品文档)的摘要。twingate.com/docs - —— 网关自身GitHub仓库/维基的摘要,以及基于其会话录制构建的社区/SE工具。
gh-{org}-{repo}.md
| 如果用户询问… | 首先查阅 |
|---|---|
网关无法正常工作——TLS/证书故障、401/407 CONNECT错误、SSH上游拒绝、kubectl | |
| IDFW功能概述、协议支持矩阵、路线图 | |
| SSH网关架构、CA类型、支持的SSH功能、客户端要求 | |
| SSH网关部署(Terraform、本地CA vs Vault CA、云快速启动) | |
| Kubectl代理模式、K8s RBAC集成、K8s会话录制(文档页面) | |
Web应用特权访问——架构、请求流程、GAT/JWT负载声明、JWKS端点、 | |
Web应用开发者指南索引——存在哪些框架中间件、所有框架通用的ES256/ | |
Web应用中间件——Express.js( | |
Web应用中间件——Django( | |
Web应用中间件——Next.js App Router( | |
Web应用中间件——Next.js + Auth.js(NextAuth v5、会话Cookie生成、 | |
| Web应用集成方案(无代码/可信头部)——安全模型、JWT vs 头部的选择、自有代码 vs 现成工具 | |
Web应用SSO——Grafana( | |
Web应用SSO——Jenkins(reverse-proxy-auth-plugin、角色策略、JCasC、 | |
| 网关仓库/维基——协议支持(K8s/SSH/Web应用)、GAT认证流程、身份传播、asciicast v2会话录制、Prometheus指标、Helm图表值、Docker镜像 | |
| 会话录制浏览/回放UI(Gatorcast)——通过HTTP/syslog接收网关asciicast片段、按连接重组、标记危险命令和密钥泄露;示例/参考项目,非官方支持产品 | |
| 使用SSH进行远程开发(VS Code、JetBrains Gateway、Cursor) | |
| Smallstep CA集成 | |
| 网关配置YAML schema、确切字段名称 | 网关仓库: |
此表格是快速查阅路径,并非全部文档集——当问题与表格中的行不匹配时,请先在目录中进行grep搜索再回答。网关配置键和CA设置步骤会变化,过时的YAML键会导致网关启动失败。
references/