Log shows constant GET requests from unknown IP

2019-09-19 14:45发布

问题:

I have an Ubuntu, Apache, Rails 4 site on an AWS EC2 instance. My site was working fine but now is saying that it is overloaded with users. That is NOT the case as it is a private site. My --tail log shows that the site in constantly being requested with the following repeating GET requests.

I, [2015-04-01T21:37:43.996476 #1198]  INFO -- :   Rendered layouts/_google_analytics.html.erb (1.2ms)
I, [2015-04-01T21:37:43.997616 #1198]  INFO -- : Completed 200 OK in 1155ms (Views: 1154.0ms | ActiveRecord: 0.0ms)
I, [2015-04-01T21:37:44.184503 #1198]  INFO -- : Started GET "/" for 54.###.##.### at 2015-04-01 21:37:44 +0000
I, [2015-04-01T21:37:44.273012 #1198]  INFO -- : Processing by HomeController#home_page as */*
I, [2015-04-01T21:37:44.733609 #1198]  INFO -- :   Rendered home/_sign_up_modal.html.erb (99.0ms)
I, [2015-04-01T21:37:44.860521 #1198]  INFO -- :   Rendered home/home_page.html.erb within layouts/application (585.2ms)
I, [2015-04-01T21:37:44.864389 #1198]  INFO -- :   Rendered /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/stripe-rails-0.3.1/app/views/stripe/_js.html.erb (3.1ms)

The only different with each request is that the GET is from a different IP each time. 54.###.##.### changes each time. None of them are users, I am sure of that.

Started GET "/" for 54.###.##.### at 2015-04-01 21:37:44 +0000

Is this some sort of load attack? I am new to this and hope I am giving adequate information to help but please request more if I am not sharing enough.

/etc/apache2/sites-available/000-default.conf

    <VirtualHost *:80>
      ServerName ec2-54-###-###-##.us-west-2.compute.amazonaws.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /etc/projects/myapp/public

        <Directory /etc/projects/myapp/public>
                #Options FollowSymLinks
                Options Indexes FollowSymLinks Includes ExecCGI
                AllowOverride All
                Order deny,allow
                Allow from all
        </Directory>
   </VirtualHost>

EDIT

I added the following per https://wiki.apache.org/httpd/ProxyAbuse but now I am getting "You don't have permission to access / on this server." /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
  ServerName default.only
  <Location />
    Order allow,deny
    Deny from all
  </Location>
</VirtualHost>

<VirtualHost *:80>
  ServerName ec2-54-##-###-##.us-west-2.compute.amazonaws.com
  # !!! Be sure to point DocumentRoot to 'public'!
  DocumentRoot /etc/projects/myapp/public

    <Directory /etc/projects/myapp/public>
            #Options FollowSymLinks
            Options Indexes FollowSymLinks Includes ExecCGI
            AllowOverride All
            Order deny,allow
            Allow from all
    </Directory>

回答1:

Put a rule on amazon that will disallow (or limit) that IP range until you figure it out. You can set permissions that will allow/disallow IP ranges and ports.