istio中文手册
  • 前言
    • 序言
  • 概念原理
    • 什么是服务网格?
    • 后 Kubernetes 时代的应用网络
    • 服务网格架构
      • 服务网格的实现模式
      • Istio 架构解析
    • Sidecar 模式
      • Istio 中的 Sidecar 注入与流量劫持详解
      • Sidecar 的自动注入过程详解
    • 流量管理
      • 流量管理基础概念
      • Istio 中的 Sidecar 的流量路由详解
    • 安全
      • mTLS
  • 数据平面
    • Envoy 中的基本术语
    • Istio sidecar proxy 配置
    • Envoy proxy 配置详解
    • Envoy API
    • xDS 协议解析
      • LDS(监听器发现服务)
      • RDS(路由发现服务)
      • CDS(集群发现服务)
      • EDS(端点发现服务)
      • SDS(秘钥发现服务)
      • ADS(聚合发现服务)
      • HDS(健康发现服务)
    • Envoy 高级 API
      • MS(Metric 服务)
      • RLS(速率限制服务)
  • 安装指南
    • 快速开始
    • Istio 安装
    • 可观察性工具 kiali
  • 配置
    • 流量管理
      • VirtualService
      • DestinationRule
      • Gateway
      • EnvoyFilter
      • Sidecar
      • ServiceEntry
      • WorkloadEntry
      • WorkloadGroup
    • 安全
      • AuthorizationPolicy
      • RequestAuthentication
      • PeerAuthentication
      • JWTRule
  • Istio 生态
    • Istio 生态概述
    • Slime——基于 Istio 的智能服务网格管理器
  • 开发指南
    • Istio 开发环境配置
  • 实践案例
    • Bookinfo 示例
由 GitBook 提供支持
在本页
  • PeerAuthentication
  • 示例
  • 参考

这有帮助吗?

  1. 配置
  2. 安全

PeerAuthentication

PeerAuthentication

PeerAuthentication(对等认证)定义了流量将如何被隧道化(或不被隧道化)到 sidecar。

示例

策略允许命名空间 foo 下所有工作负载的 mTLS 流量。

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: foo
spec:
  mtls:
    mode: STRICT

对于网格级别,根据你的 Istio 安装,将策略放在根命名空间。

策略允许命名空间 foo 下的所有工作负载的 mTLS 和明文流量,但 finance 的工作负载需要 mTLS。

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: foo
spec:
  mtls:
    mode: PERMISSIVE
---
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: foo
spec:
  selector:
    matchLabels:
      app: finance
  mtls:
    mode: STRICT

政策允许所有工作负载严格 mTLS,但 8080 端口保留为明文。

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: foo
spec:
  selector:
    matchLabels:
      app: finance
  mtls:
    mode: STRICT
  portLevelMtls:
    8080:
      mode: DISABLE

从命名空间(或网格)设置中继承 mTLS 模式的策略,并覆盖 8080 端口的设置。

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: foo
spec:
  selector:
    matchLabels:
      app: finance
  mtls:
    mode: UNSET
  portLevelMtls:
    8080:
      mode: DISABLE

参考

上一页RequestAuthentication下一页JWTRule

最后更新于3年前

这有帮助吗?

关于 PeerAuthentication 配置的详细用法请参考 。

Istio 官方文档
PeerAuthentication- istio.io