2000-05-13 17:11:01 +00:00
|
|
|
--- servconf.c.orig Tue May 9 02:12:15 2000
|
|
|
|
+++ servconf.c Fri May 12 07:13:13 2000
|
|
|
|
@@ -74,6 +74,8 @@
|
2000-04-20 22:24:19 +00:00
|
|
|
options->ciphers = NULL;
|
|
|
|
options->protocol = SSH_PROTO_UNKNOWN;
|
2000-05-13 17:11:01 +00:00
|
|
|
options->gateway_ports = -1;
|
|
|
|
+ options->connections_per_period = 0;
|
|
|
|
+ options->connections_period = 0;
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
}
|
|
|
|
|
2000-04-20 22:24:19 +00:00
|
|
|
void
|
2000-05-13 17:11:01 +00:00
|
|
|
@@ -172,7 +174,7 @@
|
2000-04-20 22:24:19 +00:00
|
|
|
#ifdef SKEY
|
|
|
|
sSkeyAuthentication,
|
|
|
|
#endif
|
|
|
|
- sPasswordAuthentication, sListenAddress,
|
|
|
|
+ sPasswordAuthentication, sListenAddress, sConnectionsPerPeriod,
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
sPrintMotd, sIgnoreRhosts, sX11Forwarding, sX11DisplayOffset,
|
|
|
|
sStrictModes, sEmptyPasswd, sRandomSeedFile, sKeepAlives, sCheckMail,
|
|
|
|
sUseLogin, sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
|
2000-05-13 17:11:01 +00:00
|
|
|
@@ -231,6 +233,7 @@
|
2000-04-20 22:24:19 +00:00
|
|
|
{ "ciphers", sCiphers },
|
|
|
|
{ "protocol", sProtocol },
|
2000-05-13 17:11:01 +00:00
|
|
|
{ "gatewayports", sGatewayPorts },
|
|
|
|
+ { "connectionsperperiod", sConnectionsPerPeriod },
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2000-05-13 17:11:01 +00:00
|
|
|
@@ -340,7 +343,11 @@
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
filename, linenum);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
- value = atoi(cp);
|
|
|
|
+ if (sscanf(cp, " %d ", &value) != 1) {
|
|
|
|
+ fprintf(stderr, "%s line %d: invalid integer value.\n",
|
|
|
|
+ filename, linenum);
|
|
|
|
+ exit(1);
|
|
|
|
+ }
|
|
|
|
if (*intptr == -1)
|
|
|
|
*intptr = value;
|
|
|
|
break;
|
2000-05-13 17:11:01 +00:00
|
|
|
@@ -584,6 +591,21 @@
|
2000-04-20 22:24:19 +00:00
|
|
|
filename, linenum);
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
options->deny_groups[options->num_deny_groups++] = xstrdup(cp);
|
|
|
|
}
|
2000-04-20 22:24:19 +00:00
|
|
|
+ break;
|
|
|
|
+
|
In the meantime (while things are being worked and decided on on the
OpenBSD OpenSSH front), add ConnectionsPerPeriod to prevent DoS via
running the system out of resources. In reality, this wouldn't
be a full DoS, but would make a system slower, but this is a better
thing to do than let the system get loaded down.
So here we are, rate-limiting. The default settings are now:
Five connections are allowed to authenticate (and not be rejected) in
a period of ten seconds.
One minute is given for login grace time.
More work in this area is being done by alfred@FreeBSD.org and
markus@OpenBSD.org, at the very least. This is, essentially, a
stopgap solution; however, it is a properly implemented and documented
one, and has an easily modifiable framework.
1999-12-06 06:32:22 +00:00
|
|
|
+ case sConnectionsPerPeriod:
|
|
|
|
+ cp = strtok(NULL, WHITESPACE);
|
|
|
|
+ if (cp == NULL)
|
|
|
|
+ fatal("%.200s line %d: missing (>= 0) number argument.\n",
|
|
|
|
+ filename, linenum);
|
|
|
|
+ if (sscanf(cp, " %u/%u ", &options->connections_per_period,
|
|
|
|
+ &options->connections_period) != 2)
|
|
|
|
+ fatal("%.200s line %d: invalid numerical argument(s).\n",
|
|
|
|
+ filename, linenum);
|
|
|
|
+ if (options->connections_per_period != 0 &&
|
|
|
|
+ options->connections_period == 0)
|
|
|
|
+ fatal("%.200s line %d: invalid connections period.\n",
|
|
|
|
+ filename, linenum);
|
2000-04-20 22:24:19 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case sCiphers:
|