ddos and slow post atacks pre-configure settings in add pages
pull/26/head
Aidaho12 2018-07-18 11:46:37 +06:00
parent 38947903a1
commit c98aeb6492
3 changed files with 53 additions and 1 deletions

View File

@ -79,6 +79,8 @@
<label for="ssl_offloading" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading">
<label for="forward_for" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for">
<label for="redispatch" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch">
<label for="slow_atack" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack">
<label for="ddos" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos">
<select name="force_close" class="force_close">
<option disabled selected>Force HTTP close</option>
<option>Off</option>
@ -222,6 +224,8 @@
<span class="controlgroup">
<label for="ssl_offloading1" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading1">
<label for="forward_for1" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for1">
<label for="slow_atack1" title="Slow atack protect">Slow atack</label><input type="checkbox" id="slow_atack1">
<label for="ddos1" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos1">
<select name="force_close" class="force_close">
<option disabled selected>Force HTTP close</option>
<option>Off</option>
@ -322,6 +326,7 @@
<label for="ssl_offloading2" title="Enable SSL Offloading">SSL Offloading</label><input type="checkbox" id="ssl_offloading2">
<label for="forward_for2" title="Option Forward for if none">Forward for</label><input type="checkbox" id="forward_for2">
<label for="redispatch2" title="Enable Redispatch">Redispatch</label><input type="checkbox" id="redispatch2">
<label for="ddos2" title="DDOS atack protect">DDOS</label><input type="checkbox" id="ddos2">
<select name="force_close" class="force_close">
<option disabled selected>Force HTTP close</option>
<option>Off</option>

View File

@ -97,7 +97,7 @@
</ul>
</nav>
<div class="copyright-menu">
HAproxy-WI v2.6.3
HAproxy-WI v2.6.3.1
<br>
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
</div>

View File

@ -801,6 +801,53 @@ $( function() {
replace_text("#optionsInput2", redispatch_var);
}
});
var slow_atack = "option http-buffer-request\ntimeout http-request 10s\n"
$('#slow_atack').click(function() {
if($('#optionsInput').val().indexOf(slow_atack) == '-1') {
$("#optionsInput").append(slow_atack)
} else {
replace_text("#optionsInput", slow_atack);
}
});
$('#slow_atack1').click(function() {
if($('#optionsInput1').val().indexOf(slow_atack) == '-1') {
$("#optionsInput1").append(slow_atack)
} else {
replace_text("#optionsInput1", slow_atack);
}
});
var table_name = Math.floor(Math.random() * 1000);
var ddos_var = "#Start config for DDOS atack protecte\n"+
"stick-table type ip size 1m expire 1m store gpc0,http_req_rate(10s),http_err_rate(10s)\n"+
"tcp-request connection track-sc1 src\n"+
"tcp-request connection reject if { sc1_get_gpc0 gt 0 }\n"+
"# Abuser means more than 100reqs/10s\n"+
"acl abuse sc1_http_req_rate("+table_name+") ge 100\n"+
"acl flag_abuser sc1_inc_gpc0("+table_name+")\n"+
"tcp-request content reject if abuse flag_abuser\n"+
"#End config for DDOS\n"
$('#ddos').click(function() {
if($('#optionsInput').val().indexOf(ddos_var) == '-1') {
$("#optionsInput").append(ddos_var)
} else {
replace_text("#optionsInput", ddos_var);
}
});
$('#ddos1').click(function() {
if($('#optionsInput1').val().indexOf(ddos_var) == '-1') {
$("#optionsInput1").append(ddos_var)
} else {
replace_text("#optionsInput1", ddos_var);
}
});
$('#ddos2').click(function() {
if($('#optionsInput2').val().indexOf(ddos_var) == '-1') {
$("#optionsInput2").append(ddos_var)
} else {
replace_text("#optionsInput2", ddos_var);
}
});
$( "#path-cert-frontend" ).autocomplete({
source: function( request, response ) {
$.ajax( {