Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am Under Attack Mode to Automatically enable during attack and disable when attack ends #25

Open
Webuser6666 opened this issue Mar 11, 2020 · 12 comments
Labels
feature request Requesting a new feature

Comments

@Webuser6666
Copy link

add Auto Switch ?

@C0nw0nk
Copy link
Owner

C0nw0nk commented Mar 11, 2020

What do you mean auto switch you have to elaborate and give more detail to what it is you are asking.

My guess is that you want a feature request of the script to automatically detect when under DDoS and switch on / off right ?

@Webuser6666
Copy link
Author

Webuser6666 commented Mar 11, 2020

My guess is that you want a feature request of the script to automatically detect when under DDoS and switch on / off right ?

yes ;)

@C0nw0nk
Copy link
Owner

C0nw0nk commented Mar 11, 2020

I can do it easily would require a nginx server config tweak for users though.

http {
     lua_shared_dict antiddos 10m; #Anti-DDoS shared memory zone
}

I will build it in disabled by default and people can add it to their setup and enable it if they want.

@C0nw0nk C0nw0nk added the feature request Requesting a new feature label Mar 11, 2020
@Webuser6666
Copy link
Author

Webuser6666 commented Mar 11, 2020

I can do it easily would require a nginx server config tweak for users though.

can add with a choice for people

@disaster123
Copy link

The question is how to detect when under ddos.

I had some things in mind:
1.) check avg. upstream response times and enable if avg response time is above threshold
2.) check avg. requests per IP for content-type html - at east in all cases i know just checking the requests / s is not useful as a lot of sites do a lot of stuff with json, css and so and i saw very high but valid requests

@C0nw0nk
Copy link
Owner

C0nw0nk commented Mar 12, 2020

Those are good methods i was also planning on using ngx.var.binary_remote_addr and inserting their binary IP's into the shared memory space the same as limit_conn and limit_req modules do in order to save memory space since binary data is smaller than the ngx.var.remote_addr string itself. I will add it as a feature with allot of sub features to make it easy to customise the domains, urls, paths, requests types etc you can throttle with it.

@rx-209
Copy link

rx-209 commented Mar 13, 2020

Hi. Short question - how to exclude some location for script?

@C0nw0nk
Copy link
Owner

C0nw0nk commented Mar 13, 2020

@rx-209 You want to exclude a domain or a URL path like /test/lol ?

@rx-209
Copy link

rx-209 commented Mar 14, 2020

@rx-209 You want to exclude a domain or a URL path like /test/lol ?

path like /test/lol

@C0nw0nk
Copy link
Owner

C0nw0nk commented Mar 15, 2020

@rx-209

bf420a3

That will allow you to set custom paths in the script to enable protection on and disable protection on.

local master_switch_custom_hosts = {

{
1, --run auth checks
"localhost/path1.*",
},
{
2, --bypass auth checks
"localhost/path2.*",
},

}

@Webuser6666 @disaster123

Currently building it at the moment may take a few weeks for me to finish.

@svaldnuk
Copy link

Has anyone been able to add this function or has a solution?

@fdmadong
Copy link

I can do it easily would require a nginx server config tweak for users though.

http {
     lua_shared_dict antiddos 10m; #Anti-DDoS shared memory zone
}

I will build it in disabled by default and people can add it to their setup and enable it if they want.

I didn't find a place to use this parameter in the documentation. Turning it on or off doesn't seem to affect the running of the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requesting a new feature
6 participants