use-case: Only allow TLS traffic outbound to internet (port 443) to specific domain, prevent any other traffic for any protocol on port 443, meaning protocols that don’t use TLS. This could be FTP, Telnet, HTTP (without ‘S’), RCP etc.
While I can’t test directly on AWS, this works for me locally:
pass tls any any -> any any (msg:"PASS TLS on port 443"; tls.sni; dotprefix; content:"suricata.io"; flow:to_server,established; sid:1000000;)
drop tcp any any -> any 443 (msg:"DROP NON TLS on port 443"; flow:to_server,established; sid:1000001;)
How did you test?
I can use curl, Chrome, etc to get to https://suricata.io, or https://forum.suricata.io. I can-not however telnet to anything over port 443. My test was nc -l 443 running on a remote host and trying to telnet/nc to it. The connection does get etablished, but no data sent from the client is received by the server.
@ish - I tested just with telnet to a public IP on port 443 (did not test data part), is there a way in Suricata to block this standalone TCP handshake too, while only allowing TCP that is part of TLS ?