AGENT SKILL

service-mesh-istio-cilium

Architect, configure, and secure cloud-native service meshes using Istio and Cilium eBPF. Implement mutual TLS (mTLS STRICT), traffic splitting, canary rollouts, circuit breaking, fault injection, rate limiting, and kernel-level eBPF L7 observability. Trigger when configuring Kubernetes network policies, service-to-service encryption, or advanced ingress/egress routing.

License 许可
MIT
最近更新
2026-10-17
Stars
★ 8
Forks
1

01 前言 Front Matter

name
service-mesh-istio-cilium
metadata
{ "category": "Network Engineering and Edge Routing" }
description
Architect, configure, and secure cloud-native service meshes using Istio and Cilium eBPF. Implement mutual TLS (mTLS STRICT), traffic splitting, canary rollouts, circuit breaking, fault injection, rate limiting, and kernel-level eBPF L7 observability. Trigger when configuring Kubernetes network policies, service-to-service encryption, or advanced ingress/egress routing.
compatibility
Kubernetes 1.28+, Istio 1.20+, Cilium 1.15+

03 SKILL.md 正文

Service Mesh (Istio & Cilium eBPF) Skill Guide

This skill guides engineering teams through designing and maintaining secure, observable service-to-service networks using Istio control plane and Cilium eBPF kernel datapath.


1. Dual-Engine Architecture: Cilium eBPF + Istio

[ Kubernetes Pod A ]                     [ Kubernetes Pod B ]
        |                                        ^
        v (Envoy Sidecar / Ambient)              |
[ Istio L7 Policy Engine ]                       |
  - mTLS Encryption (SPIFFE / SPIRE)             |
  - Circuit Breakers & Retries                   |
        |                                        |
        v                                        |
+-------------------------------------------------------------+
| Linux Kernel eBPF (Cilium Datapath)                         |
| - Sockops socket-level acceleration (bypass TCP/IP stack)   |
| - L3/L4 NetworkPolicy enforcement                           |
| - Hubble Flow Observability & DNS proxy                     |
+-------------------------------------------------------------+

2. Production Manifests & Configuration

A. Strict Mutual TLS (mTLS) PeerAuthentication

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: production
spec:
  mtls:
    mode: STRICT # Rejects all non-mTLS plaintext connections
---
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
  name: order-service-authz
  namespace: production
spec:
  selector:
    matchLabels:
      app: order-service
  action: ALLOW
  rules:
  - from:
    - source:
        principals: ["cluster.local/ns/production/sa/frontend-service-account"]
    to:
    - operation:
        methods: ["GET", "POST"]
        paths: ["/api/v1/orders*"]

B. Canary Traffic Splitting & Circuit Breaking

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: payment-service-vs
  namespace: production
spec:
  hosts:
  - payment-service
  http:
  - route:
    - destination:
        host: payment-service
        subset: v1
      weight: 90
    - destination:
        host: payment-service
        subset: v2-canary
      weight: 10
    timeout: 3s
    retries:
      attempts: 3
      perTryTimeout: 1s
      retryOn: "5xx,connect-failure,refused-stream"
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: payment-service-dr
  namespace: production
spec:
  host: payment-service
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2-canary
    labels:
      version: v2
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        http1MaxPendingRequests: 50
        maxRequestsPerConnection: 10
    outlierDetection: # Circuit Breaker
      consecutive5xxErrors: 3
      interval: 10s
      baseEjectionTime: 30s
      maxEjectionPercent: 50

C. Cilium eBPF L3/L4 Network Policy with DNS Inspection

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: secure-backend-egress
  namespace: production
spec:
  endpointSelector:
    matchLabels:
      app: backend-worker
  egress:
  # Allow internal DNS queries
  - toEndpoints:
    - matchLabels:
        "k8s:io.kubernetes.pod.namespace": kube-system
        k8s-app: kube-dns
    toPorts:
    - ports:
      - port: "53"
        protocol: UDP
      rules:
        dns:
        - matchPattern: "*"
  # Restrict external egress to authorized payment gateway
  - toFQDNs:
    - matchName: "api.stripe.com"
    toPorts:
    - ports:
    - port: "443"
      protocol: TCP

3. Best Practices & Troubleshooting

  1. Verify mTLS: Use istioctl proxy-status and istioctl authn tls-check <pod-name> to verify cryptographic identity handshakes.
  2. eBPF Acceleration: Enable Cilium sockops (sockops.enabled=true) to bypass the host TCP stack for co-located pods, cutting intra-node latency by up to 40%.
  3. Hubble Observability: Run hubble observe --namespace production --verdict DROPPED to troubleshoot blocked network packets in real time.

04 同仓库更多 Skills

hamzabellouch
hamzabellouch/agent-skills

security-audit

Comprehensive security guidance, source code audit, vulnerability assessment, and penetration test review for codebases, APIs, microservices, CLI tools, libraries, and LLM-backed applications. Triggers on requests to audit a codebase, conduct security reviews, find vulnerabilities or flaws, pen-test source code, or when the user asks in Arabic (فحص أمني، تدقيق الكود أمنياً، مراجعة الثغرات، فحص أمان المشروع). Supports Guidance mode (focused review) and Full Audit mode (deterministic 6-phase harness).

★ 8
hamzabellouch
hamzabellouch/agent-skills

malware-analysis-reversing

Production malware analysis workflows, reverse engineering methodologies, isolated sandbox triage, static/dynamic binary analysis, memory forensics, and YARA detection rule authoring.

★ 8
hamzabellouch
hamzabellouch/agent-skills

application-security-pentesting

Production Application Security (AppSec) standards, OWASP Top 10 vulnerability remediation, SAST/DAST pipeline integration, secure code review, threat modeling, and defensive security posture.

★ 8
hamzabellouch
hamzabellouch/agent-skills

oauth2-oidc-security-flows

Implement enterprise OAuth 2.1 and OpenID Connect (OIDC) authorization code flow with Proof Key for Code Exchange (PKCE), state and nonce verification, refresh token rotation, token revocation, and centralized IdP federation (Keycloak, Auth0, Okta). Trigger when building secure authentication, single sign-on (SSO), or third-party delegated authorization.

★ 8
hamzabellouch
hamzabellouch/agent-skills

jwt-session-management-hardening

Harden JWT-based authentication and session lifecycles using asymmetric signing (RS256/EdDSA), JWKS rotation, strict claims validation, Redis-backed sliding window sessions, revocation lists, and secure HttpOnly cookie storage. Trigger when implementing token validation, session revocation, or hardening API authentication.

★ 8
hamzabellouch
hamzabellouch/agent-skills

soc2-compliance-automation

Best practices for implementing SOC 2 Type II compliance controls, continuous evidence collection, infrastructure policy-as-code, and automated security monitoring. Use when automating Trust Services Criteria (Security, Availability, Confidentiality, Processing Integrity, Privacy), audit logging, IAM least privilege, or CI/CD security gates.

★ 8