- You run a payments service that should only be called by trusted internal services (for example, the order service).
- Public users or anything on the internet must never reach the payments service directly.
- When a user places an order, the order service calls the payments service to charge the card. That is the only legitimate caller.
- Ensure the payments service has no public exposure.
- Prevent lateral attacks inside the cluster.
- Enforce cryptographic identity for services.
- Apply fine-grained authorization so only intended callers reach specific endpoints.
- Network exposure: remove any public address
- First, ensure the payments service does not receive a public IP or direct internet exposure.
- In Kubernetes, use a
ClusterIPService (the default) instead ofLoadBalancerorNodePortso the service is not reachable from outside the cluster.
ClusterIP):

- NetworkPolicy: pod-level firewall to restrict which pods may connect
- Kubernetes NetworkPolicy is an allow-list model. When you attach an ingress policy to the payments pods, only explicitly allowed sources can reach them.
- NetworkPolicy blocks unwanted pod-to-pod connections at the network layer, reducing the blast radius if a frontend pod is compromised.
app=order to talk to payments on port 8443:

- NetworkPolicy enforces connectivity based on selectors that resolve to pod IPs; IPs are not strong cryptographic identities.
- A network-level allow-list does not verify the caller at the application level (who is making the request and whether they are authorized to call a specific API).

- Mutual TLS (mTLS): cryptographic service identity and transport security
- mTLS ensures both client and server present and verify certificates. Every connection is authenticated and encrypted.
- Use short-lived certificates issued to each service instance. With mTLS, attackers inside the cluster without valid certs cannot impersonate a legitimate service.

- The mesh control plane typically operates as a certificate authority (CA) or integrates with an internal CA. It issues short-lived identities (SPIFFE/SPIRE or an equivalent) to proxies and enforces mTLS automatically for service-to-service traffic.
- Because certs rotate frequently and every connection validates identity, attackers cannot trivially replay or forge identities.

- Authorization: fine-grained access control at the application layer
- Even with mTLS proving a caller’s identity, you should limit which service identities can call which API endpoints.
- Implement authorization policies in the mesh (or in the application) so the proxy checks identity and intended operation on each request.
order service account to POST to the /charge endpoint:
- Who is calling (mTLS principal).
- What operation they are allowed to perform (HTTP method + path).
/refund), the proxy blocks it.

- Is the caller who it claims to be? (mTLS identity)
- Is that caller allowed to invoke this API/endpoint? (authorization policy)
References
Summary: Use a ClusterIP (no public endpoint), restrict ingress with Kubernetes NetworkPolicy, enforce cryptographic identities using mutual TLS (typically via a service mesh), and apply fine-grained authorization policies so only the intended service accounts can call specific endpoints.