0

I have many bots that are accessing my site, and since they use mostly amazon web services to spam with the requests, in the logs it looks like that:

ec2-47-128-60-90.ap-southeast-1.compute.amazonaws.com
ad2-47-128-60-30.ap-southeast-1.compute.amazonaws.com

So i would like to know if it possible to create a rule that would block that request, if the host contains compute.amazonaws.com.

I tried that but it didn't work:

Order Deny,Allow
SetEnvIf Remote_Host compute.amazonaws.com keep_out
Deny from env=keep_out

Also tried that but it didn't work:

Order Deny,Allow
Deny from compute.amazonaws.com
New contributor
Sylvia889p is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
3
  • Normally your web server is not configured to do reverse DNS lookups, because they can really slow down the response and then Remote Host will not be available or only contain IP-addresses. See the HostnameLookups Directive - But regardless of the HostnameLookups setting, Reverse DNS always be done when you use host/domain names in httpd.apache.org/docs/2.4/mod/mod_authz_host.html .
    – HBruijn
    Dec 1 at 9:30
  • You're using legacy syntax with Order Deny, Allow - see : httpd.apache.org/docs/2.4/upgrading.html#run-time and should be using Require not host compute.amazonaws.com
    – HBruijn
    Dec 1 at 9:31
  • Thanks, unfortunately because of that reverse DNS, it doesn't seem to block anything even with : <RequireAll> Require all granted Require not host amazonaws.com </RequireAll>
    – Sylvia889p
    Dec 1 at 13:44

0

You must log in to answer this question.

Browse other questions tagged .