Skip to content

Commit

Permalink
Merge pull request #70 from natsys/http-dos-protector
Browse files Browse the repository at this point in the history
HTTP DoS protection module
  • Loading branch information
keshonok committed May 14, 2015
2 parents 37bb4cc + c67f3a8 commit 1ca833c
Show file tree
Hide file tree
Showing 14 changed files with 1,134 additions and 438 deletions.
49 changes: 49 additions & 0 deletions etc/tfw_frang.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Tempesta FW configuration: "frang" classifier.
#
# "include" directives are not supported yet, so paste the configuration to
# the main configuration file.

# TAG: frang_limits
#
# The section containing static limits for the classifier.
#
# Syntax:
# frang_limits {
# request_rate NUM;
# request_burst NUM;
# connection_rate NUM;
# connection_burst NUM;
# concurrent_connections NUM;
# client_header_timeout NUM;
# client_body_timeout NUM;
# http_uri_len NUM;
# http_field_len NUM;
# http_body_len NUM;
# http_host_required true|false;
# http_methods [METHOD]...;
# http_ct_required true|false;
# http_ct_vals ["CONTENT_TYPE"]...;
# }
#
# - options with names *_rate define requests/connections rate per second.
# - *_burst are temporal burst for 1/FRANG_FREQ of second.
# - http_* are static limits for contents of a HTTP request.
#
# Example:
# frang_limits {
# request_rate 20;
# request_burst 15;
# connection_rate 8;
# concurrent_connections 8;
# client_header_timeout 20;
# client_body_timeout 10;
# http_uri_len 1024;
# http_field_len 256;
# http_ct_required false;
# http_methods get post head;
# http_ct_vals "text/plain" "text/html";
# }
#
# Default:
# All limits are disabled (the values are set to zero/false/empty).
2 changes: 0 additions & 2 deletions tempesta_fw/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ tfw_addr_pton(const char *str, TfwAddr *addr)
else if (mode == 6)
ret = tfw_addr_pton_v6(str, &addr->v6);

if (ret)
TFW_ERR("Can't parse IP address: '%s'\n", str);
return ret;
}
DEBUG_EXPORT_SYMBOL(tfw_addr_pton);
Expand Down
6 changes: 3 additions & 3 deletions tempesta_fw/classifier/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.

EXTRA_CFLAGS += -I$(src)/../../sync_socket -I$(src)/../../tempesta_db/core \
-DDEBUG
-DDEBUG -Werror -O0 -g3

obj-m = tfw_req_conn_limit.o
tfw_req_conn_limit-objs = req_conn_limit.o
obj-m = tfw_frang.o
tfw_frang-objs = frang.o

Loading

0 comments on commit 1ca833c

Please sign in to comment.