Skip to contentSkip to conversation

pull-filter reject = server hammering !

Openvpn-devel debbie10t 3 participants 12 messages Jun 10, 2016 – Jun 24, 2016

lore
Share & tools
lore

debbie10t

author
#0 lore raw

Hi,

today I successfully built git-master for windows x86_64 and started testing the new features.

You will be pleased to know that everything works well (as far as my limited knowledge and testing goes)

However, why does pull-filter reject throw SIGUSER1 ?

If the server pushes an item the client rejects then the client will just reconnect endlessly, completing a full reconnect to the server then restarting ! Thispractically constitutes a DDOS ..

I suggest this is changed from SIGUSR1 to SIGTERM.

Regards.

#1 lore raw

Hi,

Quoted 7 lines · On Fri, Jun 10, 2016 at 12:21:33PM +0100, debbie10t wrote:

today I successfully built git-master for windows x86_64 and started testing the new features.

You will be pleased to know that everything works well (as far as my limited knowledge and testing goes)

However, why does pull-filter reject throw SIGUSER1 ?

So the client can move to the next server - or retry, in case it was a temporary hickup at the server...

Quoted 4 lines

If the server pushes an item the client rejects then the client will just reconnect endlessly, completing a full reconnect to the server then restarting ! Thispractically constitutes a DDOS ..

"If you send me stuff that I find reject-worthy, you should be DoSed!!!"

Seriously: I expect people to notice that their VPN isn't connecting, and check the log, no?

@Selva, Arne: can we make the reconnect logic somewhat smarter overall, like "if reconnecting to the same host, wait 30 seconds instead of 5"?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
author
#2 lore raw

Hi,

Quoted 19 lines · Gert Doering

Hi,

Quoted 7 lines · On Fri, Jun 10, 2016 at 12:21:33PM +0100, debbie10t wrote:

today I successfully built git-master for windows x86_64 and started testing the new features.

You will be pleased to know that everything works well (as far as my limited knowledge and testing goes)

However, why does pull-filter reject throw SIGUSER1 ?

So the client can move to the next server - or retry, in case it was a temporary hickup at the server...

Quoted 4 lines

If the server pushes an item the client rejects then the client will just reconnect endlessly, completing a full reconnect to the server then restarting ! Thispractically constitutes a DDOS ..

"If you send me stuff that I find reject-worthy, you should be DoSed!!!"

Quoted 7 lines

Seriously: I expect people to notice that their VPN isn't connecting, and check the log, no?

@Selva, Arne: can we make the reconnect logic somewhat smarter overall, like "if reconnecting to the same host, wait 30 seconds instead of 5"?

gert

Very well .. going for the jugular ..

Consider:

VPN provider A (VPNA) doing good business
(Also fighting the GreatFireWall of China)

VPN provider B (VPNB) want to stop VPNA
(VPNB is the *Chinese Government* masquerading as VPNB)

VPNB modifies VPNA client configs to include
--pull-filter reject ""

VPNB deploys 1000s of machines with 1000s of VMs all running VPNA's modified client config ..

VPNA has to block China! (plus any other co-conspirators)

Chinese Government deals a huge blow to VPN providers. VPN providers drop openvpn as a supported platform.

IMO,
if a client wants to ignore and continue using a VPN - OK if a client wants to reject a pushed item then there must be a real reason, otherwise just ignore.
If a client believes a server is pushing maliciously then they would *not* want to connect again, until it is resolved.

Regards.

#3 lore raw

Hi,

Quoted 2 lines · On Fri, Jun 10, 2016 at 02:34:26PM +0100, debbie10t wrote:

VPNB modifies VPNA client configs to include
--pull-filter reject ""

How would VPNB do that?

And what would stop them from just inserting any of the other options (like, the x509 validation stuff) that leads to "this server stinks, go try the next one" - having the same effect?

[..]

Quoted 6 lines

IMO,
if a client wants to ignore and continue using a VPN - OK if a client wants to reject a pushed item then there must be a real reason, otherwise just ignore.
If a client believes a server is pushing maliciously then they would *not* want to connect again, until it is resolved.

This is a client decision. As with most of OpenVPN, we just give them rope. If they want to hang themselves, they are free to.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
author
#4 lore raw
Quoted 6 lines · Gert Doering

Hi,

Quoted 2 lines · On Fri, Jun 10, 2016 at 02:34:26PM +0100, debbie10t wrote:

VPNB modifies VPNA client configs to include
--pull-filter reject ""

How would VPNB do that?

Download it, modify it and distribute it to their attack bots.

Quoted 1 line

This is a client decision. As with most of OpenVPN, we just give them rope. If they want to hang themselves, they are free to.

Fair enough ..

Thanks

#5 lore raw

Hi,

