How can services securely communicate with each other?

Secure service-to-service communication in microservices combines encryption in transit, mutual authentication, and access control at the network and API level.

Key Points

Example

In a Kubernetes cluster running Istio, the service mesh automatically enforces mTLS between pods, while an API Gateway validates a JWT on incoming external requests before they ever reach an internal service, so both external and internal traffic are authenticated.

# Istio: only order-service may call payment-service (identity comes from mTLS)
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
  name: payment-allow-orders
  namespace: shop
spec:
  selector:
    matchLabels:
      app: payment-service
  action: ALLOW
  rules:
    - from:
        - source:
            principals: ["cluster.local/ns/shop/sa/order-service"]
      to:
        - operation:
            methods: ["POST"]
            paths: ["/payments*"]

Interview Tip

A concise interview answer is

I'd secure inter-service communication with TLS for encryption, mutual TLS so services authenticate each other, and an API Gateway or service mesh to centralize enforcement instead of building it into every service. Access tokens or API keys on top of that ensure only authorized callers can invoke a given service.

Last updated: 1 November 2026

Previous question: What are the common security patterns applicable in microservices?

Next question: What are the implications of service-specific databases on security?

More Microservices - Level I interview questions

All Microservices - Level I questions