Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log SSL/TLS Handshake details on Google Cloud Load Balancer

In order to identify what TLS version our clients are connecting with, I need to log details about the SSL/TLS handshake on a Google Cloud Load Balancer (GKE Ingress).

Logging the TLS/SSL version would be a great first step. I will need to identify which user the request is coming from in a second step.

By default, only the httpRequest is logged but contains no information about the handshake.

httpRequest: {
 latency: "0.077152s"
 remoteIp: "1.2.3.4"
 requestMethod: "POST"
 requestSize: "256988"
 requestUrl: "https://api.foo.bar/v1.0/foo"
 responseSize: "22746"
 serverIp: "1.2.3.4"
 status: 200
 userAgent: "axios/0.20.0"
}
like image 974
otherguy Avatar asked Nov 15 '25 11:11

otherguy


1 Answers

You can add the tls info via custom headers: https://cloud.google.com/load-balancing/docs/https/custom-headers?authuser=1#variables. You'll need to log these on your own. Please note there is a charge for custom headers.

like image 140
Mbrevda Avatar answered Nov 17 '25 08:11

Mbrevda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!