Quoted 6 lines · On Fri, Jun 10, 2016 at 02:54:39PM +0100, debbie10t wrote:
Quoted 4 lines · Gert Doering
Quoted 2 lines · On Fri, Jun 10, 2016 at 02:34:26PM +0100, debbie10t wrote:

VPNB modifies VPNA client configs to include
--pull-filter reject ""

How would VPNB do that?

Download it, modify it and distribute it to their attack bots.

In that case - what would that be worse than just using "--tls-remote-name bah" (which also leads to "go to next server" restarts)?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#6 lore raw
In reply to Gert Doering

Hi,

Quoted 4 lines · On Fri, Jun 10, 2016 at 12:21:33PM +0100, debbie10t wrote:
Quoted 4 lines

If the server pushes an item the client rejects then the client will just reconnect endlessly, completing a full reconnect to the server then restarting ! Thispractically constitutes a DDOS ..

The logic used with reject is no different from what happens with many other failures. For example, try '--tls-verify /tmp' . For max effect use 2.3 so that the SIGUSR1 loop will wait only for 2 seconds between retries. Well, this is not a full connect, but does put some load on the server.

Now suppose we only provide '--pull-filter ignore opt' which doesn't trigger SIGUSR1. Then try this:

--pull-filter ignore ping --ping-restart 2

Quoted 9 lines · Gert Doering

"If you send me stuff that I find reject-worthy, you should be DoSed!!!"

Seriously: I expect people to notice that their VPN isn't connecting, and check the log, no?

@Selva, Arne: can we make the reconnect logic somewhat smarter overall, like
"if reconnecting to the same host, wait 30 seconds instead of 5"?

This is possible, but the case for progressively increasing the restart pause is not very strong. Can we get some feedback from people who serve 1000's of users?

Selva

#7 lore raw

Hi,

Quoted 7 lines · Selva Nair
Quoted 3 lines

@Selva, Arne: can we make the reconnect logic somewhat smarter overall, like
"if reconnecting to the same host, wait 30 seconds instead of 5"?

This is possible, but the case for progressively increasing the restart pause is not very strong. Can we get some feedback from people who serve 1000's of users?

I would generally consider it polite behaviour... (also, it might save the client from filled-up disks...) - didn't think of exponential back-off yet, but that would certainly be another approach to consider.

I have no idea how complicated it would be to implement, though.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#8 lore raw

Hi,

Quoted 9 lines · Gert Doering
Quoted 7 lines · Selva Nair
Quoted 3 lines

@Selva, Arne: can we make the reconnect logic somewhat smarter overall, like
"if reconnecting to the same host, wait 30 seconds instead of 5"?

This is possible, but the case for progressively increasing the restart pause is not very strong. Can we get some feedback from people who serve 1000's of users?

Quoted 5 lines

I would generally consider it polite behaviour... (also, it might save the client from filled-up disks...) - didn't think of exponential back-off yet, but that would certainly be another approach to consider.

I have no idea how complicated it would be to implement, though.

Filling up the client log with repeated retries is a concern, indeed.

Although a proper implementation needs the failed reconnect count per ip/port combination which we do not currently keep track of, I think a heuristic count may be good enough. One could use something like this:

n = c->options.unsuccessful_attempts
m = c->options.connection_list->len
rc = n/m (a rough measure of retries per remote)
timeout = the_default_timeout << MIN(rc, 10) (exponential up to ~ 5000 seconds).
throw a SIGHUP if rc exceeds some value (resets n and starts over)

The retry count will be over-stated for situations like one remote name that resolves to many IPs, but avoiding that requires more work.. Any thoughts?

Selva

#9 lore raw

HI,

Quoted 23 lines · Selva Nair
Quoted 9 lines
Quoted 3 lines

This is possible, but the case for progressively increasing the restart pause is not very strong. Can we get some feedback from people who serve 1000's of users?

I would generally consider it polite behaviour... (also, it might save the client from filled-up disks...) - didn't think of exponential back-off yet, but that would certainly be another approach to consider.

I have no idea how complicated it would be to implement, though.

Filling up the client log with repeated retries is a concern, indeed.

Although a proper implementation needs the failed reconnect count per ip/port combination which we do not currently keep track of, I think a heuristic count may be good enough. One could use something like this:

n = c->options.unsuccessful_attempts
m = c->options.connection_list->len
rc = n/m (a rough measure of retries per remote)
timeout = the_default_timeout << MIN(rc, 10) (exponential up to ~ 5000 seconds).
throw a SIGHUP if rc exceeds some value (resets n and starts over)

Quoted 3 lines

The retry count will be over-stated for situations like one remote name that resolves to many IPs, but avoiding that requires more work.. Any thoughts?

I'm not sure I understand the math. Let me try to reword.

