Suricata 5.0.1 and TLS 1.3 issue

Hello,

I have this rule in Suricata to block a certain HTTPS website:

reject tcp any any -> any any (msg:“Blocked TLS certificate for: chrome.google.com”; tls.cert_serial; content:" 31:79:87:25:0F:C0:BE:E8:08:00:00:00:00:56:05:ED"; sid:4294967271; gid:1 ;rev:1;)

The following command does result in an alert and gets blocked:

openssl s_client -connect chrome.google.com:443 -tls1_2

but not this one:

openssl s_client -connect chrome.google.com:443 -tls1_3

CONNECTED(00000003)
depth=2 OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign
verify return:1
depth=1 C = US, O = Google Trust Services, CN = GTS CA 1O1
verify return:1
depth=0 C = US, ST = California, L = Mountain View, O = Google LLC, CN = *.google.com
verify return:1

Certificate chain
0 s:C = US, ST = California, L = Mountain View, O = Google LLC, CN = *.google.com
i:C = US, O = Google Trust Services, CN = GTS CA 1O1
1 s:C = US, O = Google Trust Services, CN = GTS CA 1O1
i:OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign

Server certificate
-----BEGIN CERTIFICATE-----
MIIJcDCCCFigAwIBAgIQMXmHJQ/AvugIAAAAAFYF7TANBgkqhkiG9w0BAQsFADBC
MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMRMw
EQYDVQQDEwpHVFMgQ0EgMU8xMB4XDTIwMDgyNjA4MDg0OVoXDTIwMTExODA4MDg0
OVowZjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcT
DU1vdW50YWluIFZpZXcxEzARBgNVBAoTCkdvb2dsZSBMTEMxFTATBgNVBAMMDCou
Z29vZ2xlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABI4U6fi7rh/EZFO3
1np2UIurBcYucTLgPtvvHlo0Q6R0aitSOHUD8C365tqCEJJTm6AOKOphaCsMbd8i
2l8UG5CjggcHMIIHAzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lB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MEUCIFuyYsFzcB3C9NGC
w0dg+mk4dbQJtlDaLb6WbYDLbunIAiEAz9UtOWRBWO1E8jq+m0dGME2Mq2otddqS
8Bh+ZohIWg0AdgDnEvKwN34aYvuOyQxhhPHqezfLVh0RJlvz4PNL8kFUbgAAAXQq
BvnSAAAEAwBHMEUCIAtp246XVvtpiVX6BL+EZ8gOfSLC82TNNtrN1y9S0VYrAiEA
kliCqiMUqrMAn1OkfZPON3/LL8psHlY9Rxas6/Jk4IcwDQYJKoZIhvcNAQELBQAD
ggEBAC/eR0PNLQrtb208SzkO5gUXdFinM/ChEApSlFWAUopcoIhzNVXN2VFy3sKW
XFKD8soFoXJgBo7aTYAFamD+YKvM3AJnhEFHzeuvgGvs1Q1uVlq9AEfYYi9MAZN2
ELsWFcrU2bKSDl2WVgaVw6bWd/uXti9mBnwMIZGsjIQWYUACqfHKYuPgctp7qz9k
J7vQ/96gxG2jch28Dh2nagcVaXCqY9Jo7VDSRMQhyrTscwsMsoYX+s1KylcsVp0X
EA5ozm3hANRl8RFjn+QH2fvrNn53vJSjxQSMyvrseqMz+7FlgtAr5wIp+cSR2j5i
PoraKcKRu2DP1tL0W6UZN7GuuH4=
-----END CERTIFICATE-----
subject=C = US, ST = California, L = Mountain View, O = Google LLC, CN = *.google.com

issuer=C = US, O = Google Trust Services, CN = GTS CA 1O1

No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: ECDSA
Server Temp Key: X25519, 253 bits

SSL handshake has read 3831 bytes and written 323 bytes
Verification: OK

New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 256 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

Sounds like in the case of TLS 1.3 the certificate is not parsed correctly.

In TLS 1.3 the certificate is encrypted, so Suricata can’t parse it or match on it.