r/PFSENSE•
itdumbass

Rule to enforce TLS 1.3?

RESOLVED

This may be a stupid question, but is there a way to use firewall rules (or maybe Snort rules) to stop inbound requests that are attempting to negotiate a TLS 1.0-1.2 1.1 session and force/allow only >= 1.3 1.2?

I have a situation with an Exchange OWA installation which will still allow 1.2, and maybe even 1.1, and while I understand that it needs to be upgraded server-side to effect a "proper" fix, I would like to stopgap it at the firewall.

Note that this is NOT for the pfSense webgui, but for https traffic to a server inside.

[Edit] - Seems I need TLS1.2 minimum, not only 1.3 as I had originally thought. Same question though, just move 1.2 from the 'uh-uh' column to the 'oh, ok' column.

[Edit - Resolution] Got it! I was able to get the opportunity to patch & configure the server, and we're all good now as far as TLS goes. I'd really like to thank everyone that responded here - you've all taught me things. Redditors are the best.

Posted Feb 8, 2021, 6:19 PM UTC · edited

1728
mrbudman•

Use a reverse proxy HAproxy for example. But until pfsense gets openssl update, I not sure if haproxy can even do tls 1.3. 2.5 is out soon which will have the update.

12
[deleted]•

[deleted]

3
mrbudman•

While HAproxy has prob been able to do it for long time, the openssl that comes with 2.4.5p1 only has 1.0.2 which I do not believe supports it.

OpenSSL> version
OpenSSL 1.0.2u-freebsd  20 Dec 2019

2.5 snapshots or when it releases it should have

OpenSSL upgraded to 1.1.1i-freebsd

5
[deleted]•

[deleted]

1
itdumbassOP•

This seems quite promising. Thank you.

1
[deleted]•

[deleted]

3
itdumbassOP•

Oh. How nice is that? Thanks!

1
rogerairgood•

I've been running 2.5 snapshots with haproxy-devel and I'm doing nearly exactly what OP wants to do. Not sure if 2.4 can do it though.

2
itdumbassOP•

Wow. That's great. Any chance you're doing what I want to do with Exchange in particular? 'Cause I may have a concern or two about activesync in addition to OWA.

2
rogerairgood•

I'm afraid not with Exchange specifically. That's one of the few Microsoft products I've not touched, thankfully haha

2
itdumbassOP•

Oh, OK. Enjoy your mental health, then. LOL!

1
kevdogger•

I'm not sure if this is a pfsense thing...however say you're using a reverse proxy behind pfsense such as nginx or traefik...you can definitely set the reverse proxy ip to only serve 1.3. I don't know enough about haproxy however the version in pfsense is really old

2
Pauley0•

Snort.

From the SNORT^(®) Users Manual 2.9.16, section 2.2.14.3 SSL/TLS: Rule Options

The following rule options are supported by enabling the ssl preprocessor:

ssl_version

The ssl_version rule option tracks the version negotiated between the endpoints of the SSL encryption. The list of version identifiers are below, and more than one identifier can be specified, via a comma separated list. Lists of identifiers are OR'ed together.

The option will match if any one of the OR'ed versions are used in the SSL connection. To check for two or more SSL versions in use simultaneously, multiple ssl_version rule options should be used.

Syntax

ssl_version: <version-list>
version-list = version | version , version-list
version      = ["!"] "sslv2" | "sslv3" | "tls1.0" | "tls1.1" | "tls1.2"

Examples

ssl_version:sslv3;
ssl_version:tls1.0,tls1.1,tls1.2;
ssl_version:!sslv2;

​

Used in conjunction with 2.11 Active Response to reset the connection. You probably don't want to block client's IP for an hour.

2.11.1 Enabling Active Response

This enables active responses (snort will send TCP RST or ICMP unreachable/port) when dropping a session.

2.11.2 Configure Sniping

Configure the number of attempts to land a TCP RST within the session's current window (so that it is accepted by the receiving TCP). This sequence "strafing" is really only useful in passive mode. In inline mode the reset is put straight into the stream in lieu of the triggering packet so strafing is not necessary.

