mirror of https://github.com/istio/istio.io.git
313 lines
94 KiB
HTML
313 lines
94 KiB
HTML
<!doctype html><html lang=zh itemscope itemtype=https://schema.org/WebPage><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=theme-color content="#466BB0"><meta name=title content="安全问题"><meta name=description content="定位常见 Istio 认证、授权、安全相关问题的技巧。"><meta name=keywords content="microservices,services,mesh,security,citadel"><meta property="og:title" content="安全问题"><meta property="og:type" content="website"><meta property="og:description" content="定位常见 Istio 认证、授权、安全相关问题的技巧。"><meta property="og:url" content="/v1.7/zh/docs/ops/common-problems/security-issues/"><meta property="og:image" content="/v1.7/img/istio-whitelogo-bluebackground-framed.svg"><meta property="og:image:alt" content="Istio Logo"><meta property="og:image:width" content="112"><meta property="og:image:height" content="150"><meta property="og:site_name" content="Istio"><meta name=twitter:card content="summary"><meta name=twitter:site content="@IstioMesh"><title>Istioldie 1.7 / 安全问题</title><script async src="https://www.googletagmanager.com/gtag/js?id=UA-98480406-2"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}
|
||
gtag('js',new Date());gtag('config','UA-98480406-2');</script><link rel=alternate type=application/rss+xml title="Istio Blog" href=/v1.7/blog/feed.xml><link rel=alternate type=application/rss+xml title="Istio News" href=/v1.7/news/feed.xml><link rel=alternate type=application/rss+xml title="Istio Blog and News" href=/v1.7/feed.xml><link rel="shortcut icon" href=/v1.7/favicons/favicon.ico><link rel=apple-touch-icon href=/v1.7/favicons/apple-touch-icon-180x180.png sizes=180x180><link rel=icon type=image/png href=/v1.7/favicons/favicon-16x16.png sizes=16x16><link rel=icon type=image/png href=/v1.7/favicons/favicon-32x32.png sizes=32x32><link rel=icon type=image/png href=/v1.7/favicons/android-36x36.png sizes=36x36><link rel=icon type=image/png href=/v1.7/favicons/android-48x48.png sizes=48x48><link rel=icon type=image/png href=/v1.7/favicons/android-72x72.png sizes=72x72><link rel=icon type=image/png href=/v1.7/favicons/android-96x96.png sizes=96xW96><link rel=icon type=image/png href=/v1.7/favicons/android-144x144.png sizes=144x144><link rel=icon type=image/png href=/v1.7/favicons/android-192x192.png sizes=192x192><link rel=manifest href=/v1.7/manifest.json><meta name=apple-mobile-web-app-title content="Istio"><meta name=application-name content="Istio"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Work+Sans:400|Chivo:400|Work+Sans:500,300,600,300italic,400italic,500italic,600italic|Chivo:500,300,600,300italic,400italic,500italic,600italic"><link rel=stylesheet href=/v1.7/css/all.css><script src=/v1.7/js/themes_init.min.js></script></head><body class="language-unknown archive-site"><script>const branchName="release-1.7";const docTitle="安全问题";const iconFile="\/v1.7/img/icons.svg";const buttonCopy='复制到剪切板';const buttonPrint='打印';const buttonDownload='下载';</script><script src="https://www.google.com/cse/brand?form=search-form" defer></script><script src=/v1.7/js/all.min.js data-manual defer></script><header><nav><a id=brand href=/v1.7/zh/><span class=logo><svg viewBox="0 0 300 300"><circle cx="150" cy="150" r="146" stroke-width="2"/><polygon points="65 240 225 240 125 270"/><polygon points="65 230 125 220 125 110"/><polygon points="135 220 225 230 135 30"/></svg></span><span class=name>Istioldie 1.7</span></a><div id=hamburger><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#hamburger"/></svg></div><div id=header-links><a class=current title="了解如何部署、使用和运维 Istio。" href=/v1.7/zh/docs/>文档</a>
|
||
<a title="关于使用 Istio 的博客文章。" href=/v1.7/zh/blog/2020/>博客<i class=dot data-prefix=/blog></i></a>
|
||
<a title="关于 Istio 项目的最新报道。" href=/v1.7/zh/news/>新闻<i class=dot data-prefix=/news></i></a>
|
||
<a title="关于 Istio 的常见问题。" href=/v1.7/zh/faq/>FAQ</a>
|
||
<a title="关于 Istio 项目的说明。" href=/v1.7/zh/about/>关于</a><div class=menu><button id=gearDropdownButton class=menu-trigger title=选项和设置 aria-label="Options and Settings" aria-controls=gearDropdownContent><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#gear"/></svg></button><div id=gearDropdownContent class=menu-content aria-labelledby=gearDropdownButton role=menu><a tabindex=-1 role=menuitem lang=en id=switch-lang-en>English</a>
|
||
<a tabindex=-1 role=menuitem lang=zh id=switch-lang-zh class=active>中文</a><div role=separator></div><a tabindex=-1 role=menuitem class=active id=light-theme-item>亮主题</a>
|
||
<a tabindex=-1 role=menuitem id=dark-theme-item>暗主题</a><div role=separator></div><a tabindex=-1 role=menuitem id=syntax-coloring-item>代码高亮</a><div role=separator></div><h6>本站的其它版本</h6><a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://istio.io/docs\/ops\/common-problems\/security-issues\/');return false;">当前版本</a>
|
||
<a tabindex=-1 role=menuitem onclick="navigateToUrlOrRoot('https://preliminary.istio.io/docs\/ops\/common-problems\/security-issues\/');return false;">下个版本</a>
|
||
<a tabindex=-1 role=menuitem href=https://istio.io/archive>旧版本</a></div></div><button id=search-show title="搜索 istio.io" aria-label=搜索><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#magnifier"/></svg></button></div><form id=search-form name=cse role=search><input type=hidden name=cx value=002184991200833970123:iwwf17ikgf4>
|
||
<input type=hidden name=ie value=utf-8>
|
||
<input type=hidden name=hl value=en>
|
||
<input type=hidden id=search-page-url value=/v1.7/search>
|
||
<input id=search-textbox class=form-control name=q type=search aria-label="搜索 istio.io">
|
||
<button id=search-close title=取消搜索 type=reset aria-label=取消搜索><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#cancel-x"/></svg></button></form></nav></header><div class=banner-container></div><main class="primary notoc"><div id=sidebar-container class="sidebar-container sidebar-offcanvas"><nav id=sidebar aria-label="Section Navigation"><div class=directory><div class=card><button class="header dynamic" id=card32 title="一些概念,理解它们有助于您更好地了解 Istio 系统的不同部分及其使用的抽象。" aria-controls=card32-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#concepts"/></svg>概念</button><div class=body aria-labelledby=card32 role=region id=card32-body><ul role=tree aria-expanded=true class=leaf-section aria-labelledby=card32><li role=none><a role=treeitem title="介绍 Istio,它要解决的问题,高层面的架构和设计目标。" href=/v1.7/zh/docs/concepts/what-is-istio/>Istio 是什么?</a></li><li role=none><a role=treeitem title="描述 Istio 多样的流量路由和控制特性。" href=/v1.7/zh/docs/concepts/traffic-management/>流量管理</a></li><li role=none><a role=treeitem title="讲述 Istio 的 WebAssembly 插件系统。" href=/v1.7/zh/docs/concepts/wasm/>扩展性</a></li><li role=none><a role=treeitem title="描述 Istio 的授权与认证功能。" href=/v1.7/zh/docs/concepts/security/>安全</a></li><li role=none><a role=treeitem title="描述 Istio 提供的遥测和监控特性。" href=/v1.7/zh/docs/concepts/observability/>可观察性</a></li></ul></div></div><div class=card><button class="header dynamic" id=card48 title="关于如何在 Kubernetes 集群中安装 Istio 控制平面和添加虚拟机到 mesh 中的说明。" aria-controls=card48-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#setup"/></svg>安装</button><div class=body aria-labelledby=card48 role=region id=card48-body><ul role=tree aria-expanded=true aria-labelledby=card48><li role=none><a role=treeitem title="下载、安装并学习如何快速使用 Istio 的基本特性。" href=/v1.7/zh/docs/setup/getting-started/>开始</a></li><li role=treeitem aria-label=平台安装><button aria-hidden=true></button><a title="在安装 Istio 之前如何准备各种 Kubernetes 平台。" href=/v1.7/zh/docs/setup/platform-setup/>平台安装</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="对阿里云 Kubernetes 集群进行配置以便安装运行 Istio。" href=/v1.7/zh/docs/setup/platform-setup/alicloud/>阿里云</a></li><li role=none><a role=treeitem title="为 Istio 设置一个 Azure 集群的指令。" href=/v1.7/zh/docs/setup/platform-setup/azure/>Azure</a></li><li role=none><a role=treeitem title="在 Docker Desktop 中运行 Istio 的设置说明。" href=/v1.7/zh/docs/setup/platform-setup/docker/>Docker Desktop</a></li><li role=none><a role=treeitem title="在 Google Kubernetes Engine (GKE) 上快速搭建 Istio 服务。" href=/v1.7/zh/docs/setup/platform-setup/gke/>使用 Google Kubernetes Engine 快速开始</a></li><li role=none><a role=treeitem title="在 IBM 公有云或私有云上快速搭建 Istio 服务。" href=/v1.7/zh/docs/setup/platform-setup/ibm/>IBM Cloud 快速开始</a></li><li role=none><a role=treeitem title="为 Istio 设置 kind 的说明。" href=/v1.7/zh/docs/setup/platform-setup/kind/>kind</a></li><li role=none><a role=treeitem title="使用 Gardener 快速搭建 Istio 服务。" href=/v1.7/zh/docs/setup/platform-setup/gardener/>Kubernetes Gardener 快速开始</a></li><li role=none><a role=treeitem title="配置 MicroK8s 以便使用 Istio。" href=/v1.7/zh/docs/setup/platform-setup/microk8s/>MicroK8s</a></li><li role=none><a role=treeitem title="在 Minikube 上配置 Istio。" href=/v1.7/zh/docs/setup/platform-setup/minikube/>Minikube</a></li><li role=none><a role=treeitem title="对 OpenShift 集群进行配置以便安装运行 Istio。" href=/v1.7/zh/docs/setup/platform-setup/openshift/>OpenShift</a></li><li role=none><a role=treeitem title="为 Istio 配置 OKE 集群环境的说明。" href=/v1.7/zh/docs/setup/platform-setup/oci/>Oracle Cloud Infrastructure</a></li></ul></li><li role=treeitem aria-label=安装><button aria-hidden=true></button><a title=选择最适合您的需求和平台的指南。 href=/v1.7/zh/docs/setup/install/>安装</a><ul role=group aria-expanded=false><li role=none><a role=treeitem title="安装和自定义任何 Istio 配置文件以进行深入评估或用于生产。" href=/v1.7/zh/docs/setup/install/istioctl/>使用 Istioctl 安装</a></li><li role=none><a role=treeitem title="安装和配置 Istio 以进行深入评估或用于生产。" href=/v1.7/zh/docs/setup/install/helm/>使用 Helm 自定义安装</a></li><li role=none><a role=treeitem title="使用 Istio operator 在 Kubernetes 集群中安装 Istio 指南。" href=/v1.7/zh/docs/setup/install/standalone-operator/>安装独立 Operator [实验]</a></li><li role=treeitem aria-label=多集群安装><button aria-hidden=true></button><a title="配置跨越多个 Kubernetes 集群的 Istio 服务网格。" href=/v1.7/zh/docs/setup/install/multicluster/>多集群安装</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="配置一个跨多个 Kubernetes 集群的 Istio 网格。" href=/v1.7/zh/docs/setup/install/multicluster/simplified/>简化地多集群安装[实验性]</a></li><li role=none><a role=treeitem title="通过控制平面副本集实例,在多个 Kubernetes 集群上安装 Istio 网格。" href=/v1.7/zh/docs/setup/install/multicluster/gateways/>控制平面副本集</a></li><li role=none><a role=treeitem title="安装一个跨多个 Kubernetes 集群的 Istio 网格,多集群共享控制平面,并且集群间通过 VPN 互连。" href=/v1.7/zh/docs/setup/install/multicluster/shared-vpn/>共享控制平面(单一网络)</a></li><li role=none><a role=treeitem title="跨多个 Kubernetes 集群安装一个 Istio 网格,使互不联通的集群网络共享同一个控制平面。" href=/v1.7/zh/docs/setup/install/multicluster/shared-gateways/>共享的控制平面(多网络)</a></li></ul></li></ul></li><li role=treeitem aria-label=升级><button aria-hidden=true></button><a title="选择与您先前用于安装 Istio 的方法相对应的升级指南。" href=/v1.7/zh/docs/setup/upgrade/>升级</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="使用 istioctl 命令来升级或降级 Istio。" href=/v1.7/zh/docs/setup/upgrade/istioctl-upgrade/>使用 istioctl 命令升级 Istio [实验中]</a></li><li role=none><a role=treeitem title="升级 Istio 控制平面,可以选择使用 Helm 升级 CNI 插件。" href=/v1.7/zh/docs/setup/upgrade/cni-helm-upgrade/>使用 Helm 升级</a></li></ul></li><li role=treeitem aria-label=更多指南><button aria-hidden=true></button><a title=有关其他设置任务的更多信息。 href=/v1.7/zh/docs/setup/additional-setup/>更多指南</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="描述 Istio 内置的安装配置文件。" href=/v1.7/zh/docs/setup/additional-setup/config-profiles/>安装配置</a></li><li role=none><a role=treeitem title="在应用程序 Pod 中使用 sidecar injector webhook 自动安装或使用 istioctl CLI 手动安装 Istio sidecar。" href=/v1.7/zh/docs/setup/additional-setup/sidecar-injection/>设置 Sidecar</a></li><li role=none><a role=treeitem title="安装并使用 Istio CNI 插件,可以让运维人员用更低的权限来部署服务。" href=/v1.7/zh/docs/setup/additional-setup/cni/>安装 Istio CNI 插件</a></li></ul></li></ul></div></div><div class=card><button class="header dynamic" id=card64 title="如何用 Istio 系统实现特定目标的行为。" aria-controls=card64-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#tasks"/></svg>任务</button><div class=body aria-labelledby=card64 role=region id=card64-body><ul role=tree aria-expanded=true aria-labelledby=card64><li role=treeitem aria-label=流量管理><button aria-hidden=true></button><a title="演示 Istio 的流量路由功能的任务。" href=/v1.7/zh/docs/tasks/traffic-management/>流量管理</a><ul role=group aria-expanded=false><li role=none><a role=treeitem title=此任务将展示如何将请求动态路由到微服务的多个版本。 href=/v1.7/zh/docs/tasks/traffic-management/request-routing/>配置请求路由</a></li><li role=none><a role=treeitem title=此任务说明如何注入故障并测试应用程序的弹性。 href=/v1.7/zh/docs/tasks/traffic-management/fault-injection/>故障注入</a></li><li role=none><a role=treeitem title=展示如何将流量从旧版本迁移到新版本的服务。 href=/v1.7/zh/docs/tasks/traffic-management/traffic-shifting/>流量转移</a></li><li role=none><a role=treeitem title="展示如何将一个服务的 TCP 流量从旧版本迁移到新版本。" href=/v1.7/zh/docs/tasks/traffic-management/tcp-traffic-shifting/>TCP 流量转移</a></li><li role=none><a role=treeitem title="本任务用于示范如何使用 Istio 在 Envoy 中设置请求超时。" href=/v1.7/zh/docs/tasks/traffic-management/request-timeouts/>设置请求超时</a></li><li role=none><a role=treeitem title=本任务展示如何为连接、请求以及异常检测配置熔断。 href=/v1.7/zh/docs/tasks/traffic-management/circuit-breaking/>熔断</a></li><li role=none><a role=treeitem title="此任务演示了 Istio 的流量镜像/影子功能。" href=/v1.7/zh/docs/tasks/traffic-management/mirroring/>镜像</a></li><li role=treeitem aria-label=Ingress><button aria-hidden=true></button><a title="控制 Istio 服务网格的入口流量。" href=/v1.7/zh/docs/tasks/traffic-management/ingress/>Ingress</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="描述如何配置 Istio gateway,以将服务暴露至服务网格之外。" href=/v1.7/zh/docs/tasks/traffic-management/ingress/ingress-control/>Ingress Gateway</a></li><li role=none><a role=treeitem title="使用文件挂载的证书并通过 TLS 或 mTLS 将服务暴露至服务网格之外。" href=/v1.7/zh/docs/tasks/traffic-management/ingress/secure-ingress-mount/>安全网关(文件挂载)</a></li><li role=none><a role=treeitem title="使用 Secret 发现服务(SDS) 通过 TLS 或者 mTLS 把服务暴露给服务网格外部。" href=/v1.7/zh/docs/tasks/traffic-management/ingress/secure-ingress-sds/>使用 SDS 为 Gateway 提供 HTTPS 加密支持</a></li><li role=none><a role=treeitem title="说明了如何为一个 ingress gateway 配置 SNI 透传。" href=/v1.7/zh/docs/tasks/traffic-management/ingress/ingress-sni-passthrough/>无 TLS 终止的 Ingress Gateway</a></li></ul></li><li role=treeitem aria-label=Egress><button aria-hidden=true></button><a title="控制 Istio 服务网格的出口流量。" href=/v1.7/zh/docs/tasks/traffic-management/egress/>Egress</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="描述如何配置 Istio 以将流量从网格中的服务路由到外部服务。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress-control/>访问外部服务</a></li><li role=none><a role=treeitem title="描述如何配置 Istio 对来自外部服务的流量执行 TLS 发起。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress-tls-origination/>Egress TLS Origination</a></li><li role=none><a role=treeitem title="描述如何配置 Istio 通过专用网关服务将流量定向到外部服务。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress-gateway/>Egress Gateway</a></li><li role=none><a role=treeitem title="描述如何配置一个 Egress 网关,来向外部服务发起 TLS 连接。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/>Egress 网关的 TLS 发起过程</a></li><li role=none><a role=treeitem title="描述如何开启通用域中一组主机的 egress,无需单独配置每一台主机。" href=/v1.7/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/>Wildcard 主机的 egress</a></li><li role=none><a role=treeitem title="描述如何在 TLS Egress 上配置 SNI 监控和策略。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress_sni_monitoring_and_policies/>TLS Egress 监控和策略配置</a></li><li role=none><a role=treeitem title="描述如何配置 Istio 以允许应用程序使用外部 HTTPS 代理。" href=/v1.7/zh/docs/tasks/traffic-management/egress/http-proxy/>使用外部 HTTPS 代理</a></li><li role=none><a role=treeitem title="展示如何配置 Istio Kubernetes 外部服务。" href=/v1.7/zh/docs/tasks/traffic-management/egress/egress-kubernetes-services/>Kubernetes Egress 流量服务</a></li></ul></li></ul></li><li role=treeitem aria-label=安全><button aria-hidden=true></button><a title=演示如何保护网格。 href=/v1.7/zh/docs/tasks/security/>安全</a><ul role=group aria-expanded=false><li role=treeitem aria-label=认证><button aria-hidden=true></button><a title="管控网格服务间的双向 TLS 和终端用户的身份认证。" href=/v1.7/zh/docs/tasks/security/authentication/>认证</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="通过一个简化的工作流和最小化配置实现双向 TLS。" href=/v1.7/zh/docs/tasks/security/authentication/auto-mtls/>自动双向 TLS</a></li><li role=none><a role=treeitem title="为您展示如何使用 Istio 认证策略设置双向 TLS 和基础终端用户认证。" href=/v1.7/zh/docs/tasks/security/authentication/authn-policy/>认证策略</a></li><li role=none><a role=treeitem title="展示如何在 HTTPS 服务上启用双向 TLS。" href=/v1.7/zh/docs/tasks/security/authentication/https-overlay/>通过 HTTPS 进行 TLS</a></li><li role=none><a role=treeitem title="阐述如何将 Istio 服务逐步迁移至双向 TLS 通信模式。" href=/v1.7/zh/docs/tasks/security/authentication/mtls-migration/>双向 TLS 迁移</a></li></ul></li><li role=treeitem aria-label="Citadel 配置"><button aria-hidden=true></button><a title="定制 Citadel 证书颁发机构。" href=/v1.7/zh/docs/tasks/security/citadel-config/>Citadel 配置</a><ul role=group aria-expanded=false class=leaf-section></ul></li><li role=treeitem aria-label=授权><button aria-hidden=true></button><a title="展示如何控制到 Istio 服务的访问。" href=/v1.7/zh/docs/tasks/security/authorization/>授权</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="展示如何设置基于角色的 HTTP 流量访问控制。" href=/v1.7/zh/docs/tasks/security/authorization/authz-http/>HTTP 流量授权</a></li><li role=none><a role=treeitem title="展示如何设置 TCP 流量的访问控制。" href=/v1.7/zh/docs/tasks/security/authorization/authz-tcp/>TCP 流量的授权</a></li><li role=none><a role=treeitem title="有关如何在 Istio 中通过 JWT 实现访问控制的教程。" href=/v1.7/zh/docs/tasks/security/authorization/authz-jwt/>基于 JWT 授权</a></li><li role=none><a role=treeitem title=阐述如何在不更改授权策略的前提下从一个信任域迁移到另一个。 href=/v1.7/zh/docs/tasks/security/authorization/authz-td-migration/>授权策略信任域迁移</a></li></ul></li><li role=none><a role=treeitem title="演示系统管理员如何使用现有的根证书、签名证书和密钥配置 Istio 的 CA。" href=/v1.7/zh/docs/tasks/security/plugin-ca-cert/>插入外部 CA 证书</a></li><li role=none><a role=treeitem title="展示如何准备和管理 Istio DNS 证书。" href=/v1.7/zh/docs/tasks/security/dns-cert/>Istio DNS 证书管理</a></li></ul></li><li role=treeitem aria-label=策略><button aria-hidden=true></button><a title=演示策略执行功能。 href=/v1.7/zh/docs/tasks/policy-enforcement/>策略</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="这个任务将告诉你如何开启 Istio 的策略检查功能。" href=/v1.7/zh/docs/tasks/policy-enforcement/enabling-policy/>启用策略检查功能</a></li><li role=none><a role=treeitem title="这部分内容将向您展示如何使用 Istio 去动态限制服务间的流量。" href=/v1.7/zh/docs/tasks/policy-enforcement/rate-limiting/>启用速率限制</a></li><li role=none><a role=treeitem title=演示如何使用策略适配器修改请求头和路由。 href=/v1.7/zh/docs/tasks/policy-enforcement/control-headers/>请求头和路由控制</a></li><li role=none><a role=treeitem title="描述如何使用简单的 denials 或黑白名单来控制对服务的访问。" href=/v1.7/zh/docs/tasks/policy-enforcement/denial-and-list/>Denials 和黑白名单</a></li></ul></li><li role=treeitem aria-label=可观察性><button aria-hidden=true></button><a title=演示如何从网格收集遥测信息。 href=/v1.7/zh/docs/tasks/observability/>可观察性</a><ul role=group aria-expanded=false><li role=treeitem aria-label=指标度量><button aria-hidden=true></button><a title="演示 Istio 网格指标度量的配置、收集和处理。" href=/v1.7/zh/docs/tasks/observability/metrics/>指标度量</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="此任务向您展示如何配置 Istio 以采集和自定义指标。" href=/v1.7/zh/docs/tasks/observability/metrics/collecting-metrics/>采集指标</a></li><li role=none><a role=treeitem title="本任务展示了如何配置 Istio 进行 TCP 服务的指标收集。" href=/v1.7/zh/docs/tasks/observability/metrics/tcp-metrics/>收集 TCP 服务指标</a></li><li role=none><a role=treeitem title="本任务介绍如何通过 Prometheus 查询 Istio 度量指标。" href=/v1.7/zh/docs/tasks/observability/metrics/querying-metrics/>通过 Prometheus 查询度量指标</a></li><li role=none><a role=treeitem title="此任务展示了如何设置和使用 Istio Dashboard 监控网格流量。" href=/v1.7/zh/docs/tasks/observability/metrics/using-istio-dashboard/>使用 Grafana 可视化指标</a></li></ul></li><li role=treeitem aria-label=日志><button aria-hidden=true></button><a title="演示 Istio 网格日志的配置、收集和处理。" href=/v1.7/zh/docs/tasks/observability/logs/>日志</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="本任务向您展示如何配置 Istio 来收集和定制日志。" href=/v1.7/zh/docs/tasks/observability/logs/collecting-logs/>收集日志</a></li><li role=none><a role=treeitem title="此任务向您展示如何配置 Envoy 代理将访问日志打印到其标准输出。" href=/v1.7/zh/docs/tasks/observability/logs/access-log/>获取 Envoy 访问日志</a></li><li role=none><a role=treeitem title="此任务向您展示如何配置 Istio 以连接到 Fluentd 守护程序进行日志收集。" href=/v1.7/zh/docs/tasks/observability/logs/fluentd/>使用 Fluentd 进行日志收集</a></li></ul></li><li role=treeitem aria-label=分布式追踪><button aria-hidden=true></button><a title="该任务展示了如何为启用了 Istio 支持的应用进行追踪。" href=/v1.7/zh/docs/tasks/observability/distributed-tracing/>分布式追踪</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Istio 分布式追踪的概述。" href=/v1.7/zh/docs/tasks/observability/distributed-tracing/overview/>概述</a></li><li role=none><a role=treeitem title="了解如何通过配置代理以将追踪请求发送到 Zipkin。" href=/v1.7/zh/docs/tasks/observability/distributed-tracing/zipkin/>Zipkin</a></li><li role=none><a role=treeitem title="了解如何配置代理以向 Jaeger 发送追踪请求。" href=/v1.7/zh/docs/tasks/observability/distributed-tracing/jaeger/>Jaeger</a></li><li role=none><a role=treeitem title="怎样配置代理才能把追踪请求发送到 LightStep。" href=/v1.7/zh/docs/tasks/observability/distributed-tracing/lightstep/>LightStep</a></li></ul></li><li role=none><a role=treeitem title="此任务向您展示如何在 Istio 网格中可视化服务。" href=/v1.7/zh/docs/tasks/observability/kiali/>网络可视化</a></li><li role=none><a role=treeitem title="此任务向您展示如何配置从外部访问 Istio 遥测插件。" href=/v1.7/zh/docs/tasks/observability/gateways/>远程访问遥测插件</a></li></ul></li></ul></div></div><div class=card><button class="header dynamic" id=card116 title="这里包括多个可供 Istio 使用的可完整工作的示例,你可以用来亲自部署和体验这些示例。" aria-controls=card116-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#examples"/></svg>示例</button><div class=body aria-labelledby=card116 role=region id=card116-body><ul role=tree aria-expanded=true aria-labelledby=card116><li role=none><a role=treeitem title="部署一个用于演示多种 Istio 特性的应用,由四个单独的微服务构成。" href=/v1.7/zh/docs/examples/bookinfo/>Bookinfo 应用</a></li><li role=treeitem aria-label=虚拟机><button aria-hidden=true></button><a title="将虚拟机中运行的工作负载添加到 Istio 网格的示例。" href=/v1.7/zh/docs/examples/virtual-machines/>虚拟机</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="学习如何新增一个服务,使其运行在单网络 Istio 网格的虚拟机上。" href=/v1.7/zh/docs/examples/virtual-machines/single-network/>单个网络网格中的虚拟机</a></li><li role=none><a role=treeitem title="学习怎样添加运行在虚拟机上的服务到您的多网络 Istio 网格中。" href=/v1.7/zh/docs/examples/virtual-machines/multi-network/>多网络网格中的虚拟机</a></li><li role=none><a role=treeitem title="使用在网格内的虚拟机上运行的 MySQL 服务运行 Bookinfo 应用程序。" href=/v1.7/zh/docs/examples/virtual-machines/bookinfo/>在虚拟机上部署 Bookinfo 应用程序</a></li></ul></li><li role=treeitem aria-label="使用 Kubernetes 和 Istio 学习微服务"><button aria-hidden=true></button><a title="该模块化教程为新用户提供了一步步将 Istio 应用于常见微服务场景的动手经验。" href=/v1.7/zh/docs/examples/microservices-istio/>使用 Kubernetes 和 Istio 学习微服务</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/prereq/>前提条件</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/setup-kubernetes-cluster/>设置 Kubernetes 集群</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/setup-local-computer/>设置本地计算机</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/single/>本地运行微服务</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/package-service/>在 Docker 中运行 ratings 服务</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/bookinfo-kubernetes/>使用 Kubernetes 运行 Bookinfo</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/examples/microservices-istio/production-testing/>生产测试</a></li></ul></li></ul></div></div><div class=card><button class="header dynamic" id=card122 title="关于部署和管理 Istio 网格的概念、工具和技术。" aria-controls=card122-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#guide"/></svg>运维</button><div class="body default" aria-labelledby=card122 role=region id=card122-body><ul role=tree aria-expanded=true aria-labelledby=card122><li role=treeitem aria-label=部署><button aria-hidden=true></button><a title="设置 Istio 部署的要求、概念和注意事项。" href=/v1.7/zh/docs/ops/deployment/>部署</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="描述 Istio 的整体架构与设计目标。" href=/v1.7/zh/docs/ops/deployment/architecture/>架构</a></li><li role=none><a role=treeitem title="描述 Istio 部署中的选择和建议。" href=/v1.7/zh/docs/ops/deployment/deployment-models/>部署模型</a></li><li role=none><a role=treeitem title="介绍 Istio 的性能和可扩展性。" href=/v1.7/zh/docs/ops/deployment/performance-and-scalability/>性能和可扩展性</a></li><li role=none><a role=treeitem title="在启用了 Istio 的集群中运行 Kubernetes 的 Pod 和 Service,您需要做些准备。" href=/v1.7/zh/docs/ops/deployment/requirements/>Pod 和 Service</a></li></ul></li><li role=treeitem aria-label=配置><button aria-hidden=true></button><a title="配置运行中的 Istio 网格的高级概念和功能。" href=/v1.7/zh/docs/ops/configuration/>配置</a><ul role=group aria-expanded=false><li role=treeitem aria-label=网格配置><button aria-hidden=true></button><a title=帮助您管理全局网格配置。 href=/v1.7/zh/docs/ops/configuration/mesh/>网格配置</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="简要描述 Istio 对 Kubernetes webhook 的使用以及可能出现的相关问题。" href=/v1.7/zh/docs/ops/configuration/mesh/webhook/>动态准入 Webhook 概述</a></li><li role=none><a role=treeitem title="介绍 Istio 是如何通过 Kubernetes 的 webhooks 机制来实现 Sidecar 自动注入。" href=/v1.7/zh/docs/ops/configuration/mesh/injection-concepts/>Sidecar 自动注入</a></li><li role=none><a role=treeitem title="描述 Citadel 如何确定是否创建服务账号 secret。" href=/v1.7/zh/docs/ops/configuration/mesh/secret-creation/>创建服务账号 Secret</a></li><li role=none><a role=treeitem title="为您展示如何对 Istio 服务做健康检查。" href=/v1.7/zh/docs/ops/configuration/mesh/app-health-check/>Istio 服务的健康检查</a></li></ul></li><li role=treeitem aria-label=流量管理><button aria-hidden=true></button><a title=帮助您管理正在运行的网格的网络方面。 href=/v1.7/zh/docs/ops/configuration/traffic-management/>流量管理</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title=关于怎么声明协议的信息。 href=/v1.7/zh/docs/ops/configuration/traffic-management/protocol-selection/>协议选择</a></li><li role=none><a role=treeitem title=有关如何启用和理解地域负载平衡。 href=/v1.7/zh/docs/ops/configuration/traffic-management/locality-load-balancing/>地域负载均衡</a></li></ul></li><li role=treeitem aria-label=安全><button aria-hidden=true></button><a title=帮助您管理正在运行的网格的安全性方面。 href=/v1.7/zh/docs/ops/configuration/security/>安全</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="使用加固的容器镜像来减小 Istio 的攻击面。" href=/v1.7/zh/docs/ops/configuration/security/harden-docker-images/>加固 Docker 容器镜像</a></li><li role=none><a role=treeitem title="学习如何延长 Istio 自签名根证书的寿命。" href=/v1.7/zh/docs/ops/configuration/security/root-transition/>延长自签名证书的寿命</a></li></ul></li><li role=treeitem aria-label=可观测性><button aria-hidden=true></button><a title=帮助您管理正在运行的网格中的遥测收集和可视化。 href=/v1.7/zh/docs/ops/configuration/telemetry/>可观测性</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="精细化控制 Envoy 的统计信息。" href=/v1.7/zh/docs/ops/configuration/telemetry/envoy-stats/>Envoy 的统计信息</a></li><li role=none><a role=treeitem title=怎样使用代理生成服务级别的指标。 href=/v1.7/zh/docs/ops/configuration/telemetry/in-proxy-service-telemetry/>不使用 Mixer 生成 Istio 指标 [Alpha]</a></li></ul></li></ul></li><li role=treeitem aria-label=最佳实践><button aria-hidden=true></button><a title="设置和管理 Istio 服务网格的最佳实践。" href=/v1.7/zh/docs/ops/best-practices/>最佳实践</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="设置 Istio 服务网格时的最佳实践。" href=/v1.7/zh/docs/ops/best-practices/deployment/>Deployment 最佳实践</a></li><li role=none><a role=treeitem title=避免网络或流量管理问题的配置最佳实践。 href=/v1.7/zh/docs/ops/best-practices/traffic-management/>流量管理最佳实践</a></li><li role=none><a role=treeitem title="使用 Istio 保护应用的最佳实践。" href=/v1.7/zh/docs/ops/best-practices/security/>安全最佳实践</a></li></ul></li><li role=treeitem aria-label=常见问题><button class=show aria-hidden=true></button><a title="描述如何辨认和解决 Istio 中的常见问题。" href=/v1.7/zh/docs/ops/common-problems/>常见问题</a><ul role=group aria-expanded=true class=leaf-section><li role=none><a role=treeitem title="定位常见的 Istio 流量管理和网络问题的技术。" href=/v1.7/zh/docs/ops/common-problems/network-issues/>流量管理问题</a></li><li role=none><span role=treeitem class=current title="定位常见 Istio 认证、授权、安全相关问题的技巧。">安全问题</span></li><li role=none><a role=treeitem title="处理 Telemetry 收集问题。" href=/v1.7/zh/docs/ops/common-problems/observability-issues/>可观测性问题</a></li><li role=none><a role=treeitem title="解决 Istio 使用 Kubernetes Webhooks 进行 sidecar 自动注入的常见问题。" href=/v1.7/zh/docs/ops/common-problems/injection/>Sidecar 自动注入问题</a></li><li role=none><a role=treeitem title=如何解决配置验证的问题。 href=/v1.7/zh/docs/ops/common-problems/validation/>配置验证的问题</a></li></ul></li><li role=treeitem aria-label=诊断工具><button aria-hidden=true></button><a title="帮助解决 Istio 网格问题的工具和技术。" href=/v1.7/zh/docs/ops/diagnostic-tools/>诊断工具</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Istio 自带的一个可以为服务网格部署提供调试和诊断的补充工具。" href=/v1.7/zh/docs/ops/diagnostic-tools/istioctl/>使用 Istioctl 命令行工具</a></li><li role=none><a role=treeitem title="描述诊断与流量管理相关的 Envoy 配置问题的工具和技术。" href=/v1.7/zh/docs/ops/diagnostic-tools/proxy-cmd/>调试 Envoy 和 Pilot</a></li><li role=none><a role=treeitem title="向您展示如何使用 istioctl describe 来验证您的网格中的 pod 的配置。" href=/v1.7/zh/docs/ops/diagnostic-tools/istioctl-describe/>通过 Istioctl Describe 理解您的网格</a></li><li role=none><a role=treeitem title="演示如何使用 istioctl analyze 来识别配置中的潜在问题。" href=/v1.7/zh/docs/ops/diagnostic-tools/istioctl-analyze/>使用 Istioctl Analyze 诊断配置</a></li><li role=none><a role=treeitem title="介绍如何使用 ControlZ 深入了解各个运行组件。" href=/v1.7/zh/docs/ops/diagnostic-tools/controlz/>组件自检</a></li><li role=none><a role=treeitem title=如何使用组件的级别日志来记录正在运行中的组件的行为。 href=/v1.7/zh/docs/ops/diagnostic-tools/component-logging/>组件日志记录</a></li></ul></li><li role=treeitem aria-label=集成><button aria-hidden=true></button><a title="能够与 Istio 集成以提供额外功能的其他软件。" href=/v1.7/zh/docs/ops/integrations/>集成</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="关于如何与 cert-manager 集成的相关说明。" href=/v1.7/zh/docs/ops/integrations/certmanager/>cert-manager</a></li></ul></li></ul></div></div><div class=card><button class="header dynamic" id=card155 title="参考部分包含详细的权威参考资料,如命令行选项、配置选项和 API 调用参数。" aria-controls=card155-body><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#reference"/></svg>参考</button><div class=body aria-labelledby=card155 role=region id=card155-body><ul role=tree aria-expanded=true aria-labelledby=card155><li role=treeitem aria-label=配置><button aria-hidden=true></button><a title=关于配置选项的详细信息。 href=/v1.7/zh/docs/reference/config/>配置</a><ul role=group aria-expanded=false><li role=none><a role=treeitem title="Configuration affecting the service mesh as a whole." href=/v1.7/zh/docs/reference/config/istio.mesh.v1alpha1/>Service Mesh</a></li><li role=none><a role=treeitem title="Configuration for Istio control plane installation through the Operator." href=/v1.7/zh/docs/reference/config/istio.operator.v1alpha12.pb/>Operator Installation</a></li><li role=none><a role=treeitem title="描述使用 Helm chart 安装 Istio 时的可选项。" href=/v1.7/zh/docs/reference/config/installation-options/>安装选项(Helm)</a></li><li role=none><a role=treeitem title="Configuration affecting Istio control plane installation version and shape." href=/v1.7/zh/docs/reference/config/istio.operator.v1alpha1/>IstioOperator Options</a></li><li role=none><a role=treeitem title="Resource annotations used by Istio." href=/v1.7/zh/docs/reference/config/annotations/>Resource Annotations</a></li><li role=treeitem aria-label=流量管理><button aria-hidden=true></button><a title="描述如何配置 HTTP/TCP 路由功能。" href=/v1.7/zh/docs/reference/config/networking/>流量管理</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Configuration affecting load balancing, outlier detection, etc." href=/v1.7/zh/docs/reference/config/networking/destination-rule/>Destination Rule</a></li><li role=none><a role=treeitem title="Customizing Envoy configuration generated by Istio." href=/v1.7/zh/docs/reference/config/networking/envoy-filter/>Envoy Filter</a></li><li role=none><a role=treeitem title="Configuration affecting edge load balancer." href=/v1.7/zh/docs/reference/config/networking/gateway/>Gateway</a></li><li role=none><a role=treeitem title="Configuration affecting label/content routing, sni routing, etc." href=/v1.7/zh/docs/reference/config/networking/virtual-service/>Virtual Service</a></li><li role=none><a role=treeitem title="Configuration affecting network reachability of a sidecar." href=/v1.7/zh/docs/reference/config/networking/sidecar/>Sidecar</a></li><li role=none><a role=treeitem title="Configuration affecting service registry." href=/v1.7/zh/docs/reference/config/networking/service-entry/>Service Entry</a></li></ul></li><li role=treeitem aria-label=Security><button aria-hidden=true></button><a title="如何配置 Istio 的安全功能。" href=/v1.7/zh/docs/reference/config/security/>Security</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Configuration to validate JWT." href=/v1.7/zh/docs/reference/config/security/jwt/>JWTRule</a></li><li role=none><a role=treeitem title="Request authentication configuration for workloads." href=/v1.7/zh/docs/reference/config/security/request_authentication/>RequestAuthentication</a></li><li role=none><a role=treeitem title="Peer authentication configuration for workloads." href=/v1.7/zh/docs/reference/config/security/peer_authentication/>PeerAuthentication</a></li><li role=none><a role=treeitem title="Authentication policy for Istio services." href=/v1.7/zh/docs/reference/config/security/istio.authentication.v1alpha1/>Authentication Policy</a></li><li role=none><a role=treeitem title="Configuration for access control on workloads." href=/v1.7/zh/docs/reference/config/security/authorization-policy/>Authorization Policy</a></li><li role=none><a role=treeitem title=授权策略中支持的条件。 href=/v1.7/zh/docs/reference/config/security/conditions/>授权策略</a></li><li role=none><a role=treeitem title="Configuration for Role Based Access Control." href=/v1.7/zh/docs/reference/config/security/istio.rbac.v1alpha1/>RBAC (deprecated)</a></li><li role=none><a role=treeitem title=受支持的约束条件和属性。 href=/v1.7/zh/docs/reference/config/security/constraints-and-properties/>RBAC 约束和属性(不建议使用)</a></li></ul></li><li role=treeitem aria-label="Telemetry V2"><button aria-hidden=true></button><a title="介绍如何配置 Istio telemetry V2。" href=/v1.7/zh/docs/reference/config/telemetry/>Telemetry V2</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="通过 Istio 遥测导出的 Istio 标准指标。" href=/v1.7/zh/docs/reference/config/telemetry/metrics/>Istio 标准度量指标</a></li><li role=none><a role=treeitem title="如何通过 Wasm 运行时启用 Telemetry V2(实验性)。" href=/v1.7/zh/docs/reference/config/telemetry/telemetry_v2_with_wasm/>使用 Wasm 运行时的 Telemetry V2(实验性)</a></li><li role=none><a role=treeitem title="如何配置 v2 指标(实验性)。" href=/v1.7/zh/docs/reference/config/telemetry/configurable_metrics/>可配置指标(实验性)</a></li></ul></li><li role=treeitem aria-label=配置分析消息><button aria-hidden=true></button><a title=记录配置分析期间产生的各个错误和警告消息。 href=/v1.7/zh/docs/reference/config/analysis/>配置分析消息</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/message-format/>Analyzer Message Format</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0109/>ConflictingMeshGatewayVirtualServiceHosts</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0110/>ConflictingSidecarWorkloadSelectors</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0002/>Deprecated</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0104/>GatewayPortNotOnWorkload</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0001/>InternalError</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0105/>IstioProxyImageMismatch</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0119/>JwtFailureDueToInvalidServicePortPrefix</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0107/>MisplacedAnnotation</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0113/>MTLSPolicyConflict</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0111/>MultipleSidecarsWithoutWorkloadSelectors</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0102/>NamespaceNotInjected</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0112/>VirtualServiceDestinationPortSelectorRequired</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0108/>UnknownAnnotation</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0106/>SchemaValidationError</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0101/>ReferencedResourceNotFound</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0118/>PortNameIsNotUnderNamingConvention</a></li><li role=none><a role=treeitem href=/v1.7/zh/docs/reference/config/analysis/ist0103/>PodMissingProxy</a></li></ul></li><li role=treeitem aria-label="Mixer 策略和遥测"><button aria-hidden=true></button><a title="描述如何配置 Mixer 的策略和遥测功能。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/>Mixer 策略和遥测</a><ul role=group aria-expanded=false><li role=none><a role=treeitem title="Configuration state for the Mixer client library." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/istio.mixer.v1.config.client/>Mixer Client</a></li><li role=none><a role=treeitem title="Describes the rules used to configure Mixer's policy and telemetry features." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/istio.policy.v1beta1/>Rules</a></li><li role=none><a role=treeitem title="描述 Istio 策略执行和遥测机制的配置模型。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/mixer-overview/>Mixer 配置模型</a></li><li role=none><a role=treeitem title=描述用于策略和控制的基本属性词汇表。 href=/v1.7/zh/docs/reference/config/policy-and-telemetry/attribute-vocabulary/>属性词汇</a></li><li role=none><a role=treeitem title="Mixer 配置表达式语言手册。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/expression-language/>表达式语言</a></li><li role=treeitem aria-label=适配器><button aria-hidden=true></button><a title="Mixer 适配器能够让 Istio 连接各种基础设施后端以完成类似指标和日志这样的功能。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/>适配器</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Adapter to deliver metrics to Apache SkyWalking." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/apache-skywalking/>Apache SkyWalking</a></li><li role=none><a role=treeitem title="Adapter for Apigee's distributed policy checks and analytics." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/apigee/>Apigee</a></li><li role=none><a role=treeitem title="Adapter to enforce authentication and authorization policies for web apps and APIs." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/app-identity-access-adapter/>App Identity and Access</a></li><li role=none><a role=treeitem title="Adapter for circonus.com's monitoring solution." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/circonus/>Circonus</a></li><li role=none><a role=treeitem title="Adapter for cloudmonitor metrics." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/cloudmonitor/>CloudMonitor</a></li><li role=none><a role=treeitem title="Adapter for cloudwatch metrics." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/cloudwatch/>CloudWatch</a></li><li role=none><a role=treeitem title="Adapter to deliver metrics to a dogstatsd agent for delivery to DataDog." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/datadog/>Datadog</a></li><li role=none><a role=treeitem title="Adapter to deliver tracing data to Zipkin." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/zipkin/>Zipkin</a></li><li role=none><a role=treeitem title="Adapter that always returns a precondition denial." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/denier/>Denier</a></li><li role=none><a role=treeitem title="Adapter that delivers logs to a Fluentd daemon." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/fluentd/>Fluentd</a></li><li role=none><a role=treeitem title="Adapter that extracts information from a Kubernetes environment." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/kubernetesenv/>Kubernetes Env</a></li><li role=none><a role=treeitem title="Adapter that performs whitelist or blacklist checks." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/list/>List</a></li><li role=none><a role=treeitem title="Adapter for a simple in-memory quota management system." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/memquota/>Memory quota</a></li><li role=none><a role=treeitem title="An Istio Mixer adapter to send telemetry data to New Relic." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/newrelic/>New Relic</a></li><li role=none><a role=treeitem title="Adapter to deliver metrics to Wavefront by VMware." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/wavefront/>Wavefront by VMware</a></li><li role=none><a role=treeitem title="Adapter to locally output logs and metrics." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/stdio/>Stdio</a></li><li role=none><a role=treeitem title="Adapter to deliver metrics to a StatsD backend." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/statsd/>StatsD</a></li><li role=none><a role=treeitem title="Adapter to deliver logs, metrics, and traces to Stackdriver." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/stackdriver/>Stackdriver</a></li><li role=none><a role=treeitem title="Adapter to deliver logs and metrics to Papertrail and AppOptics backends." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/solarwinds/>SolarWinds</a></li><li role=none><a role=treeitem title="Adapter for a Redis-based quota management system." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/redisquota/>Redis Quota</a></li><li role=none><a role=treeitem title="Adapter that exposes Istio metrics for ingestion by a Prometheus harvester." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/prometheus/>Prometheus</a></li><li role=none><a role=treeitem title="Adapter that implements an Open Policy Agent engine." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/adapters/opa/>OPA</a></li></ul></li><li role=treeitem aria-label=模板><button aria-hidden=true></button><a title="Mixer 模板用于将数据发送到各个适配器。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/>模板</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="The Analytics template is used to dispatch runtime telemetry to Apigee." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/analytics/>Analytics</a></li><li role=none><a role=treeitem title="A template that represents a single API key." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/apikey/>API Key</a></li><li role=none><a role=treeitem title="A template used to represent an access control query." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/authorization/>Authorization</a></li><li role=none><a role=treeitem title="A template that carries no data, useful for testing." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/checknothing/>Check Nothing</a></li><li role=none><a role=treeitem title="A template designed to report observed communication edges between workloads." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/edge/>Edge</a></li><li role=none><a role=treeitem title="A template that is used to control the production of Kubernetes-specific attributes." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/kubernetes/>Kubernetes</a></li><li role=none><a role=treeitem title="A template designed to let you perform list checking operations." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/listentry/>List Entry</a></li><li role=none><a role=treeitem title="A template that represents a single runtime log entry." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/logentry/>Log Entry</a></li><li role=none><a role=treeitem title="A template that represents a single runtime metric." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/metric/>Metric</a></li><li role=none><a role=treeitem title="A template that represents an individual span within a distributed trace." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/tracespan/>Trace Span</a></li><li role=none><a role=treeitem title="A template that carries no data, useful for testing." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/reportnothing/>Report Nothing</a></li><li role=none><a role=treeitem title="A template that represents a quota allocation request." href=/v1.7/zh/docs/reference/config/policy-and-telemetry/templates/quota/>Quota</a></li></ul></li><li role=none><a role=treeitem title="通过 Mixer 从 Istio 导出的默认监控指标。" href=/v1.7/zh/docs/reference/config/policy-and-telemetry/metrics/>默认监控指标</a></li></ul></li></ul></li><li role=treeitem aria-label=命令><button aria-hidden=true></button><a title="描述 Istio 命令和工具的用法及选项。" href=/v1.7/zh/docs/reference/commands/>命令</a><ul role=group aria-expanded=false class=leaf-section><li role=none><a role=treeitem title="Galley provides configuration management services for Istio." href=/v1.7/zh/docs/reference/commands/galley/>galley</a></li><li role=none><a role=treeitem title="Istio Certificate Authority (CA)." href=/v1.7/zh/docs/reference/commands/istio_ca/>istio_ca</a></li><li role=none><a role=treeitem title="Istio control interface." href=/v1.7/zh/docs/reference/commands/istioctl/>istioctl</a></li><li role=none><a role=treeitem title="Mixer is Istio's abstraction on top of infrastructure backends." href=/v1.7/zh/docs/reference/commands/mixs/>mixs</a></li><li role=none><a role=treeitem title="Kubernetes webhook for automatic Istio sidecar injection." href=/v1.7/zh/docs/reference/commands/sidecar-injector/>sidecar-injector</a></li><li role=none><a role=treeitem title="Istio Pilot." href=/v1.7/zh/docs/reference/commands/pilot-discovery/>pilot-discovery</a></li><li role=none><a role=treeitem title="Istio Pilot agent." href=/v1.7/zh/docs/reference/commands/pilot-agent/>pilot-agent</a></li><li role=none><a role=treeitem title="The Istio operator." href=/v1.7/zh/docs/reference/commands/operator/>operator</a></li><li role=none><a role=treeitem title="Istio security per-node agent." href=/v1.7/zh/docs/reference/commands/node_agent/>node_agent</a></li></ul></li><li role=none><a role=treeitem title="Istio 常用术语的词汇表。" href=/v1.7/zh/docs/reference/glossary/>术语表</a></li></ul></div></div></div></nav></div><div class=article-container><button tabindex=-1 id=sidebar-toggler title=折叠导航栏><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#pull"/></svg></button><nav aria-label=Breadcrumb><ol><li><a href=/v1.7/zh/ title=用于连接、保护、控制和观测服务。>Istio</a></li><li><a href=/v1.7/zh/docs/ title="了解如何部署、使用和运维 Istio。">文档</a></li><li><a href=/v1.7/zh/docs/ops/ title="关于部署和管理 Istio 网格的概念、工具和技术。">运维</a></li><li><a href=/v1.7/zh/docs/ops/common-problems/ title="描述如何辨认和解决 Istio 中的常见问题。">常见问题</a></li><li>安全问题</li></ol></nav><article aria-labelledby=title><div class=title-area><div style=width:100%><h1 id=title>安全问题</h1><p class=byline><span title="1371 字"><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#clock"/></svg><span> </span>阅读大约需要 7 分钟</span>
|
||
<span> </span>
|
||
<span></span></p></div></div><nav class="toc-inlined toc-forced" aria-label="Table of Contents"><div><hr><ol><li role=none aria-label=终端用户认证失败><a href=#end-user-authentication-fails>终端用户认证失败</a><li role=none aria-label=授权过于严格><a href=#authorization-is-too-restrictive>授权过于严格</a><li role=none aria-label=授权太过宽松><a href=#authorization-is-too-permissive>授权太过宽松</a><li role=none aria-label=确保授权正确开启><a href=#ensure-authorization-is-enabled-correctly>确保授权正确开启</a><li role=none aria-label="确保 Pilot 接受策略"><a href=#ensure-pilot-accepts-the-policies>确保 Pilot 接受策略</a><li role=none aria-label="确认 Pilot 正确的将策略分发给了代理服务器"><a href=#ensure-pilot-distributes-policies-to-proxies-correctly>确认 Pilot 正确的将策略分发给了代理服务器</a><li role=none aria-label=确认策略在代理服务器中正确执行><a href=#ensure-proxies-enforce-policies-correctly>确认策略在代理服务器中正确执行</a><li role=none aria-label=密钥和证书错误><a href=#keys-and-certificates-errors>密钥和证书错误</a><li role=none aria-label="双向 TLS 错误"><a href=#mutual-TLS-errors>双向 TLS 错误</a><li role=none aria-label="Citadel 行为异常"><a href=#repairing-citadel>Citadel 行为异常</a><li role=none aria-label=相关内容><a href=#see-also>相关内容</a></li></ol><hr></div></nav><h2 id=end-user-authentication-fails>终端用户认证失败</h2><p>使用 Istio,可以启用终端用户认证。目前,Istio 认证策略提供的终端用户凭证是 JWT。以下是排查终端用户 JWT 身份认证问题的指南。</p><ol><li><p>检查 Istio 身份认证策略 Policy 配置,<code>principalBinding</code> 需要被设为 <code>USE_ORIGIN</code> 来验证终端用户。</p></li><li><p>如果 <code>jwksUri</code> 未设置,确保 JWT 发行者是 url 格式并且 <code>url + /.well-known/openid-configuration</code> 可以在浏览器中打开;例如,如果 JWT 发行者是 <code>https://accounts.google.com</code>,确保 <code>https://accounts.google.com/.well-known/openid-configuration</code> 是有效的 url,并且可以在浏览器中打开。</p><pre><code class=language-yaml data-expandlinks=true data-repo=istio>apiVersion: "authentication.istio.io/v1alpha1"
|
||
kind: "Policy"
|
||
metadata:
|
||
name: "example-3"
|
||
spec:
|
||
targets:
|
||
- name: httpbin
|
||
peers:
|
||
- mtls:
|
||
origins:
|
||
- jwt:
|
||
issuer: "628645741881-noabiu23f5a8m8ovd8ucv698lj78vv0l@developer.gserviceaccount.com"
|
||
jwksUri: "https://www.googleapis.com/service_accounts/v1/jwk/628645741881-noabiu23f5a8m8ovd8ucv698lj78vv0l@developer.gserviceaccount.com"
|
||
principalBinding: USE_ORIGIN
|
||
</code></pre></li><li><p>如果 JWT token 放在 http 请求头 Authorization 字段值中,需要确认 JWT token 的有效性(未过期等)。JWT 令牌中的字段可以使用在线 JWT 解析工具进行解码,例如:<a href=https://jwt.io/>jwt.io</a>。</p></li><li><p>通过获取 Istio 代理(例如:Envoy)日志来验证 Pilot 分发的配置是否正确的。
|
||
例如,如果身份认证策略在命名空间 <code>foo</code> 中的 <code>httpbin</code> 服务上执行,使用如下命令可以查看 Istio 代理的日志,确保 <code>local_jwks</code> 已设置,并且 http 响应码输出到 Istio 代理日志中。</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl logs httpbin-68fbcdcfc7-hrnzm -c istio-proxy -n foo
|
||
[2018-07-04 19:13:30.762][15][info][config] ./src/envoy/http/jwt_auth/auth_store.h:72] Loaded JwtAuthConfig: rules {
|
||
issuer: "628645741881-noabiu23f5a8m8ovd8ucv698lj78vv0l@developer.gserviceaccount.com"
|
||
local_jwks {
|
||
inline_string: "{\n \"keys\": [\n {\n \"kty\": \"RSA\",\n \"alg\": \"RS256\",\n \"use\": \"sig\",\n \"kid\": \"03bc39a6b56602c0d2ad421c3993d5e4f88e6f54\",\n \"n\": \"u9gnSMDYw4ggVKInAfxpXqItv9Ii7PlUFrAcwANQMW9fbZrFpITFD45t0gUy9CK4QewkLhqDDUJSvpH7wprS8Hi0M8wAJf_lgugdRr6Nc2qK-eywjjDK-afQjhGLcMJGS0YXi3K2lyP-oWiLingMbYRiJxTi86icWT8AU8bKoTyTPFOExAJkDFnquulU0_KlteZxbjnRIVvMKfpgZ3yK9Pzv7XjtdvO7xlr59K9Zotd4mgphIUADfw1fR0lNkjHQp9N0WP9cbOsyUwm5jjDklnyVh7yBHcEk1YHccntosxnwIn-cj538PSaL_qDZgDAsJKHPZlkiP_1mjsu3NkofIQ\",\n \"e\": \"AQAB\"\n },\n {\n \"kty\": \"RSA\",\n \"alg\": \"RS256\",\n \"use\": \"sig\",\n \"kid\": \"60aef5b0877e9f0d67b787b5be797636735efdee\",\n \"n\": \"0TmzDEN12GF9UaWJI40oKwJlu53ZQihHcaVi1thLGs1l3ubdPWv8MEsc9X2DjCRxEB6Ss1R2VOImrQ2RWFuBSNHorjE0_GyEGNzvOH-0uUQ5uES2HvEN7384XfUYj9MoTPibstDEl84pm4d3Ka3R_1wk03Jrl9MIq6fnV_4Z-F7O7ElGqk8xcsiVUowd447dwlrd55ChIyISF5PvbCLtOKz9FgTz2mEb8jmzuZQs5yICgKZCzlJ7xNOOmZcqCZf9Qzaz4OnVLXykBLzSuLMtxvvOxf53rvWB0F2__CjKlEWBCQkB39Zaa_4I8dCAVxgkeQhgoU26BdzLL28xjWzdbw\",\n \"e\": \"AQAB\"\n },\n {\n \"kty\": \"RSA\",\n \"alg\": \"RS256\",\n \"use\": \"sig\",\n \"kid\": \"62a93512c9ee4c7f8067b5a216dade2763d32a47\",\n \"n\": \"0YWnm_eplO9BFtXszMRQNL5UtZ8HJdTH2jK7vjs4XdLkPW7YBkkm_2xNgcaVpkW0VT2l4mU3KftR-6s3Oa5Rnz5BrWEUkCTVVolR7VYksfqIB2I_x5yZHdOiomMTcm3DheUUCgbJRv5OKRnNqszA4xHn3tA3Ry8VO3X7BgKZYAUh9fyZTFLlkeAh0-bLK5zvqCmKW5QgDIXSxUTJxPjZCgfx1vmAfGqaJb-nvmrORXQ6L284c73DUL7mnt6wj3H6tVqPKA27j56N0TB1Hfx4ja6Slr8S4EB3F1luYhATa1PKUSH8mYDW11HolzZmTQpRoLV8ZoHbHEaTfqX_aYahIw\",\n \"e\": \"AQAB\"\n },\n {\n \"kty\": \"RSA\",\n \"alg\": \"RS256\",\n \"use\": \"sig\",\n \"kid\": \"b3319a147514df7ee5e4bcdee51350cc890cc89e\",\n \"n\": \"qDi7Tx4DhNvPQsl1ofxxc2ePQFcs-L0mXYo6TGS64CY_2WmOtvYlcLNZjhuddZVV2X88m0MfwaSA16wE-RiKM9hqo5EY8BPXj57CMiYAyiHuQPp1yayjMgoE1P2jvp4eqF-BTillGJt5W5RuXti9uqfMtCQdagB8EC3MNRuU_KdeLgBy3lS3oo4LOYd-74kRBVZbk2wnmmb7IhP9OoLc1-7-9qU1uhpDxmE6JwBau0mDSwMnYDS4G_ML17dC-ZDtLd1i24STUw39KH0pcSdfFbL2NtEZdNeam1DDdk0iUtJSPZliUHJBI_pj8M-2Mn_oA8jBuI8YKwBqYkZCN1I95Q\",\n \"e\": \"AQAB\"\n }\n ]\n}\n"
|
||
}
|
||
forward: true
|
||
forward_payload_header: "istio-sec-8a85f33ec44c5ccbaf951742ff0aaa34eb94d9bd"
|
||
}
|
||
allow_missing_or_failed: true
|
||
[2018-07-04 19:13:30.763][15][info][upstream] external/envoy/source/server/lds_api.cc:62] lds: add/update listener '10.8.2.9_8000'
|
||
[2018-07-04T19:13:39.755Z] "GET /ip HTTP/1.1" 401 - 0 29 0 - "-" "curl/7.35.0" "e8374005-1957-99e4-96b6-9d6ec5bef396" "httpbin.foo:8000" "-"
|
||
[2018-07-04T19:13:40.463Z] "GET /ip HTTP/1.1" 401 - 0 29 0 - "-" "curl/7.35.0" "9badd659-fa0e-9ca9-b4c0-9ac225571929" "httpbin.foo:8000" "-"
|
||
</code></pre></li></ol><h2 id=authorization-is-too-restrictive>授权过于严格</h2><p>当你第一次对一个服务启用授权,所有的请求都会被默认拒绝。在你增加上授权策略后,满足授权策略的请求才能够通过。如果所有的请求还是被拒绝,你可以尝试以下操作:</p><ol><li><p>确保在你的授权策略 YAML 文件中内容没有输入错误。</p></li><li><p>不要为 Istio 的控制面组件启用授权,包括 Mixer、Pilot、Ingress。Istio 授权策略是为访问 Istio 网格内服务的授权而设计的。如果对 Istio 的控制面启用授权会导致不可预期的行为。</p></li><li><p>确保你的 <code>ServiceRoleBinding</code> 和相关的 <code>ServiceRole</code> 对象在同一个命名空间(检查 <code>metadata/namespace</code> 这一行)。</p></li><li><p>请您不要为 TCP 服务的 <code>ServiceRole</code> 和 <code>ServiceRoleBinding</code> 设置那些仅适用于 HTTP 服务的属性字段。否则,Istio 会自动忽略这些配置,就好像它们不存在一样。</p></li><li><p>在 Kubernetes 环境,确保在一个 <code>ServiceRole</code> 对象下的所有服务都和 <code>ServiceRole</code> 在同一个 namespace 。例如,如果 <code>ServiceRole</code> 对象中的服务是 <code>a.default.svc.cluster.local</code>,<code>ServiceRole</code> 必须在 <code>default</code> 命名空间(<code>metadata/namespace</code> 这一行应该是 <code>default</code>)。对于非 Kubernetes 的环境,一个网格的所有 <code>ServiceRoles</code> 和 <code>ServiceRoleBindings</code> 都应该在相同的命名空间下。</p></li><li><p>根据<a href=#ensure-authorization-is-enabled-correctly>确保授权正确开启</a>找到确切的原因。</p></li></ol><h2 id=authorization-is-too-permissive>授权太过宽松</h2><p>如果已经对一个服务启用了授权,但是对这个服务的请求没有被阻止,那么很有可能是授权没有成功启用。通过以下步骤可以检查这种情况:</p><ol><li><p>检查<a href=/v1.7/zh/docs/concepts/security/#authorization>启用授权文档</a>来正确的启用 Istio 授权。</p></li><li><p>避免为 Istio 控制面组件启用授权,包括 Mixer,Pilot 和 Ingress。Istio 的授权是设计用于 Istio Mesh 下的服务之间的授权的。对 Istio 组件启用授权会引发不可预料的行为。</p></li><li><p>在你的 Kubernetes 环境中,检查所有命名空间下的部署,确保没有可能导致 Istio 错误的遗留的部署。如果发现在向 Envoy 推送授权策略的时候发生错误,你可以禁用 Pilot 的授权插件。</p></li><li><p>根据<a href=#ensure-authorization-is-enabled-correctly>确保授权正确开启</a>找到确切的原因</p></li></ol><h2 id=ensure-authorization-is-enabled-correctly>确保授权正确开启</h2><p><code>ClusterRbacConfig</code> 默认是集群级别的自定义资源,用于控制全局的授权功能。</p><ol><li><p>运行下面的命令,列出已存在的 <code>ClusterRbacConfig</code> 配置:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get clusterrbacconfigs.rbac.istio.io --all-namespaces
|
||
</code></pre></li><li><p>这里应该<strong>只有一个</strong>命名为 <code>default</code> 的 <code>ClusterRbacConfig</code> 实例。否则 Istio 会禁用授权功能并忽略所有策略。</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>NAMESPACE NAME AGE
|
||
default default 1d
|
||
</code></pre></li><li><p>如果有多个 <code>ClusterRbacConfig</code> 实例, 请删除其它的 <code>ClusterRbacConfig</code>,保证集群之中只有一个名为 <code>default</code> 的 <code>ClusterRbacConfig</code>。</p></li></ol><h2 id=ensure-pilot-accepts-the-policies>确保 Pilot 接受策略</h2><p>Pilot 负责对授权策略进行转换,并将其分发给 Sidecar。下面的的步骤可以用于确认 Pilot 是否按预期在工作:</p><ol><li><p>运行下列命令,导出 Pilot 的 <code>ControlZ</code>:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl port-forward $(kubectl -n istio-system get pods -l istio=pilot -o jsonpath='{.items[0].metadata.name}') -n istio-system 9876:9876
|
||
</code></pre></li><li><p>确保看到如下输出:</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>Forwarding from 127.0.0.1:9876 -> 9876
|
||
</code></pre></li><li><p>用浏览器打开 <code>http://127.0.0.1:9876/scopez/</code>,浏览 <code>ControlZ</code> 页面。</p></li><li><p>将 <code>rbac</code> 输出级别修改为 <code>debug</code>。</p></li><li><p>在步骤 1 中打开的终端窗口中输入 <code>Ctrl+C</code>,终止端口转发进程。</p></li><li><p>执行以下命令,输出 Pilot 日志并搜索 <code>rbac</code>:</p><div><aside class="callout tip"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-tip"/></svg></div><div class=content>你可能需要先删除并重建授权策略,以保证调试日志能够根据这些策略正常生成。</div></aside></div><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl logs $(kubectl -n istio-system get pods -l istio=pilot -o jsonpath='{.items[0].metadata.name}') -c discovery -n istio-system | grep rbac
|
||
</code></pre></li><li><p>检查输出并验证:</p><ul><li>没有出现错误。</li><li>出现 <code>"built filter config for ..."</code> 内容,意味着为目标服务生成了过滤器。</li></ul></li><li><p>例如你可能会看到类似这样的内容:</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>2018-07-26T22:25:41.009838Z debug rbac building filter config for {sleep.foo.svc.cluster.local map[app:sleep pod-template-hash:3326367878] map[destination.name:sleep destination.namespace:foo destination.user:default]}
|
||
2018-07-26T22:25:41.009915Z info rbac no service role in namespace foo
|
||
2018-07-26T22:25:41.009957Z info rbac no service role binding in namespace foo
|
||
2018-07-26T22:25:41.010000Z debug rbac generated filter config: { }
|
||
2018-07-26T22:25:41.010114Z info rbac built filter config for sleep.foo.svc.cluster.local
|
||
2018-07-26T22:25:41.182400Z debug rbac building filter config for {productpage.default.svc.cluster.local map[pod-template-hash:2600844901 version:v1 app:productpage] map[destination.name:productpage destination.namespace:default destination.user:bookinfo-productpage]}
|
||
2018-07-26T22:25:41.183131Z debug rbac checking role app2-grpc-viewer
|
||
2018-07-26T22:25:41.183214Z debug rbac role skipped for no AccessRule matched
|
||
2018-07-26T22:25:41.183255Z debug rbac checking role productpage-viewer
|
||
2018-07-26T22:25:41.183281Z debug rbac matched AccessRule[0]
|
||
2018-07-26T22:25:41.183390Z debug rbac generated filter config: {policies:<key:"productpage-viewer" value:<permissions:<and_rules:<rules:<or_rules:<rules:<header:<name:":method" exact_match:"GET" > > > > > > principals:<and_ids:<ids:<any:true > > > > > }
|
||
2018-07-26T22:25:41.184407Z info rbac built filter config for productpage.default.svc.cluster.local
|
||
</code></pre><p>说明 Pilot 生成了:</p><ul><li><p><code>sleep.foo.svc.cluster.local</code> 的空配置。因为没有符合条件的策略,并且 Istio 默认情况下,会禁止所有对这一服务的访问。</p></li><li><p><code>productpage.default.svc.cluster.local</code> 的配置。Istio 会放行所有针对该服务的 GET 访问。</p></li></ul></li></ol><h2 id=ensure-pilot-distributes-policies-to-proxies-correctly>确认 Pilot 正确的将策略分发给了代理服务器</h2><p>Pilot 负责向代理服务器分发授权策略。下面的步骤用来确认 Pilot 按照预期工作:</p><div><aside class="callout tip"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-tip"/></svg></div><div class=content>这一章节的命令假设用户已经部署了 <a href=/v1.7/zh/docs/examples/bookinfo/>Bookinfo</a>,否则的话应该将 <code>"-l app=productpage"</code> 部分根据实际情况进行替换。</div></aside></div><ol><li><p>运行下面的命令,获取 <code>productpage</code> 服务的代理配置信息:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl exec $(kubectl get pods -l app=productpage -o jsonpath='{.items[0].metadata.name}') -c istio-proxy -- pilot-agent request GET config_dump
|
||
</code></pre></li><li><p>校验日志内容:</p><ul><li>日志中包含了一个 <code>envoy.filters.http.rbac</code> 过滤器,会对每一个进入的请求执行授权策略。</li><li>授权策略更新之后,Istio 会据此更新过滤器。</li></ul></li><li><p>下面的输出表明,<code>productpage</code> 的代理启用了 <code>envoy.filters.http.rbac</code> 过滤器,配置的规则为允许任何人通过 <code>GET</code> 方法进行访问 <code>productpage</code> 服务。<code>shadow_rules</code> 没有生效,可以放心的忽略它。</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>{
|
||
"name": "envoy.filters.http.rbac",
|
||
"config": {
|
||
"rules": {
|
||
"policies": {
|
||
"productpage-viewer": {
|
||
"permissions": [
|
||
{
|
||
"and_rules": {
|
||
"rules": [
|
||
{
|
||
"or_rules": {
|
||
"rules": [
|
||
{
|
||
"header": {
|
||
"exact_match": "GET",
|
||
"name": ":method"
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
],
|
||
"principals": [
|
||
{
|
||
"and_ids": {
|
||
"ids": [
|
||
{
|
||
"any": true
|
||
}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"shadow_rules": {
|
||
"policies": {}
|
||
}
|
||
}
|
||
},
|
||
</code></pre></li></ol><h2 id=ensure-proxies-enforce-policies-correctly>确认策略在代理服务器中正确执行</h2><p>代理是授权策略的最终实施者。下面的步骤帮助用户确认代理的工作情况:</p><div><aside class="callout tip"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-tip"/></svg></div><div class=content>这里的命令假设用户已经部署了 <a href=/v1.7/zh/docs/examples/bookinfo/>Bookinfo</a>,否则的话应该将 <code>"-l app=productpage"</code> 部分根据实际情况进行替换。</div></aside></div><ol><li><p>使用以下命令,在代理中打开授权调试日志:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl exec $(kubectl get pods -l app=productpage -o jsonpath='{.items[0].metadata.name}') -c istio-proxy -- pilot-agent request POST 'logging?rbac=debug'
|
||
</code></pre></li><li><p>确认可以看到以下输出:</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>active loggers:
|
||
... ...
|
||
rbac: debug
|
||
... ...
|
||
</code></pre></li><li><p>在浏览器中打开 <code>productpage</code>,以便生成日志。</p></li><li><p>使用以下命令打印代理日志:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl logs $(kubectl get pods -l app=productpage -o jsonpath='{.items[0].metadata.name}') -c istio-proxy
|
||
</code></pre></li><li><p>检查输出,并验证:</p><ul><li><p>根据请求被允许或者被拒绝,分别输出日志包含 <code>enforced allowed</code> 或这 <code>enforced denied</code> 。</p></li><li><p>授权策略需要从请求中获取数据。</p></li></ul></li><li><p>下面的输出表示,对 <code>productpage</code> 的 <code>GET</code> 请求被策略放行。<code>shadow denied</code> 没有什么影响,你可以放心的忽略它。</p><pre><code class=language-plain data-expandlinks=true data-repo=istio>...
|
||
[2018-07-26 20:39:18.060][152][debug][rbac] external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:79] checking request: remoteAddress: 10.60.0.139:51158, localAddress: 10.60.0.93:9080, ssl: uriSanPeerCertificate: spiffe://cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account, subjectPeerCertificate: O=, headers: ':authority', '35.238.0.62'
|
||
':path', '/productpage'
|
||
':method', 'GET'
|
||
'upgrade-insecure-requests', '1'
|
||
'user-agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
|
||
'dnt', '1'
|
||
'accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
|
||
'accept-encoding', 'gzip, deflate'
|
||
'accept-language', 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7'
|
||
'x-forwarded-for', '10.60.0.1'
|
||
'x-forwarded-proto', 'http'
|
||
'x-request-id', 'e23ea62d-b25d-91be-857c-80a058d746d4'
|
||
'x-b3-traceid', '5983108bf6d05603'
|
||
'x-b3-spanid', '5983108bf6d05603'
|
||
'x-b3-sampled', '1'
|
||
'x-istio-attributes', 'CikKGGRlc3RpbmF0aW9uLnNlcnZpY2UubmFtZRINEgtwcm9kdWN0cGFnZQoqCh1kZXN0aW5hdGlvbi5zZXJ2aWNlLm5hbWVzcGFjZRIJEgdkZWZhdWx0Ck8KCnNvdXJjZS51aWQSQRI/a3ViZXJuZXRlczovL2lzdGlvLWluZ3Jlc3NnYXRld2F5LTc2NjY0Y2NmY2Ytd3hjcjQuaXN0aW8tc3lzdGVtCj4KE2Rlc3RpbmF0aW9uLnNlcnZpY2USJxIlcHJvZHVjdHBhZ2UuZGVmYXVsdC5zdmMuY2x1c3Rlci5sb2NhbApDChhkZXN0aW5hdGlvbi5zZXJ2aWNlLmhvc3QSJxIlcHJvZHVjdHBhZ2UuZGVmYXVsdC5zdmMuY2x1c3Rlci5sb2NhbApBChdkZXN0aW5hdGlvbi5zZXJ2aWNlLnVpZBImEiRpc3RpbzovL2RlZmF1bHQvc2VydmljZXMvcHJvZHVjdHBhZ2U='
|
||
'content-length', '0'
|
||
'x-envoy-internal', 'true'
|
||
'sec-istio-authn-payload', 'CkVjbHVzdGVyLmxvY2FsL25zL2lzdGlvLXN5c3RlbS9zYS9pc3Rpby1pbmdyZXNzZ2F0ZXdheS1zZXJ2aWNlLWFjY291bnQSRWNsdXN0ZXIubG9jYWwvbnMvaXN0aW8tc3lzdGVtL3NhL2lzdGlvLWluZ3Jlc3NnYXRld2F5LXNlcnZpY2UtYWNjb3VudA=='
|
||
, dynamicMetadata: filter_metadata {
|
||
key: "istio_authn"
|
||
value {
|
||
fields {
|
||
key: "request.auth.principal"
|
||
value {
|
||
string_value: "cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account"
|
||
}
|
||
}
|
||
fields {
|
||
key: "source.principal"
|
||
value {
|
||
string_value: "cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
[2018-07-26 20:39:18.060][152][debug][rbac] external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:88] shadow denied
|
||
[2018-07-26 20:39:18.060][152][debug][rbac] external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:98] enforced allowed
|
||
...
|
||
</code></pre></li></ol><h2 id=keys-and-certificates-errors>密钥和证书错误</h2><p>如果您怀疑 Istio 使用的某些密钥或证书不正确,那么第一步是确保 <a href=#repairing-citadel>Citadel 健康</a>。</p><p>然后,您可以验证 Citadel 是否真正生成了密钥和证书:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get secret istio.my-sa -n my-ns
|
||
NAME TYPE DATA AGE
|
||
istio.my-sa istio.io/key-and-cert 3 24d
|
||
</code></pre><p>其中 <code>my-ns</code> 和 <code>my-sa</code> 是您的 pod 运行的 namespace 和 Service Account 。</p><p>如果要检查其他 Service Account 的密钥和证书,可以运行以下命令列出 Citadel 生成的密钥和证书的所有的 secret:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get secret --all-namespaces | grep istio.io/key-and-cert
|
||
NAMESPACE NAME TYPE DATA AGE
|
||
.....
|
||
istio-system istio.istio-citadel-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-cleanup-old-ca-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-egressgateway-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-ingressgateway-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-mixer-post-install-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-mixer-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-pilot-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.istio-sidecar-injector-service-account istio.io/key-and-cert 3 14d
|
||
istio-system istio.prometheus istio.io/key-and-cert 3 14d
|
||
kube-public istio.default istio.io/key-and-cert 3 14d
|
||
.....
|
||
</code></pre><p>然后检查证书是否有效:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get secret -o json istio.my-sa -n my-ns | jq -r '.data["cert-chain.pem"]' | base64 --decode | openssl x509 -noout -text
|
||
Certificate:
|
||
Data:
|
||
Version: 3 (0x2)
|
||
Serial Number:
|
||
99:59:6b:a2:5a:f4:20:f4:03:d7:f0:bc:59:f5:d8:40
|
||
Signature Algorithm: sha256WithRSAEncryption
|
||
Issuer: O = k8s.cluster.local
|
||
Validity
|
||
Not Before: Jun 4 20:38:20 2018 GMT
|
||
Not After : Sep 2 20:38:20 2018 GMT
|
||
Subject: O =
|
||
Subject Public Key Info:
|
||
Public Key Algorithm: rsaEncryption
|
||
Public-Key: (2048 bit)
|
||
Modulus:
|
||
00:c8:a0:08:24:61:af:c1:cb:81:21:90:cc:03:76:
|
||
01:25:bc:ff:ca:25:fc:81:d1:fa:b8:04:aa:d4:6b:
|
||
55:e9:48:f2:e4:ab:22:78:03:47:26:bb:8f:22:10:
|
||
66:47:47:c3:b2:9a:70:f1:12:f1:b3:de:d0:e9:2d:
|
||
28:52:21:4b:04:33:fa:3d:92:8c:ab:7f:cc:74:c9:
|
||
c4:68:86:b0:4f:03:1b:06:33:48:e3:5b:8f:01:48:
|
||
6a:be:64:0e:01:f5:98:6f:57:e4:e7:b7:47:20:55:
|
||
98:35:f9:99:54:cf:a9:58:1e:1b:5a:0a:63:ce:cd:
|
||
ed:d3:a4:88:2b:00:ee:b0:af:e8:09:f8:a8:36:b8:
|
||
55:32:80:21:8e:b5:19:c0:2f:e8:ca:4b:65:35:37:
|
||
2f:f1:9e:6f:09:d4:e0:b1:3d:aa:5f:fe:25:1a:7b:
|
||
d4:dd:fe:d1:d3:b6:3c:78:1d:3b:12:c2:66:bd:95:
|
||
a8:3b:64:19:c0:51:05:9f:74:3d:6e:86:1e:20:f5:
|
||
ed:3a:ab:44:8d:7c:5b:11:14:83:ee:6b:a1:12:2e:
|
||
2a:0e:6b:be:02:ad:11:6a:ec:23:fe:55:d9:54:f3:
|
||
5c:20:bc:ec:bf:a6:99:9b:7a:2e:71:10:92:51:a7:
|
||
cb:79:af:b4:12:4e:26:03:ab:35:e2:5b:00:45:54:
|
||
fe:91
|
||
Exponent: 65537 (0x10001)
|
||
X509v3 extensions:
|
||
X509v3 Key Usage: critical
|
||
Digital Signature, Key Encipherment
|
||
X509v3 Extended Key Usage:
|
||
TLS Web Server Authentication, TLS Web Client Authentication
|
||
X509v3 Basic Constraints: critical
|
||
CA:FALSE
|
||
X509v3 Subject Alternative Name:
|
||
URI:spiffe://cluster.local/ns/my-ns/sa/my-sa
|
||
Signature Algorithm: sha256WithRSAEncryption
|
||
78:77:7f:83:cc:fc:f4:30:12:57:78:62:e9:e2:48:d6:ea:76:
|
||
69:99:02:e9:62:d2:53:db:2c:13:fe:0f:00:56:2b:83:ca:d3:
|
||
4c:d2:01:f6:08:af:01:f2:e2:3e:bb:af:a3:bf:95:97:aa:de:
|
||
1e:e6:51:8c:21:ee:52:f0:d3:af:9c:fd:f7:f9:59:16:da:40:
|
||
4d:53:db:47:bb:9c:25:1a:6e:34:41:42:d9:26:f7:3a:a6:90:
|
||
2d:82:42:97:08:f4:6b:16:84:d1:ad:e3:82:2c:ce:1c:d6:cd:
|
||
68:e6:b0:5e:b5:63:55:3e:f1:ff:e1:a0:42:cd:88:25:56:f7:
|
||
a8:88:a1:ec:53:f9:c1:2a:bb:5c:d7:f8:cb:0e:d9:f4:af:2e:
|
||
eb:85:60:89:b3:d0:32:60:b4:a8:a1:ee:f3:3a:61:60:11:da:
|
||
2d:7f:2d:35:ce:6e:d4:eb:5c:82:cf:5c:9a:02:c0:31:33:35:
|
||
51:2b:91:79:8a:92:50:d9:e0:58:0a:78:9d:59:f4:d3:39:21:
|
||
bb:b4:41:f9:f7:ec:ad:dd:76:be:28:58:c0:1f:e8:26:5a:9e:
|
||
7b:7f:14:a9:18:8d:61:d1:06:e3:9e:0f:05:9e:1b:66:0c:66:
|
||
d1:27:13:6d:ab:59:46:00:77:6e:25:f6:e8:41:ef:49:58:73:
|
||
b4:93:04:46
|
||
</code></pre><p>确保显示的证书包含有效信息。特别是,Subject Alternative Name 字段应为 <code>URI:spiffe://cluster.local/ns/my-ns/sa/my-sa</code>。
|
||
如果不是这样,您的 Citadel 可能已经出现问题。尝试重新部署 Citadel 并再次检查。</p><p>最后,您可以验证密钥和证书是否由 sidecar 代理正确安装在 <code>/etc/certs</code> 目录中。您可以使用此命令检查:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl exec -it my-pod-id -c istio-proxy -- ls /etc/certs
|
||
cert-chain.pem key.pem root-cert.pem
|
||
</code></pre><p>(可选)您可以使用以下命令检查其内容:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl exec -it my-pod-id -c istio-proxy -- cat /etc/certs/cert-chain.pem | openssl x509 -text -noout
|
||
Certificate:
|
||
Data:
|
||
Version: 3 (0x2)
|
||
Serial Number:
|
||
7e:b4:44:fe:d0:46:ba:27:47:5a:50:c8:f0:8e:8b:da
|
||
Signature Algorithm: sha256WithRSAEncryption
|
||
Issuer: O = k8s.cluster.local
|
||
Validity
|
||
Not Before: Jul 13 01:23:13 2018 GMT
|
||
Not After : Oct 11 01:23:13 2018 GMT
|
||
Subject: O =
|
||
Subject Public Key Info:
|
||
Public Key Algorithm: rsaEncryption
|
||
Public-Key: (2048 bit)
|
||
Modulus:
|
||
00:bb:c9:cd:f4:b8:b5:e4:3b:f2:35:aa:4c:67:cc:
|
||
1b:a9:30:c4:b7:fd:0a:f5:ac:94:05:b5:82:96:b2:
|
||
c8:98:85:f9:fc:09:b3:28:34:5e:79:7e:a9:3c:58:
|
||
0a:14:43:c1:f4:d7:b8:76:ab:4e:1c:89:26:e8:55:
|
||
cd:13:6b:45:e9:f1:67:e1:9b:69:46:b4:7e:8c:aa:
|
||
fd:70:de:21:15:4f:f5:f3:0f:b7:d4:c6:b5:9d:56:
|
||
ef:8a:91:d7:16:fa:db:6e:4c:24:71:1c:9c:f3:d9:
|
||
4b:83:f1:dd:98:5b:63:5c:98:5e:2f:15:29:0f:78:
|
||
31:04:bc:1d:c8:78:c3:53:4f:26:b2:61:86:53:39:
|
||
0a:3b:72:3e:3d:0d:22:61:d6:16:72:5d:64:e3:78:
|
||
c8:23:9d:73:17:07:5a:6b:79:75:91:ce:71:4b:77:
|
||
c5:1f:60:f1:da:ca:aa:85:56:5c:13:90:23:02:20:
|
||
12:66:3f:8f:58:b8:aa:72:9d:36:f1:f3:b7:2b:2d:
|
||
3e:bb:7c:f9:b5:44:b9:57:cf:fc:2f:4b:3c:e6:ee:
|
||
51:ba:23:be:09:7b:e2:02:6a:6e:e7:83:06:cd:6c:
|
||
be:7a:90:f1:1f:2c:6d:12:9e:2f:0f:e4:8c:5f:31:
|
||
b1:a2:fa:0b:71:fa:e1:6a:4a:0f:52:16:b4:11:73:
|
||
65:d9
|
||
Exponent: 65537 (0x10001)
|
||
X509v3 extensions:
|
||
X509v3 Key Usage: critical
|
||
Digital Signature, Key Encipherment
|
||
X509v3 Extended Key Usage:
|
||
TLS Web Server Authentication, TLS Web Client Authentication
|
||
X509v3 Basic Constraints: critical
|
||
CA:FALSE
|
||
X509v3 Subject Alternative Name:
|
||
URI:spiffe://cluster.local/ns/default/sa/bookinfo-productpage
|
||
Signature Algorithm: sha256WithRSAEncryption
|
||
8f:be:af:a4:ee:f7:be:21:e9:c8:c9:e2:3b:d3:ac:41:18:5d:
|
||
f8:9a:85:0f:98:f3:35:af:b7:e1:2d:58:5a:e0:50:70:98:cc:
|
||
75:f6:2e:55:25:ed:66:e7:a4:b9:4a:aa:23:3b:a6:ee:86:63:
|
||
9f:d8:f9:97:73:07:10:25:59:cc:d9:01:09:12:f9:ab:9e:54:
|
||
24:8a:29:38:74:3a:98:40:87:67:e4:96:d0:e6:c7:2d:59:3d:
|
||
d3:ea:dd:6e:40:5f:63:bf:30:60:c1:85:16:83:66:66:0b:6a:
|
||
f5:ab:60:7e:f5:3b:44:c6:11:5b:a1:99:0c:bd:53:b3:a7:cc:
|
||
e2:4b:bd:10:eb:fb:f0:b0:e5:42:a4:b2:ab:0c:27:c8:c1:4c:
|
||
5b:b5:1b:93:25:9a:09:45:7c:28:31:13:a3:57:1c:63:86:5a:
|
||
55:ed:14:29:db:81:e3:34:47:14:ba:52:d6:3c:3d:3b:51:50:
|
||
89:a9:db:17:e4:c4:57:ec:f8:22:98:b7:e7:aa:8a:72:28:9a:
|
||
a7:27:75:60:85:20:17:1d:30:df:78:40:74:ea:bc:ce:7b:e5:
|
||
a5:57:32:da:6d:f2:64:fb:28:94:7d:28:37:6f:3c:97:0e:9c:
|
||
0c:33:42:f0:b6:f5:1c:0d:fb:70:65:aa:93:3e:ca:0e:58:ec:
|
||
8e:d5:d0:1e
|
||
</code></pre><h2 id=mutual-TLS-errors>双向 TLS 错误</h2><p>如果怀疑双向 TLS 出现了问题,首先要确认 <a href=#repairing-citadel>Citadel 健康</a>,接下来要查看的是<a href=#keys-and-certificates-errors>密钥和证书正确下发</a> Sidecar.</p><p>如果上述检查都正确无误,下一步就应该验证<a href=/v1.7/zh/docs/tasks/security/authentication/authn-policy/>认证策略</a>已经创建,并且对应的目标规则是否正确应用。</p><h2 id=repairing-citadel>Citadel 行为异常</h2><div><aside class="callout warning"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-warning"/></svg></div><div class=content>Citadel 不支持多个实例运行,否则会造成竞争状态并导致系统崩溃。</div></aside></div><div><aside class="callout warning"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-warning"/></svg></div><div class=content>在 Citadel 维护禁用期间,带有新 ServiceAccount 的负载不能够启动,因为它不能从 Citadel 获取生成的证书。</div></aside></div><p>Citadel 不是关键的数据平面组件。默认的工作负载证书有效期是 3 个月。证书在过期前会被 Citadel 轮换。如果在 Citadel 短暂的维护期间内,已经存在的 双向 TLS 不会受影响。</p><p>如果您怀疑 Citadel 无法正常工作,请验证 <code>istio-citadel</code> pod 的状态:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get pod -l istio=citadel -n istio-system
|
||
NAME READY STATUS RESTARTS AGE
|
||
istio-citadel-ff5696f6f-ht4gq 1/1 Running 0 25d
|
||
</code></pre><p>如果 <code>istio-citadel</code> pod 不存在,请尝试重新部署 pod。</p><p>如果 <code>istio-citadel</code> pod 存在但其状态不是 <code>Running</code> ,请运行以下命令以获得更多调试信息并检查是否有任何错误:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl logs -l istio=citadel -n istio-system
|
||
$ kubectl describe pod -l istio=citadel -n istio-system
|
||
</code></pre><p>如果想要检查一个工作负载(在 <code>default</code> 命名空间 ,并且使用 <code>default</code> ServiceAccount )的证书有效期:</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ kubectl get secret -o json istio.default -n default | jq -r '.data["cert-chain.pem"]' | base64 --decode | openssl x509 -noout -text | grep "Not After" -C 1
|
||
Not Before: Jun 1 18:23:30 2019 GMT
|
||
Not After : Aug 30 18:23:30 2019 GMT
|
||
Subject:
|
||
</code></pre><div><aside class="callout tip"><div class=type><svg class="large-icon"><use xlink:href="/v1.7/img/icons.svg#callout-tip"/></svg></div><div class=content>不要忘记将 <code>istio.default</code> 和 <code>-n default</code> 替换成 <code>istio.YourServiceAccount</code> 和 <code>-n YourNamespace</code>。如果证书已经过期,Citadel 没有及时更新 secret,请检查 Citadel 日志查以获取更多信息。</div></aside></div><nav id=see-also><h2>相关内容</h2><div class=see-also><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2020/tradewinds-2020/>Istio 2020——为了商用</a></p><p class=desc>Istio 在 2020 年的愿景声明及路线图。</p></div><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2020/istio-agent/>移除跨 pod Unix domain socket</a></p><p class=desc>一种更安全的秘密管理方式。</p></div><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2019/dns-cert/>DNS 证书管理</a></p><p class=desc>在 Istio 中配置和管理 DNS 证书。</p></div><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2019/v1beta1-authorization-policy/>Istio v1beta1 授权策略概述</a></p><p class=desc>Istio v1beta1 授权策略的设计原则、基本概述及迁移操作。</p></div><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2019/webhook/>安全管理 Webhook</a></p><p class=desc>一种更安全管理 Istio webhook 的方法。</p></div><div class=entry><p class=link><a data-skipendnotes=true href=/v1.7/zh/blog/2019/isolated-clusters/>用于隔离和边界保护的多网格部署</a></p><p class=desc>将需要隔离的环境部署到单独的网格中,并通过网格联邦启用网格间通信。</p></div></div></nav></article><nav class=pagenav><div class=left><a title="定位常见的 Istio 流量管理和网络问题的技术。" href=/v1.7/zh/docs/ops/common-problems/network-issues/><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#left-arrow"/></svg>流量管理问题</a></div><div class=right><a title="处理 Telemetry 收集问题。" href=/v1.7/zh/docs/ops/common-problems/observability-issues/>可观测性问题<svg class="icon"><use xlink:href="/v1.7/img/icons.svg#right-arrow"/></svg></a></div></nav><div id=feedback><div id=feedback-initial>这些信息有用吗?<br><button class="btn feedback" onclick="sendFeedback('zh',1)">是的</button>
|
||
<button class="btn feedback" onclick="sendFeedback('zh',0)">没有</button></div><div id=feedback-comment>Do you have any suggestions for improvement?<br><br><input id=feedback-textbox type=text placeholder="Help us improve..." data-lang=zh></div><div id=feedback-thankyou>Thanks for your feedback!</div></div><div id=endnotes-container aria-hidden=true><h2>链接</h2><ol id=endnotes></ol></div></div></main><footer><div class=user-links><a class=channel title="立刻下载 Istio 1.7.4" href=/v1.7/docs/setup/getting-started/#download aria-label="Download Istio"><span>download</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#download"/></svg>
|
||
</a><a class=channel title="加入 Istio discussion board 参与讨论获取帮助" href=https://discuss.istio.io aria-label="Istio discussion board"><span>discuss</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#discourse"/></svg></a>
|
||
<a class=channel title="Stack Overflow 中列举了针对实际问题以及部署、配置和使用 Istio 的各项回答" href=https://stackoverflow.com/questions/tagged/istio aria-label="Stack Overflow"><span>stack overflow</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#stackoverflow"/></svg></a>
|
||
<a class=channel title="在 Slack 上与 Istio 社区交互讨论开发问题(仅限邀请)" href=https://slack.istio.io aria-label=slack><span>slack</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#slack"/></svg></a>
|
||
<a class=channel title="关注我们的 Twitter 来获取最新信息" href=https://twitter.com/IstioMesh aria-label=Twitter><span>twitter</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#twitter"/></svg></a><div class=tag>对于用户</div></div><div class=info><p class=copyright>中文内容由 ServiceMesher 社区维护,部分文档可能稍微滞后于英文版本,同步工作持续进行中<br>Istio 归档
|
||
1.7.4<br>© 2020 Istio Authors, <a href=https://policies.google.com/privacy>隐私政策</a><br>归档于 2020年11月19日</p></div><div class=dev-links><a class=channel title="Istio 的代码在 GitHub 上开发" href=https://github.com/istio/community aria-label=GitHub><span>github</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#github"/></svg></a>
|
||
<a class=channel title="如果您想深入了解 Istio 的技术细节,请查看我们日益完善的设计文档" href=https://groups.google.com/forum/#!forum/istio-team-drive-access aria-label="team drive"><span>drive</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#drive"/></svg></a>
|
||
<a class=channel title="如果您想为 Istio 项目做出贡献,请考虑加入我们的工作组" href=https://github.com/istio/community/blob/master/WORKING-GROUPS.md aria-label="working groups"><span>working groups</span><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#working-groups"/></svg></a><div class=tag>对于开发者</div></div></footer><div id=scroll-to-top-container aria-hidden=true><button id=scroll-to-top title=回到顶部><svg class="icon"><use xlink:href="/v1.7/img/icons.svg#top"/></svg></button></div></body></html> |