技能 mtls-configuration
📦

mtls-configuration

安全

为零信任Kubernetes配置mTLS

也可从以下获取: wshobson

本技能提供全面的mTLS配置模板和最佳实践,帮助使用Istio、Linkerd和SPIFFE在Kubernetes中保护服务间通信安全。

支持: Claude Codex Code(CC)
📊 71 充足
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“mtls-configuration”。 How do I enable strict mTLS in Istio?

预期结果:

要在Istio中启用全网格严格的mTLS,请应用PeerAuthentication资源...

正在使用“mtls-configuration”。 Configure mTLS for external API

预期结果:

对于外部服务,请使用DestinationRule并设置SIMPLE或MUTUAL TLS模式...

正在使用“mtls-configuration”。 Debug TLS handshake failures

预期结果:

使用istioctl authn tls-check验证mTLS状态,然后检查对等身份验证...

安全审计

安全
v1 • 2/25/2026

This is a documentation skill providing mTLS configuration templates for Kubernetes service meshes (Istio, Linkerd, SPIFFE). All 42 static findings are false positives: external_commands detected are kubectl/istioctl examples in code blocks (not execution), network references are documentation URLs, certificate paths are template examples (not real credentials), and weak crypto flags were triggered by TLS mode names (ISTIO_MUTUAL, MUTUAL) which are standard secure configurations. No malicious intent or security risks identified.

1
已扫描文件
362
分析行数
6
发现项
1
审计总数

高风险问题 (1)

False Positive: External Commands Detection
Static scanner detected 'Ruby/shell backtick execution' at 18 locations. These are kubectl, istioctl, openssl command examples in markdown code blocks - not actual execution. Users would run these commands themselves as part of mTLS configuration.
中风险问题 (3)
False Positive: Certificate File References
Static scanner flagged certificate/key file paths as sensitive. These are template paths in YAML configurations (e.g., /etc/certs/client.pem), not actual certificates.
False Positive: Network URL References
Static scanner flagged hardcoded URLs. These are legitimate documentation URLs to Istio, SPIFFE, cert-manager, and NIST - appropriate for a reference skill.
False Positive: Weak Cryptographic Algorithm
Static scanner flagged 'weak crypto' at 8 locations. The skill uses TLS modes ISTIO_MUTUAL, MUTUAL, and SIMPLE which are standard secure configurations - not weak algorithms.
低风险问题 (2)
False Positive: SQLite Database Reference
Static scanner flagged SQLite path. This is SPIRE server's standard datastore configuration - legitimate operational documentation.
False Positive: Hardcoded IP Address
Static scanner flagged bind_address. The 0.0.0.0 is standard SPIRE server configuration to listen on all interfaces - not a security issue.
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
76
安全
100
规范符合性

你能构建什么

DevOps工程师设置服务网格安全

为Istio服务网格中的所有服务配置严格的mTLS,以满足PCI-DSS合规要求。

安全架构师设计证书授权机构

使用cert-manager与Istio集成设计证书层次结构,实现自动轮换。

开发者排查mTLS握手失败问题

使用提供的调试命令诊断服务间调用失败并出现TLS错误的原因。

试试这些提示

基础mTLS设置
如何在Istio中启用全网格严格的mTLS?显示所需的YAML配置。
外部服务mTLS
配置mTLS以连接到外部合作伙伴API。合作伙伴提供其CA证书。
证书轮换
使用cert-manager设置自动证书轮换,证书有效期为24小时。
调试TLS问题
我的服务出现TLS握手错误。显示如何在Istio中调试mTLS问题。

最佳实践

  • 从PERMISSIVE模式开始,逐渐迁移到STRICT模式,以避免服务中断
  • 使用短生命周期证书(24小时或更短),以限制密钥泄露的影响
  • 监控证书到期时间,并在轮换截止日期前设置自动警报
  • 实施正确的CA层次结构,使用根CA和中间CA进行隔离

避免

  • 为方便起见在生产环境中禁用mTLS——这违背了零信任安全模型
  • 使用自签名证书而不建立正确的CA层次结构——难以管理和审计
  • 忽略证书到期日期——导致证书过期时服务中断
  • 跳过TLS验证以解决连接问题——造成安全漏洞

常见问题

什么是mTLS?
双向TLS(mTLS)是一种安全协议,客户端和服务器都使用证书相互认证。它确保只有授权的服务才能通信。
我需要服务网格来实现mTLS吗?
Istio和Linkerd等服务网格使用边车代理自动实现mTLS。您也可以使用服务库手动实现mTLS,但需要更多配置。
我应该多久轮换一次证书?
最佳实践是使用短生命周期证书(24小时或更短)并实现自动轮换。如果证书被泄露,这可以限制暴露窗口。
PERMISSIVE和STRICT mTLS有什么区别?
PERMISSIVE允许mTLS和纯文本流量。STRICT要求所有流量使用mTLS。在迁移期间使用PERMISSIVE,然后切换到STRICT。
如何调试mTLS问题?
使用istioctl authn tls-check验证mTLS状态,检查PeerAuthentication和DestinationRule配置,并查看代理日志中的TLS错误。
mTLS可以跨集群工作吗?
是的,您可以使用共享CA或网格联合配置跨集群mTLS。SPIFFE/SPIRE提供的工作负载身份可在集群边界之间工作。

开发者详情

文件结构

📄 SKILL.md