So it would increase "n" for each failed attempt, setting it to "0" if one succeeds (so the reconnect after a session aborts would start "fresh").

Leaving out "m" for the time being, "retry time" would then get scaled by 2^rc (capped by 2^10), so the initial 5s would become 10s, 20s, ... 5000s (this is not "timeout" as in "the unified TCP connection timeout" but the retry timer firing after one connection attempt is aborted).

So, now we have 4 different remotes. You're scaling the exponent by 1/4 here, so the retry timer would be

5s 5s 5s 5s 10s 10s 10s 10s 20s 20s 20s 20s ...

then (or, phrased differently, "one round uses the unscaled timer, the next round across all remotes uses 2^1, the third round uses 2^2").

If I understood the math right, I think this would be useful behaviour ;-)
- fast failover if multiple remotes are there, exponentially slowing down if all remotes have been tried. Plus, fairly easy to implement as nearly all needed values are already around.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#10 lore raw
Quoted 27 lines · Gert Doering
Quoted 1 line · Selva Nair
Quoted 1 line
Quoted 1 line

This is possible, but the case for progressively increasing the

restart

Quoted 1 line
Quoted 1 line
Quoted 1 line

pause is not very strong. Can we get some feedback from people who

serve

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

1000's of users?

I would generally consider it polite behaviour... (also, it might save the client from filled-up disks...) - didn't think of exponential

back-off

Quoted 17 lines
Quoted 3 lines

yet, but that would certainly be another approach to consider.

I have no idea how complicated it would be to implement, though.

Filling up the client log with repeated retries is a concern, indeed.

Although a proper implementation needs the failed reconnect count per ip/port combination which we do not currently keep track of, I think a heuristic count may be good enough. One could use something like this:

n = c->options.unsuccessful_attempts
m = c->options.connection_list->len
rc = n/m (a rough measure of retries per remote)
timeout = the_default_timeout << MIN(rc, 10) (exponential up to ~ 5000 seconds).
throw a SIGHUP if rc exceeds some value (resets n and starts over)

Quoted 9 lines
Quoted 3 lines

The retry count will be over-stated for situations like one remote name that resolves to many IPs, but avoiding that requires more work.. Any thoughts?

I'm not sure I understand the math. Let me try to reword.

So it would increase "n" for each failed attempt, setting it to "0" if one succeeds (so the reconnect after a session aborts would start "fresh").

Yes it gets reset to zero in intialization_sequence_completed(). Or after a SIGHUP.

Quoted 6 lines

Leaving out "m" for the time being, "retry time" would then get scaled by 2^rc (capped by 2^10), so the initial 5s would become 10s, 20s, ... 5000s (this is not "timeout" as in "the unified TCP connection timeout" but the retry timer firing after one connection attempt is aborted).

timeout was a poorly chose name, its the startup pause time -- controlled by variables like
connect_retry_seconds or restart_sleep_seconds. It gets passed to openvpn_sleep.

Quoted 7 lines

So, now we have 4 different remotes. You're scaling the exponent by 1/4 here, so the retry timer would be

5s 5s 5s 5s 10s 10s 10s 10s 20s 20s 20s 20s ...

Quoted 8 lines

then (or, phrased differently, "one round uses the unscaled timer, the next round across all remotes uses 2^1, the third round uses 2^2").

If I understood the math right, I think this would be useful behaviour ;-)
- fast failover if multiple remotes are there, exponentially slowing down if all remotes have been tried. Plus, fairly easy to implement as nearly all needed values are already around.

Yes, the book-keeping variables are already there.

To avoid aggressive slowing down, may be we could start the scaling after rc has reached a threshold. Say don't do anything until rc = 5 and then start scaling the timer until rc reaches 15.

Selva

#11 lore raw

Hi,

Quoted 15 lines · Selva Nair
Quoted 5 lines

So, now we have 4 different remotes. You're scaling the exponent by 1/4 here, so the retry timer would be

5s 5s 5s 5s 10s 10s 10s 10s 20s 20s 20s 20s ...

Quoted 8 lines

then (or, phrased differently, "one round uses the unscaled timer, the next round across all remotes uses 2^1, the third round uses 2^2").

If I understood the math right, I think this would be useful behaviour ;-)
- fast failover if multiple remotes are there, exponentially slowing down if all remotes have been tried. Plus, fairly easy to implement as nearly all needed values are already around.

Quoted 5 lines

Yes, the book-keeping variables are already there.

To avoid aggressive slowing down, may be we could start the scaling after rc has reached a threshold. Say don't do anything until rc = 5 and then start scaling the timer until rc reaches 15.

I think that is a good addition to the original plan - a server might have a hickup for other reasons than pull-reject (maybe just restarting due to upgrades, whatever), and trying "a few times in quick sequence" before going into backoff should help in these cases.

Go for it :-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...