2.11.4 React

React is a rule option keyword that enables sending an HTML page on a session and then resetting it.

​

Advantages to using SNORT: You don't have to screw with certificates, and you're not MITMing by terminating one SSL connection and establishing another.

I recommend specifically blocking older TLS versions, rather than specifically allowing newer TLS versions. If you block older TLS versions, this will allow all newer versions by default, even if they haven't been released yet. If you only allow the current version(s), you'll have to modify the rule when the next version is released.

​

Alternatively: SSL DoS, Snort, and You 10/31/2011

2
itdumbassOP•

This is why I came here.

Thank you. I'm not worthy.

2
Pauley0•

It's okay, we're all not worthy. :)

I was honestly kinda surprised there wasn't a option for this in the GUI.

2
itdumbassOP•

I was honestly kinda surprised there wasn't a option for this in the GUI.

Yeah. I wish there was. I'm reading this and thinking "cool. I need to make this: ssl_version:!sslv2,!sslv3,!tls1.0,!tls1.1,tls1.2;, and I look at the existing rules, and they are like:

 alert tcp $EXTERNAL_NET 119 -> $HOME_NET any (msg:"PROTOCOL-NNTP XHDR buffer overflow attempt"; sid:12636; gid:3; rev:6; classtype:attempted-user; reference:url,technet.microsoft.com/en-us/security/bulletin/ms07-056; reference:cve,2007-3897; metadata: engine shared, soid 3|12636, policy max-detect-ips drop;)     

and then I look at the custom rule input and it's a blank textarea, and I have no idea.

I obviously have a lot to read up.

2
Pauley0•

I've written some custom rules before, but it's been a bit. I can look at it after 5pm Eastern (in about 90 minutes). lmk if you come up with somethig before then.

1
Apfelwein•

I thought 1.2 was best you could do for anything hosted on IIS? Unless that’s changed you’re gonna run into websites that won’t load.

1
itdumbassOP•

Ahem... Hmm. Umm... <cough>... Well.... you are technically correct; the best kind of correct.

So... same question/issue, but with 1.2 now instead of 1.3. Oops.

2
Griffo_au•

Can confirm it's easy with haproxy in 2.5.dev versions. Just set the advanced SSL options to something like: no-sslv3 no-tlsv10 no-tlsv11 no-tlsv12

COnfirmed with SSL labs, but it seriously limits your browser choice.

1
Berzerker7•

I would highly recommend just forwarding 80/443 to an internal nginx server. That way, you have full control over what you need and don’t need to rely on pfsense supporting it.

1
itdumbassOP•

Hmm. I'll have to study up on nginx. I used to work with a lot of Apache - how different can it be, right?

1
bandit1216•

Have a look at IIS Crypto, it provides a GUI for all the windows registry settings that configure schannel. All MS services that use TLS use schannel which only supports up to TLS 1.2 currently. However you can restrict it to only allow TLS 1.2 and only the secure cipher suites (namely ECDHE/AES-GCM) so it's basically as secure as TLS 1.3. The main security innovation of 1.3 was removing all of the insecure ciphers that were kept in 1.2 for backwards compatibility, 1.2 will likely be around for a while. Be careful if you have other services running on that server that use schannel; some versions of MSSQL that are still supported only support TLS 1.0 (for example). Heavily restricting the available ciphers can sometimes break stuff.

1
the-prowler•

Nope

-2
Pauley0•
  1. When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.

https://en.wikipedia.org/wiki/Clarke%27s_three_laws

1
WikipediaSummary•

Clarke

Clarke is a surname which means "clerk". The surname is of English and Irish origin and comes from Latin clericus. Variants include Clerk and Clark.

About Me - Opt-in

^(You received this reply because you opted in. )^(Change settings)

1
Pauley0•

Incorrect bot. Close but it looks like you're truncating at the URL encoding.

1
the-prowler•

It was asked if firewall rules could do it. Putting a reverse proxy in front is technically a completely different question but nice reference...

1