Trung BìnhNetwork iconNetwork

Mutual TLS (mTLS) là gì? Khi nào cần dùng trong microservices?

mTLS (Mutual TLS) yêu cầu cả client và server present certificate, đảm bảo both-way authentication — cần thiết trong zero-trust microservice environments.

TLS thông thường: chỉ client verify server certificate (1-way TLS).

mTLS (Mutual TLS): cả server VÀ client đều present certificate và verify lẫn nhau — đảm bảo cả hai bên đều là ai nói là họ. Trong microservices: service A gọi service B, mTLS đảm bảo B chỉ accept request từ service được authorize và A biết đang nói chuyện với đúng B.

Tại sao cần mTLS trong microservices: zero-trust network — không trust bất kỳ internal traffic nào chỉ vì trong private network; ngăn rogue service impersonate service khác; service-level authentication (không phải user-level).

Implement: mỗi service có certificate issued bởi internal CA (Certificate Authority); Kubernetes SPIFFE/SPIRE tự động issue và rotate certificate cho workloads. Service mesh (Istio, Linkerd) implement mTLS tự động ở sidecar proxy level — developer không cần handle TLS trong application code.

Nhược điểm: certificate management phức tạp; performance overhead nhỏ hơn TLS do thêm certificate verification.

Xem toàn bộ Network cùng filter theo level & chủ đề con.

Mở danh sách Network